/* ==========================================================================
   Responsive design — tablet, mobile and small-phone compositions
   ========================================================================== */

/* ---------- Large desktop refinements ---------- */
@media (min-width: 1600px) {
  .section { padding: 140px 0; }
  .hero-frame { height: 850px; }
}

/* ---------- Tablet landscape / small desktop ---------- */
@media (max-width: 1180px) {
  .primary-nav { gap: 17px; }
  .nav-link { font-size: 12.5px; }
  .header-inner { gap: 16px; }
  .btn-book { padding: 11px 18px; font-size: 13px; }
  .service-row { grid-template-columns: 50px 230px 1fr 30px; gap: 14px; }
  .about-image-wrap { height: 540px; }
  .footer-top { gap: 34px; }
}

/* ---------- Tablet: navigation becomes a drawer ---------- */
@media (max-width: 1024px) {
  .container { width: min(100% - 48px, var(--container)); }
  .section { padding: 96px 0; }

  .primary-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(88%, 380px);
    height: 100dvh;
    margin: 0;
    padding: 100px 30px 34px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    box-shadow: -18px 0 50px rgba(9, 31, 49, .18);
    transform: translateX(102%);
    transition: transform .38s var(--ease);
    overflow-y: auto;
    z-index: 210;
  }
  .primary-nav.is-open { transform: translateX(0); }
  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(6, 25, 39, .5);
    z-index: 205;
  }
  .primary-nav .nav-link {
    font-family: 'Manrope', sans-serif;
    font-size: 17px;
    font-weight: 600;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
  }
  .primary-nav .nav-link::after { display: none; }
  .btn-mobile-book { display: inline-flex; margin-top: 28px; width: 100%; }
  .menu-toggle { display: flex; }
  .header-actions { margin-left: auto; }
  .btn-book { display: none; }

  .hero-frame { height: 680px; }
  .hero-content { width: min(100% - 90px, 600px); }
  .hero-notes { gap: 22px; font-size: 11px; }
  .trust-item { padding-inline: 20px; }
  .trust-item strong { font-size: 32px; }

  .about-grid, .conditions-grid, .reviews-grid, .appointment-grid, .contact-grid { gap: 50px; }
  .about-image-wrap { height: 470px; }
  .service-feature-media { min-height: 400px; }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .why-card-wide { grid-column: span 2; }
  .process-track { gap: 20px; }
  .footer-top { grid-template-columns: 1fr 1fr; row-gap: 44px; }
}

/* ---------- Tablet portrait / large phone ---------- */
@media (max-width: 860px) {
  .section { padding: 82px 0; }
  section[id] { scroll-margin-top: 82px; }

  .split-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .split-head .section-text { padding-bottom: 0; }
  .section-head { margin-bottom: 44px; }

  .hero-section { padding-top: 92px; }
  .hero-frame { width: min(100% - 24px, 1480px); height: 620px; min-height: 0; border-radius: 22px; }
  .hero-content { left: 40px; width: min(100% - 80px, 560px); }
  .hero-content h1 { font-size: clamp(42px, 6.2vw, 62px); }
  .hero-lede { font-size: 15.5px; }
  .hero-notes { display: none; }
  .scroll-cue { bottom: 24px; }

  .trust-strip { grid-template-columns: repeat(2, 1fr); row-gap: 26px; margin-top: 34px; }
  .trust-item { padding: 0 24px; }
  .trust-item:nth-child(odd) { border-left: 0; padding-left: 0; }

  .about-grid, .conditions-grid, .reviews-grid, .appointment-grid, .contact-grid { grid-template-columns: 1fr; gap: 44px; }
  .about-image-wrap { height: 500px; max-width: 560px; }
  .about-seal { right: 12px; bottom: 78px; width: 112px; height: 112px; }
  .about-doctor .text-link { margin-left: 0; width: 100%; }

  .service-feature { grid-template-columns: 1fr; }
  .service-feature-media { min-height: 320px; }
  .service-feature-body { padding: 38px 32px 42px; }
  .service-pair { grid-template-columns: 1fr; }
  .service-card-media { height: 260px; }

  .service-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 20px 14px; }
  .service-row:hover { padding-left: 18px; }
  .row-icon { flex: 0 0 auto; width: 40px; height: 40px; }
  .row-title { flex: 1 1 60%; min-width: 0; }
  .row-arrow { order: 2; margin-left: auto; }
  .row-desc { order: 3; flex: 1 0 100%; }

  .why-grid { grid-template-columns: 1fr 1fr; }
  .why-card { min-height: 230px; padding: 30px; }
  .why-card-wide { grid-column: span 2; }

  .process-track { grid-template-columns: 1fr; gap: 32px; padding-top: 0; padding-left: 0; }
  .process-line { top: 22px; bottom: 22px; left: 22px; right: auto; width: 1px; height: auto; }
  .process-step { padding-top: 0; padding-left: 70px; min-height: 48px; }
  .step-dot { top: -2px; left: 0; box-shadow: 0 0 0 7px var(--light); }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 240px 180px 200px 190px;
    grid-template-areas:
      'a a'
      'b c'
      'd d'
      'e e';
  }

  .reviews-summary { display: grid; grid-template-columns: 1fr auto; column-gap: 24px; align-items: end; }
  .reviews-summary .section-label { grid-column: 1 / -1; }
  .reviews-summary .btn { grid-column: 1 / -1; justify-self: start; }
  .reviews-note { padding-top: 46px; }

  .map-wrap iframe { height: 400px; }
}

