/* Camada final de responsividade: mantém o ritmo visual e a leitura em telas pequenas. */
@media (max-width: 700px) {
  html { scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }
  img, video, iframe { max-width: 100%; }
  .container { width: min(calc(100% - 2rem), var(--container)); }
  .section { padding-block: 3.5rem; }
  h1 { font-size: clamp(2.35rem, 12vw, 3.5rem); line-height: 1.08; }
  h2 { font-size: clamp(2rem, 10vw, 2.8rem); line-height: 1.1; }

  .header-row, .site-header.is-scrolled .header-row { min-height: 72px !important; gap: .75rem; }
  .site-header .brand { flex: 1; }
  .site-header .brand img { width: auto; max-width: 158px; max-height: 54px; }
  .menu-toggle { display: grid; min-width: 44px; min-height: 44px; padding: .55rem; place-items: center; border: 0; background: transparent; color: #fff; font-size: 0; }
  .menu-toggle::before { content: '☰'; font-family: Arial, sans-serif; font-size: 1.45rem; font-weight: 400; line-height: 1; }
  .main-nav, .site-header.is-scrolled .main-nav { top: 72px; gap: 0; padding: .35rem 1rem .85rem; background: #617A80; border: 0; box-shadow: 0 14px 24px rgba(12,38,54,.2); }
  .main-nav a { width: 100%; padding: .78rem .25rem; color: #fff !important; font-size: .95rem; border-bottom: 1px solid rgba(255,255,255,.14); }
  .main-nav a:last-child { border-bottom: 0; }

  .hero { min-height: min(540px, 88svh); padding: 6.5rem 0 3.25rem; }
  .hero h1 { max-width: 12ch; font-size: clamp(2.3rem, 10.5vw, 3.05rem); line-height: 1.04; }
  .hero .eyebrow { margin-bottom: .65rem; font-size: .68rem; }
  .client-proof__reviews-intro > p:not(.eyebrow),
  .walk-in-note,
  #resultados .section-heading > p:not(.eyebrow),
  #resultados .legal-note,
  .connection-benefits p { display: none; }
  .treatment-hero__copy > p:not(.eyebrow):not(.breadcrumbs) { font-size: 1rem; }
  .actions { display: grid; grid-template-columns: 1fr; margin-top: 1.45rem; }
  .actions .button, .hero .button { width: 100%; }
  .button { min-height: 48px; }
  .hero__media { min-height: 260px; }

  .section-heading { margin-bottom: 1.75rem; }
  .treatment-grid { gap: 1.15rem; }
  .treatment-grid .card { min-height: 0; }
  .treatment-grid .card__media { min-height: 210px; }
  .treatment-grid .card__body { padding: 1.05rem 0 1.2rem; }

  .client-proof { padding-top: 2.5rem; padding-bottom: 4.2rem; }
  .client-proof__grid { width: min(calc(100% - 2rem), 1080px); }
  .client-proof__reviews .reviews-widget-container,
  .treatment-google .reviews-widget-container { width: 100%; max-width: 100%; overflow: hidden; }
  .reviews-widget-row,
  .treatment-google .reviews-widget-row { flex-direction: column; gap: .85rem; }
  .google-rating-summary,
  .treatment-google .google-rating-summary { flex: 0 0 auto; width: min(100%, 210px); padding: 0; }
  .client-proof__reviews .google-reviews-widget,
  .treatment-google .google-reviews-widget { width: 100%; max-width: 100%; margin-inline: auto; }
  .client-proof__reviews .google-reviews-widget iframe { max-width: 100% !important; }
  .client-proof__location { gap: 1.5rem; }
  .client-proof__map { min-height: 225px; }
  .client-proof__address h2 { font-size: clamp(1.5rem, 8vw, 2.1rem); }

  .connection { padding-top: 3.75rem; padding-bottom: 4.7rem; }
  .connection__content { gap: 2rem; padding-left: 0; }
  .connection h2 { font-size: clamp(2rem, 8.5vw, 2.55rem); line-height: 1.04; }
  .connection-benefits { grid-template-columns: 1fr; gap: .8rem; }
  .connection-benefits article { align-items: center; }
  .connection-benefits h3 { margin: 0; }
  .connection__media { width: min(100%, 470px); margin-inline: auto; }
  .connection__media img { min-height: 300px; }
  .connection::before { top: -4.25rem; left: .8rem; width: 210px; height: 150px; right: auto; bottom: auto; opacity: .08; transform: none; }
  .connection::after { content: ''; }
  .connection .button { width: 100%; }

  #equipe { padding-block: 3.5rem; }
  #equipe .section-heading { padding: 0; }
  #equipe .team-grid { display: grid; grid-template-columns: repeat(5, minmax(238px, 76vw)); max-width: none; margin-right: -1rem; padding: .35rem 1rem 1rem 0; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  #equipe .team-grid::-webkit-scrollbar { display: none; }
  #equipe .team-card { scroll-snap-align: start; }

  .clinic-gallery { padding-top: 2.3rem; padding-bottom: 3.4rem; }
  .clinic-gallery__viewport { padding-block: 1rem 1.5rem; }
  .clinic-gallery__track { padding-inline: calc(50% - 39vw); scroll-padding-inline: calc(50% - 39vw); }
  .clinic-gallery__item, .clinic-gallery__item:nth-child(3) { flex-basis: 78vw; height: 350px; }

  #resultados { padding-block: 3.5rem; }
  #resultados .results-grid { gap: 1rem; }
  #resultados .media-placeholder { min-height: 220px; }

  body:not([data-treatment]) .site-footer { padding: 3rem 0 1.35rem; }
  body:not([data-treatment]) .site-footer .footer-grid { gap: 1.65rem; }
  body:not([data-treatment]) .site-footer .footer-brand img { width: 200px; }
  body:not([data-treatment]) .site-footer .copyright { margin-top: 1.7rem; }
  .site-footer .footer-credit { display: block; margin: .3rem 0 0; white-space: normal; }

  .floating-whatsapp { right: max(.9rem, env(safe-area-inset-right)); bottom: max(.9rem, env(safe-area-inset-bottom)); width: 56px; height: 56px; }
  .floating-whatsapp::before { width: 56px; height: 56px; }
  .floating-whatsapp svg { margin-right: 0; }
  .floating-whatsapp span { display: none; }

  /* Páginas individuais dos tratamentos */
  .treatment-hero { padding: 2.5rem 0 3.25rem; }
  .treatment-hero::before { width: 300px; height: 300px; right: -165px; top: -145px; box-shadow: 0 0 0 42px rgba(219,188,104,.1), 0 0 0 85px rgba(97,122,128,.06); }
  .treatment-hero__grid { gap: 2rem; }
  .treatment-hero h1 { max-width: 12ch; font-size: clamp(2.45rem, 12vw, 3.65rem); }
  .treatment-hero__image { min-height: 245px; height: 60vw; }
  .treatment-hero .button, .treatment-faq__cta, .treatment-contact .button { width: 100%; }

  .treatment-overview { padding-top: 3.5rem; background: #fff; }
  .treatment-overview__grid { gap: 2.5rem; }
  .treatment-overview__extended { gap: 1.1rem; margin-top: 2.5rem; padding: 1.5rem; }
  .treatment-overview__extended > div { gap: 1rem; }
  .treatment-overview__extended::after { width: 150px; height: 150px; right: -82px; bottom: -82px; }
  .treatment-overview__notes { gap: 1.25rem; }
  .treatment-overview__notes div { padding-left: 1rem; }

  .treatment-benefits { padding: .25rem 0 2.5rem; }
  .treatment-benefits__grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
  .treatment-benefits article { min-height: 126px; gap: .5rem; padding: .75rem .5rem; }
  .treatment-benefits svg { width: 32px; height: 32px; }
  .treatment-benefits h3 { font-size: .68rem; line-height: 1.2; }
  .treatment-google { padding-block: 2.35rem; }
  .treatment-google__link { width: min(100%, 285px); min-width: 0; }

  .treatment-faq { padding-top: 3.25rem; }
  .treatment-faq .faq { margin-top: 1.5rem; }
  .treatment-faq .faq details { padding-block: .9rem; }
  .treatment-faq .faq summary { padding-right: .25rem; font-size: 1rem; line-height: 1.35; }
  .treatment-faq .faq p { font-size: .94rem; line-height: 1.6; }
  .treatment-faq__cta { margin-top: 1.4rem; }

  .treatment-cta { padding-block: 3.25rem; }
  .treatment-cta h2 { font-size: clamp(2rem, 10vw, 2.75rem); }
  .treatment-team, .treatment-space { padding-block: 3.25rem; }
  .treatment-carousel { grid-auto-columns: 84vw; gap: .8rem; }
  .treatment-space__grid { gap: .7rem; }
  .treatment-space__grid img { height: 220px; }

  .treatment-contact { padding: 3.75rem 0 4.5rem; }
  .treatment-contact::before { width: 185px; height: 125px; right: -2px; bottom: 12px; opacity: .1; }
  .treatment-contact::after { bottom: 1.5rem; }
  .treatment-contact__grid { gap: 2.5rem; }
  .treatment-contact__intro { padding-left: 1rem; }
  .treatment-contact h2 { font-size: clamp(2rem, 10vw, 2.7rem); }
  .treatment-contact__item { grid-template-columns: 30px minmax(0, 1fr); gap: .8rem; align-items: start; }
  .treatment-contact__icon { width: 30px; height: 30px; }
  .treatment-contact__icon svg { width: 26px; height: 26px; }
  .treatment-contact__item p { font-size: .94rem; }
  [data-treatment] .site-footer--treatment { padding: 3.25rem 0 1.25rem; }
  .treatment-footer__top { gap: 1.65rem; }
  .treatment-footer__map iframe { height: 180px; }
}

@media (max-width: 390px) {
  .container { width: min(calc(100% - 1.5rem), var(--container)); }
  .site-header .brand img { max-width: 142px; }
  .clinic-gallery__item, .clinic-gallery__item:nth-child(3) { height: 350px; }
  .treatment-benefits h3 { font-size: .63rem; }
  .treatment-contact__details { gap: 1.1rem; }
}

/* Correções exclusivas para telas pequenas. */
@media (max-width: 700px) {
  .site-header .main-nav,
  .site-header.is-scrolled .main-nav {
    position: absolute !important;
    top: calc(100% - .25rem) !important;
    right: 0;
    left: auto;
    z-index: 20;
    display: none;
    width: min(17.5rem, calc(100vw - 2rem));
    flex-direction: column;
    align-items: stretch;
    border-radius: 0 0 .5rem .5rem;
    overflow: hidden;
  }

  .site-header .main-nav.is-open { display: flex; }
  .header-row { position: relative; }
  .menu-toggle[aria-expanded="true"]::before { content: '×'; font-size: 2rem; }

  /* Evita que fotos em seções horizontais permaneçam ocultas pela animação. */
  .reveal { opacity: 1; transform: none; transition: none; }

  #equipe .team-grid {
    grid-template-columns: none;
    grid-template-rows: 1fr;
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 72vw);
    align-items: stretch;
    margin-right: -1rem;
    padding: .35rem 1rem 1.2rem 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 0;
  }

  #equipe .team-card { min-width: 0; scroll-snap-align: start; }
  #equipe .team-card__photo { height: 220px; }

  .floating-whatsapp {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: 50%;
    line-height: 0;
  }

  .floating-whatsapp::before { inset: 0; width: auto; height: auto; }
  .floating-whatsapp svg { width: 26px; height: 26px; margin: 0; }
  .floating-whatsapp span { display: none; }

  .site-footer--minimal {
    padding-bottom: 5.5rem !important;
  }

  .floating-whatsapp {
    position: fixed !important;
    right: max(1rem, env(safe-area-inset-right)) !important;
    bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    width: 56px !important;
    min-width: 56px !important;
    height: 56px !important;
    min-height: 56px !important;
    overflow: visible !important;
    transform: none !important;
    display: grid !important;
    place-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #25D366 !important;
    box-shadow: 0 8px 18px rgba(0,0,0,.2) !important;
    color: #fff !important;
    touch-action: manipulation;
  }

  .floating-whatsapp::before {
    display: none !important;
  }

  .floating-whatsapp svg { position: static !important; width: 26px !important; height: 26px !important; margin: 0 !important; }
}

/* Guarda final para conteúdo fluido nas larguras de 360 px, 390 px e 430 px. */
@media (max-width: 700px) {
  main,
  main > section,
  .hero__copy,
  .section-heading,
  #tratamentos .section-heading,
  .treatment-grid,
  .treatment-card {
    min-width: 0;
    max-width: 100%;
  }

  .hero__proof,
  .hero h1,
  #tratamentos h2,
  .section-heading h2 {
    overflow-wrap: anywhere;
  }

  #tratamentos .section-heading,
  .treatment-grid {
    width: 100%;
  }

  #tratamentos .container {
    width: calc(100% - 2rem) !important;
  }

  #tratamentos h2 {
    font-size: clamp(1.8rem, 8.5vw, 2.2rem);
  }

  .hero__proof {
    max-width: 100% !important;
    font-size: .86rem !important;
    line-height: 1.55;
  }

  .treatment-hero .button {
    position: relative;
    justify-content: center;
    padding-right: 3.25rem;
    padding-left: 3.25rem;
  }

  .treatment-hero .treatment-hero__whatsapp-icon {
    position: absolute;
    left: 1.35rem;
    width: 1rem;
    height: 1rem;
  }

  .treatment-hero .button::after {
    position: absolute;
    right: 1.35rem;
    margin-left: 0;
  }

  .treatment-services__trichology-heading,
  .treatment-services--structured .treatment-services__trichology-heading {
    text-align: center;
  }

  .treatment-services__trichology-heading h2,
  .treatment-services--structured .treatment-services__trichology-heading h2 {
    margin-right: auto;
    margin-left: auto;
  }

  /* Em telas pequenas, a transição reta evita o traço escuro da onda sobre a foto. */
  .hero::after {
    display: none !important;
  }

  #tratamentos {
    padding-top: 2.7rem;
  }

  #tratamentos .section-heading {
    margin-bottom: 1.35rem;
  }

  #tratamentos h2 {
    font-size: clamp(1.55rem, 7.6vw, 1.85rem);
    letter-spacing: -.025em;
    white-space: nowrap;
  }

  /* Hero de Calvície: mantém a foto e o conteúdo em uma coluna estável no celular. */
  .treatment-hero--trichology {
    padding: 2.5rem 0 3rem;
  }

  .treatment-hero--trichology .treatment-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .treatment-hero--trichology .treatment-hero__copy {
    min-width: 0;
  }

  .treatment-hero--trichology h1 {
    max-width: 12ch;
    font-size: clamp(2.2rem, 10.4vw, 3rem);
    line-height: 1.08;
  }

  .treatment-hero--trichology .treatment-hero__media {
    width: 100%;
    min-height: 245px;
    height: clamp(245px, 68vw, 320px);
  }

  .treatment-hero--trichology .treatment-hero__image {
    min-height: 0;
    height: 100%;
    object-fit: cover;
  }

  .treatment-hero--trichology::after {
    display: none;
  }

  /* O widget externo anima os cards fora da área visível no celular.
     Exibimos uma avaliação por vez, centralizada e legível. */
  .treatment-google .beaver-widget_review-container {
    display: block !important;
    height: 172px !important;
    min-height: 172px !important;
    overflow: visible !important;
  }

  .treatment-google .beaver-widget_review-inner-container {
    position: relative !important;
    width: 100% !important;
    height: 172px !important;
    overflow: hidden !important;
  }

  .treatment-google .beaver-widget_review {
    display: none !important;
  }

  .treatment-google .beaver-widget_review:first-child {
    display: flex !important;
    box-sizing: border-box !important;
    top: 0 !important;
    left: 50% !important;
    width: calc(100% - 1rem) !important;
    min-width: 0 !important;
    max-width: 360px !important;
    height: 148px !important;
    padding: .8rem !important;
    transform: translateX(-50%) !important;
    animation: none !important;
  }
}
