/* ============================================================
   RESPONSIVE — Breakpoints & Mobile Adjustments
   ============================================================ */

/* ── 1280px: Large desktops ── */
@media (max-width: 1280px) {
  .especialidades-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .especialidades-grid .esp-card:nth-child(1) {
    grid-column: span 1;
    grid-row: span 2;
  }
}

/* ── 1024px: Tablets landscape ── */
@media (max-width: 1024px) {

  :root {
    --section-pad: 5rem 2.5rem;
  }

  .navbar__links {
    gap: 1.4rem;
  }

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

  .especialidades-grid .esp-card:nth-child(1) {
    grid-row: auto;
    grid-column: span 2;
  }

  .especialidades-grid .esp-card {
    aspect-ratio: 4 / 3;
  }

  .nosotros-bento {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto 120px;
  }

  .bento-card--img {
    grid-column: span 2;
    grid-row: span 1;
    height: 340px;
  }

  .bento-card--intro {
    grid-column: span 2;
  }

  .bento-card--feature,
  .bento-card--feature:nth-child(3),
  .bento-card--feature:nth-child(4),
  .bento-card--feature:nth-child(5) {
    grid-column: span 1;
    grid-row: span 1;
  }

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

  .galeria-grid .galeria-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .galeria-grid .galeria-item:nth-child(n+2) {
    grid-column: span 1;
    grid-row: span 1;
  }

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

  .testimonios__layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .testimonios__left .section-title {
    font-size: 2.4rem;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .contacto__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }


}

/* ── 768px: Tablets portrait ── */
@media (max-width: 768px) {

  :root {
    --section-pad: 4rem 1.5rem;
  }

  #contacto {
    overflow-x: hidden;
  }

  /* Navbar */
  .navbar {
    padding: 0 1.5rem;
  }

  .navbar__links {
    display: none;
  }

  .navbar__hamburger {
    display: flex;
  }

  /* Page nums */
  .page-nums {
    display: none;
  }

  /* Hero */
  .hero__content {
    padding: 0 1.5rem;
    padding-top: calc(var(--navbar-h) + 2rem);
  }

  .hero__title {
    font-size: clamp(2.6rem, 10vw, 3.8rem);
  }

  .hero__cta-row {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 0;
  }

  .hero__cards {
    flex-direction: column;
  }

  .hero-card {
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }

  .hero-card:last-child {
    border-bottom: none;
  }

  /* Stats */
  .stats-bar {
    padding: 2rem 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }

  .stat-item {
    border-right: none;
    max-width: 140px;
  }

  .stat-item__number {
    font-size: 2.2rem;
  }

  /* Especialidades - Mobile Carousel */
  .especialidades-grid {
    display: flex;
    overflow-x: auto;
    gap: 1.25rem;
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--teal) var(--bg-card);
  }

  .especialidades-grid::-webkit-scrollbar {
    height: 4px;
  }

  .especialidades-grid::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
  }

  .especialidades-grid::-webkit-scrollbar-thumb {
    background: var(--teal);
    border-radius: 4px;
  }

  .especialidades-grid .esp-card {
    flex: 0 0 85%;
    height: 380px;
    scroll-snap-align: center;
    border-radius: 16px;
  }

  .especialidades-grid .esp-card .esp-card__desc {
    opacity: 1;
    transform: none;
  }

  /* Galería Responsive Masonry */
  .galeria-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 280px;
  }

  .galeria-grid .galeria-item {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }

  /* Médicos */
  .medicos-grid {
    grid-template-columns: 1fr;
  }

  /* Médicos */
  .medicos-grid {
    display: flex;
    overflow-x: auto;
    gap: 1.25rem;
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--teal) var(--bg-card);
    -webkit-overflow-scrolling: touch;
  }

  .medicos-grid::-webkit-scrollbar {
    height: 4px;
  }

  .medicos-grid::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
  }

  .medicos-grid::-webkit-scrollbar-thumb {
    background: var(--teal);
    border-radius: 4px;
  }

  .medicos-grid .medico-card {
    flex: 0 0 85%;
    scroll-snap-align: center;
    border-radius: 16px;
  }

  /* Testimonios mini */
  .testimonios__mini-grid {
    grid-template-columns: 1fr;
  }

  /* FAQ */
  .faq-item {
    padding: 1.4rem 1.2rem;
  }

  /* Contacto */
  .contacto__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .contacto__info {
    padding-right: 0;
  }

  .contacto__form-title {
    margin-top: 0;
  }

  .contacto__info .section-title {
    margin-bottom: 1.5rem;
  }

  /* Footer */
  footer {
    padding: 2.5rem 1.5rem 2rem;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Float buttons */
  .back-top {
    right: 1.5rem;
    bottom: 5.8rem;
  }

  .wa-float {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* ── 480px: Small phones ── */
@media (max-width: 480px) {

  .btn-primary,
  .btn-ghost {
    padding: 0.75rem 1.4rem;
  }

  .hero__title {
    font-size: 2.4rem;
  }



  .nosotros-bento {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .bento-card--img {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 200px;
  }

  .bento-card--intro {
    grid-column: span 1;
    grid-row: span 1;
  }

  .bento-card {
    padding: 2rem 1.5rem;
  }

  .bento-card--feature,
  .bento-card--feature:nth-child(3),
  .bento-card--feature:nth-child(4),
  .bento-card--feature:nth-child(5) {
    grid-column: span 1;
    grid-row: span 1;
  }

  .bento-card--intro .section-title {
    font-size: 2rem;
  }

  .galeria-grid {
    grid-auto-rows: 200px;
  }

  .stats-bar {
    gap: 1rem;
  }

  .stat-item {
    max-width: none;
    width: calc(50% - 0.5rem);
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}