/* ---------- Mobile: intentionally compact ---------- */
@media (max-width: 640px) {
  .container { width: min(100% - 36px, var(--container)); }
  .section { padding: 72px 0; }

  .site-header { padding: 12px 0; }
  .header-inner { width: min(100% - 24px, 1400px); padding: 8px 8px 8px 14px; border-radius: 20px; }
  .site-header.is-scrolled .header-inner { width: min(100% - 24px, 1400px); padding-block: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text strong { font-size: 16px; }
  .brand-text > span { font-size: 9px; }
  .menu-toggle { width: 40px; height: 40px; }

  .hero-section { padding-top: 78px; }
  .hero-frame {
    width: calc(100% - 16px);
    height: auto;
    min-height: 640px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
  .hero-image { position: absolute; inset: 0; object-position: 62% center; }
  .hero-scrim { background: linear-gradient(180deg, rgba(7, 28, 44, .42) 0%, rgba(7, 28, 44, .48) 36%, rgba(7, 28, 44, .92) 100%); }
  .hero-content {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    padding: 40px 24px 58px;
    margin-top: auto;
  }
  .hero-eyebrow { font-size: 10px; margin-bottom: 18px; letter-spacing: .12em; }
  .hero-content h1 { font-size: clamp(38px, 10vw, 52px); }
  .hero-lede { margin-top: 18px; font-size: 14.5px; }
  .hero-buttons { margin-top: 26px; gap: 10px; }
  .hero-buttons .btn { flex: 1 1 100%; }
  .hero-rating { margin-top: 26px; font-size: 12px; gap: 8px; }
  .scroll-cue { display: none; }

  .trust-strip { gap: 0; }
  .trust-item { padding: 16px 14px; border-top: 1px solid var(--line); }
  .trust-item:nth-child(1), .trust-item:nth-child(2) { border-top: 0; }
  .trust-item:nth-child(3) { border-left: 1px solid var(--line); }
  .trust-item:nth-child(4) { border-left: 0; }
  .trust-item strong { font-size: 28px; }
  .trust-item p { font-size: 11.5px; }

  .section-label { font-size: 11px; margin-bottom: 18px; }
  .section-title { font-size: clamp(29px, 7.6vw, 38px); }
  .section-text { font-size: 15px; }

  .about-image-wrap { height: 400px; border-radius: 190px 190px 20px 20px; }
  .about-seal { width: 96px; height: 96px; right: 0; bottom: 72px; }
  .about-seal span { font-size: 10.5px; }
  .about-caption p { font-size: 12px; }
  .about-points { gap: 20px; margin-top: 30px; }
  .about-doctor { margin-top: 30px; gap: 12px; }

  .service-feature-media { min-height: 250px; }
  .service-feature-body { padding: 30px 24px 34px; }
  .service-feature-body h3 { font-size: 29px; margin: 12px 0 14px; }
  .service-feature-body > p { font-size: 15px; }
  .service-meta { margin: 20px 0 26px; gap: 8px 16px; }
  .service-card-media { height: 220px; }
  .service-card-body { padding: 26px 24px 30px; }
  .service-card-body h3 { font-size: 22px; }
  .service-index { margin-top: 54px; }
  .service-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 20px 12px; }
  .row-icon { width: 40px; height: 40px; flex: 0 0 auto; }
  .row-title { flex: 1 1 60%; min-width: 0; font-size: 15.5px; }
  .row-arrow { order: 2; margin-left: auto; }
  .row-desc { order: 3; flex: 1 0 100%; font-size: 12.5px; }

  .conditions-list li { font-size: 19px; padding: 17px 2px; gap: 14px; }
  .conditions-list li:hover { padding-left: 4px; }

  .why-grid { grid-template-columns: 1fr; gap: 14px; }
  .why-card, .why-card-wide { grid-column: auto; min-height: 0; padding: 28px; }
  .why-card h3 { font-size: 20px; margin-top: 20px; }
  .why-card p { font-size: 13.5px; }
  .why-number { font-size: 62px; }

  .process-track { gap: 28px; }
  .process-step { padding-left: 62px; }
  .step-dot { width: 42px; height: 42px; font-size: 14px; }
  .process-step h3 { font-size: 18px; }
  .process-step p { font-size: 13.5px; }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 200px 150px 180px 180px;
    gap: 12px;
  }
  .gallery-caption { padding: 28px 14px 14px; font-size: 11.5px; }

  .reviews-score { font-size: 84px; }
  .reviews-score span { font-size: 24px; }
  .reviews-summary { display: block; }
  .reviews-note { padding: 40px 26px 30px; }
  .google-glyph { left: 26px; width: 46px; height: 46px; font-size: 24px; }

  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-wrap { padding: 28px 22px; }
  .form-head h3 { font-size: 23px; }
  .btn-block { padding-inline: 16px; }

  .contact-block { gap: 14px; padding: 18px 0; }
  .contact-icon { width: 40px; height: 40px; }
  .map-wrap iframe { height: 340px; }
  .map-badge { left: 12px; bottom: 12px; padding: 8px 12px; font-size: 11px; }

  .footer-top { grid-template-columns: 1fr; gap: 34px; padding: 64px 0 44px; }
  .footer-bottom { flex-direction: column; gap: 8px; }

  .lightbox { padding: 18px; }
  .lightbox img { max-height: 76vh; }
  .back-to-top { right: 14px; bottom: 14px; width: 44px; height: 44px; }
}

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
  .hero-frame { min-height: 600px; }
  .hero-content { padding: 30px 18px 48px; }
  .hero-content h1 { font-size: 36px; }
  .hero-rating .rating-divider { display: none; }
  .trust-item strong { font-size: 25px; }
  .about-image-wrap { height: 340px; }
  .primary-nav { padding-inline: 22px; }
  .gallery-grid { grid-template-rows: 170px 140px 160px 160px; }
}
