/* ============================================
   ABBA CENTRO CLÍNICO — Responsive Styles
   Breakpoints:
     Desktop XL : > 1200px  (default)
     Desktop    : 1025–1200px
     Tablet     : 769–1024px
     Mobile L   : 481–768px
     Mobile S   : <= 480px
   ============================================ */

/* --- Desktop (max 1200px) --- */
@media (max-width: 1200px) {
  .footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 2rem;
  }

  .values-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .plan-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

/* --- Tablet Large (max 1024px) --- */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__decoration {
    display: none;
  }

  .about-grid {
    gap: 3rem;
  }

  .values-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .plan-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-card__number {
    font-size: 2.5rem;
  }
}

/* --- Touchscreen devices (cellphones) in landscape --- */
@media (min-width: 769px) and (max-width: 1024px) and (pointer: coarse) {
  .nav__menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .nav__logo img {
    height: 38px;
  }
}

/* --- Tablet / Mobile Large (max 768px) --- */
@media (max-width: 768px) {
  /* Navigation */
  .nav__menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* Grids */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about__image-wrapper {
    order: -1;
  }

  .about__label {
    justify-content: center;
  }

  .about__title {
    text-align: center;
  }

  .values-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .value-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
  }

  .value-item:last-child {
    border-bottom: none;
  }

  /* Hero */
  .hero {
    min-height: 90vh;
    text-align: center;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__description {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero__label {
    justify-content: center;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  /* Section */
  .section {
    padding: clamp(3rem, 6vw, 5rem) 0;
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  /* Testimonial Cards */
  .testimonial-card {
    padding: 1.5rem;
  }

  /* Footer */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  /* Contact */
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-row--2 {
    grid-template-columns: 1fr;
  }

  .form-row--3 {
    grid-template-columns: 1fr 1fr;
  }

  /* Blog post */
  .post-content {
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  /* Plan grid */
  .plan-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* CTA Section */
  .cta-section__text {
    margin-left: auto;
    margin-right: auto;
  }

  /* Team cards */
  .team-card {
    padding: 1.5rem;
  }

  /* Service cards */
  .service-card {
    padding: 1.5rem;
  }

  /* Cards */
  .card {
    padding: 1.5rem;
  }

  /* Plan cards */
  .plan-card {
    padding: 1.5rem;
  }

  /* Contact items */
  .contact-item {
    flex-wrap: wrap;
  }

  .contact-item__icon {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }

  /* Page hero breadcrumb */
  .page-hero__breadcrumb {
    font-size: var(--fs-xs);
  }

  /* Post content and sidebar */
  .post-content {
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
  }

  .post-sidebar {
    position: static;
  }

  /* Dark toggle - hide on mobile (not functional) */
  .dark-toggle {
    display: none !important;
  }
}

/* --- Mobile Small (max 480px) --- */
@media (max-width: 480px) {
  :root {
    --fs-hero: 2rem;
    --fs-h1: 1.65rem;
    --fs-h2: 1.4rem;
    --fs-h3: 1.2rem;
    --fs-h4: 1.1rem;
    --fs-body: 0.95rem;
    --container-padding: 1.25rem;
  }

  /* Hero */
  .hero {
    min-height: 85vh;
    padding-top: 5rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 100%;
  }

  /* Buttons */
  .btn {
    padding: 12px 20px;
    font-size: var(--fs-xs);
  }

  .btn-lg {
    padding: 14px 24px;
    font-size: var(--fs-small);
  }

  /* WhatsApp Float */
  .whatsapp-float {
    width: 52px;
    height: 52px;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.4rem;
  }

  .whatsapp-float svg {
    width: 24px;
    height: 24px;
  }

  /* Cards */
  .card {
    padding: 1.25rem;
  }

  .service-card {
    padding: 1.25rem;
  }

  .service-card__number {
    font-size: 2rem;
  }

  .testimonial-card {
    padding: 1.25rem;
  }

  .testimonial-card::before {
    font-size: 3.5rem;
    top: 0.25rem;
    left: 1rem;
  }

  /* Team cards */
  .team-card {
    padding: 1.25rem;
  }

  .team-card__avatar {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
  }

  /* Plan grid */
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .plan-card {
    padding: 1.25rem;
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  /* Form */
  .form-row--3 {
    grid-template-columns: 1fr;
  }

  .contact-form-card {
    padding: 1.25rem;
  }

  .contact-form-card__header {
    flex-direction: column;
    text-align: center;
  }

  .contact-form-card__icon {
    margin: 0 auto;
  }

  /* Post header */
  .post-header__meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .post-header {
    padding-top: 7rem;
  }

  /* Page hero */
  .page-hero {
    padding-top: 6rem;
    padding-bottom: 2.5rem;
  }

  /* Value items */
  .value-item {
    padding: 1.25rem 0;
  }

  .value-item__icon {
    width: 48px;
    height: 48px;
  }

  /* Section header */
  .section-header {
    margin-bottom: 2rem;
  }

  /* Contact info items */
  .contact-item {
    gap: 0.75rem;
  }

  /* Footer */
  .footer {
    padding-top: 2.5rem;
  }

  .footer__grid {
    gap: 1.5rem;
  }

  /* Form step label */
  .form-step__label {
    font-size: var(--fs-xs);
    gap: 0.4rem;
  }

  .form-step__number {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }

  /* Map iframe */
  iframe {
    height: 180px !important;
  }

  /* CTA buttons */
  .cta-section .btn {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }

  /* Specialty block on especialidades page */
  .specialty-block__image .about__image-placeholder {
    min-height: 220px;
  }

  .specialty-block__icon {
    width: 44px;
    height: 44px;
  }

  .specialty-block__icon svg {
    width: 22px;
    height: 22px;
  }
}

/* --- Extra Small (max 360px) --- */
@media (max-width: 360px) {
  :root {
    --fs-hero: 1.75rem;
    --fs-h1: 1.5rem;
    --fs-h2: 1.3rem;
    --fs-body: 0.9rem;
  }

  .hero {
    min-height: 80vh;
  }

  .whatsapp-float {
    width: 46px;
    height: 46px;
    bottom: 0.75rem;
    right: 0.75rem;
  }

  .card,
  .service-card,
  .testimonial-card,
  .team-card,
  .plan-card {
    padding: 1rem;
  }

  .team-card__avatar {
    width: 64px;
    height: 64px;
    font-size: 1.2rem;
  }
}

/* --- Landscape mobile (max-height 500px, max-width 768px) --- */
@media (max-width: 768px) and (max-height: 500px) {
  .nav {
    padding: 0.4rem 0;
  }

  .nav__logo img {
    height: 36px;
    max-width: 120px;
  }

  .hero {
    min-height: 100vh;
    padding-top: 3.5rem;
  }

  .hero__description {
    font-size: var(--fs-small);
    margin-bottom: 1.5rem;
  }

  .page-hero {
    padding-top: 3.5rem;
    padding-bottom: 1.5rem;
  }

  .page-hero__breadcrumb {
    display: none;
  }
}

/* --- Tablet landscape tweaks --- */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
  .hero {
    min-height: 70vh;
  }
}

/* --- Print Styles --- */
@media print {
  .nav,
  .whatsapp-float,
  .mobile-menu,
  .mobile-menu-overlay,
  .hamburger {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  body {
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .scroll-animate {
    opacity: 1;
    transform: none;
  }

  .hero__label,
  .hero__title,
  .hero__description,
  .hero__actions,
  .hero__decoration,
  .page-hero__title,
  .page-hero__breadcrumb {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .divider::after {
    animation: none;
    display: none;
  }
}

/* --- High DPI / Retina --- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .nav__logo img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* --- Touch Device Optimizations --- */
@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets on mobile */
  .nav__link {
    padding: 0.5rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .mobile-menu .nav__link {
    min-height: 48px;
    padding: 0.75rem 0;
    font-size: var(--fs-body);
  }

  .btn {
    min-height: 44px;
  }

  .footer__link {
    min-height: 36px;
    display: flex;
    align-items: center;
  }

  .card__link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  /* Disable hover transform on cards to prevent jank on touch */
  .card:hover {
    transform: none;
  }

  .service-card:hover {
    transform: none;
  }

  .blog-card:hover {
    transform: none;
  }

  .team-card:hover .team-card__avatar {
    transform: none;
  }

  /* Keep the border/shadow changes on hover for visual feedback */
  .card:hover::before {
    opacity: 1;
  }
}
