/* ==========================================================================
   HERO MOBILE — DR. LEONARDO CATIZANI
   A composição aprovada vive apenas no breakpoint mobile. Nenhuma regra
   existente de tablet, desktop ou das demais seções é alterada aqui.
   ======================================================================= */

.medic-nav__menu,
.medic-hero__divider,
.medic-hero__lede-mobile,
.medic-hero__portrait-mobile,
.medic-hero__stats-mobile,
.medic-hero__cta-arrow-mobile {
  display: none;
}

@media (max-width: 39.99rem) {
  .medic-hero {
    --hero-mobile-cta-height: 82px;
    min-height: max(100svh, 44rem);
    overflow: hidden;
    color: #073a50;
    background:
      radial-gradient(circle at 50% 17%, rgba(255, 255, 255, 0.98) 0 13%, rgba(255, 255, 255, 0.46) 30%, transparent 54%),
      radial-gradient(circle at 5% 54%, rgba(84, 191, 220, 0.38), transparent 37%),
      radial-gradient(circle at 92% 70%, rgba(0, 126, 165, 0.34), transparent 42%),
      linear-gradient(180deg, #d9f2f5 0%, #b4e4ed 45%, #0589b1 100%);
  }

  .medic-hero::before {
    content: '';
    position: absolute;
    z-index: 0;
    width: min(92vw, 29rem);
    aspect-ratio: 1;
    left: 50%;
    top: 43%;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    box-shadow:
      0 0 0 clamp(2.6rem, 9vw, 4.5rem) rgba(255, 255, 255, 0.06),
      0 0 0 clamp(5.5rem, 18vw, 8rem) rgba(255, 255, 255, 0.035);
    pointer-events: none;
  }

  .medic-hero::after {
    content: '';
    position: absolute;
    z-index: 0;
    right: -2.35rem;
    bottom: 11rem;
    width: 9rem;
    height: 12rem;
    opacity: 0.43;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.92) 1.1px, transparent 1.4px);
    background-size: 14px 14px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 78%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 78%, transparent);
    pointer-events: none;
  }

  .medic-hero__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: inherit;
    margin: 0;
    padding:
      max(1rem, env(safe-area-inset-top))
      1.125rem
      calc(var(--hero-mobile-cta-height) + 1.1rem + env(safe-area-inset-bottom));
  }

  /* Header em vidro: marca à esquerda, menu à direita e nenhum WhatsApp. */
  .medic-nav {
    position: relative;
    z-index: 140;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    margin: 0 auto;
    padding: 0.92rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 1.4rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(224, 248, 250, 0.38));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      0 1rem 2.6rem rgba(13, 83, 108, 0.13);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    backdrop-filter: blur(22px) saturate(145%);
  }

  .medic-nav__brand {
    position: relative;
    z-index: 2;
    min-width: 0;
    gap: 0.25rem;
    color: #083c4d;
  }

  .medic-nav__brand-main {
    gap: 0.38rem;
  }

  .medic-nav__brand-name {
    font-family: var(--font-display), system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: clamp(1.05rem, 4.65vw, 1.35rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.052em;
  }

  .medic-nav__verified {
    width: clamp(1.15rem, 4.7vw, 1.42rem);
    height: clamp(1.15rem, 4.7vw, 1.42rem);
    filter: drop-shadow(0 0.25rem 0.5rem rgba(0, 141, 255, 0.18));
  }

  .medic-nav__brand-tagline {
    color: #235a6c;
    font-size: clamp(0.68rem, 3vw, 0.82rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.025em;
  }

  .medic-nav__actions {
    display: none;
  }

  .medic-nav__menu {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.9rem;
    height: 2.9rem;
    padding: 0;
    border: 0;
    border-radius: 0.9rem;
    color: #073a50;
    background: transparent;
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
  }

  .medic-nav__menu svg {
    width: 2rem;
    height: 2rem;
    transition: opacity 160ms ease;
  }

  .medic-nav__menu::before,
  .medic-nav__menu::after {
    content: '';
    position: absolute;
    width: 1.8rem;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0;
    transition: opacity 160ms ease, transform 180ms ease;
  }

  .medic-nav__menu:active {
    transform: scale(0.96);
  }

  .medic-nav__menu:focus-visible,
  .medic-hero__cta:focus-visible {
    outline: 3px solid rgba(0, 130, 255, 0.42);
    outline-offset: 3px;
  }

  /* O mesmo grupo de links do desktop vira um menu fullscreen no mobile. */
  .medic-nav__links {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    margin: 0;
    padding: 7rem 2rem calc(var(--hero-mobile-cta-height) + 2rem);
    color: #073a50;
    background: rgba(225, 248, 250, 0.96);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
    backdrop-filter: blur(24px) saturate(145%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-1rem);
    transition: opacity 220ms ease, visibility 220ms ease, transform 220ms ease;
  }

  .medic-nav__links a {
    font-size: clamp(1.45rem, 7vw, 2rem);
    font-weight: 750;
    letter-spacing: -0.035em;
  }

  .medic-nav.is-open .medic-nav__links {
    position: absolute;
    width: 100vw;
    min-width: 100vw;
    max-width: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .medic-nav.is-open .medic-nav__links > a {
    white-space: nowrap;
  }

  .medic-nav.is-open {
    position: fixed;
    inset: 0;
    z-index: 200;
    width: 100%;
    height: 100svh;
    margin: 0;
    padding: max(1rem, env(safe-area-inset-top)) 1.125rem;
    align-items: flex-start;
    border: 0;
    border-radius: 0;
    background: rgba(225, 248, 250, 0.97);
  }

  .medic-nav.is-open .medic-nav__brand,
  .medic-nav.is-open .medic-nav__menu {
    margin-top: 0.9rem;
  }

  .medic-nav.is-open .medic-nav__menu circle {
    display: none;
  }

  .medic-nav.is-open .medic-nav__menu svg {
    opacity: 0;
  }

  .medic-nav.is-open .medic-nav__menu::before {
    opacity: 1;
    transform: rotate(45deg);
  }

  .medic-nav.is-open .medic-nav__menu::after {
    opacity: 1;
    transform: rotate(-45deg);
  }

  /* Copy central e dimensionada para manter exatamente duas e três linhas. */
  .medic-hero__content {
    position: relative;
    z-index: 5;
    width: 100%;
    padding-top: clamp(3.2rem, 8.2svh, 4.7rem);
    text-align: center;
  }

  .medic-hero__title {
    width: 100%;
    max-width: none;
    margin: 0;
    color: #082f54;
    font-family: var(--font-display), system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: clamp(1.7rem, 7.35vw, 2.2rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.056em;
  }

  .medic-hero__title-line {
    display: block;
    white-space: nowrap;
  }

  .medic-hero__title-line + .medic-hero__title-line {
    margin-top: 0.35rem;
    color: #039fc3;
  }

  .medic-hero__divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: min(58%, 13rem);
    margin: clamp(1.15rem, 3svh, 1.75rem) auto clamp(0.9rem, 2.3svh, 1.35rem);
    color: #0699bd;
  }

  .medic-hero__divider::before,
  .medic-hero__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(7, 58, 80, 0.38));
  }

  .medic-hero__divider::after {
    background: linear-gradient(90deg, rgba(7, 58, 80, 0.38), transparent);
  }

  .medic-hero__divider svg {
    flex: 0 0 auto;
    width: 1.7rem;
    height: 1.95rem;
    filter: drop-shadow(0 0.35rem 0.55rem rgba(0, 143, 177, 0.18));
  }

  .medic-hero__lede {
    width: calc(100% + 0.5rem);
    max-width: none;
    margin: 0 -0.25rem;
    color: #073a50;
    font-size: clamp(0.72rem, 3.35vw, 0.88rem);
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: -0.014em;
  }

  .medic-hero__lede-desktop {
    display: none;
  }

  .medic-hero__lede-mobile {
    display: block;
  }

  .medic-hero__lede-mobile span {
    display: block;
    white-space: nowrap;
  }

  .medic-hero__content > .medic-hero__stats {
    display: none;
  }

  /* A CTA do Hero é a barra fixa inferior aprovada. */
  .medic-hero__cta {
    position: fixed;
    z-index: 130;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: calc(var(--hero-mobile-cta-height) + env(safe-area-inset-bottom));
    margin: 0;
    padding: 0 5.4rem env(safe-area-inset-bottom) 1rem;
    border: 0;
    border-radius: 0;
    color: #fff;
    background: linear-gradient(115deg, #19b86f 0%, #00975f 58%, #007d52 100%);
    box-shadow: 0 -0.8rem 2.5rem rgba(0, 90, 76, 0.2);
    font-size: clamp(1.2rem, 5.2vw, 1.55rem);
    font-weight: 750;
    line-height: 1;
    letter-spacing: -0.025em;
  }

  .medic-hero__cta:hover {
    color: #fff;
    background: linear-gradient(115deg, #20c77a 0%, #00a568 58%, #00885a 100%);
    transform: none;
  }

  .medic-hero__cta-arrow {
    position: absolute;
    top: 16%;
    right: max(0.8rem, env(safe-area-inset-right));
    bottom: calc(16% + env(safe-area-inset-bottom));
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 0;
    color: #fff;
    background: transparent;
  }

  .medic-hero__cta-arrow-desktop {
    display: none;
  }

  .medic-hero__cta-arrow-mobile {
    display: block;
    width: 2.15rem;
    height: 2.15rem;
  }

  /* Mantém apenas uma barra fixa: o CTA genérico das demais seções é
     substituído pela ação da Hero durante toda a experiência mobile. */
  .cta-fixo {
    display: none !important;
  }

  .whatsapp-float {
    transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
  }

  body.hero-mobile-in-view .whatsapp-float {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(0.75rem);
  }

  /* O asset mobile preserva o recorte aprovado sem mudar a foto desktop. */
  .medic-hero__portrait {
    position: relative;
    right: auto;
    bottom: auto;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: calc(100% + 2.25rem);
    height: auto;
    margin: clamp(1rem, 2.2svh, 1.35rem) -1.125rem 0;
    pointer-events: none;
  }

  .medic-hero__portrait::before {
    right: 50%;
    bottom: 5%;
    width: 90%;
    transform: translateX(50%);
    background: radial-gradient(circle, rgba(235, 253, 255, 0.42), transparent 68%);
  }

  .medic-hero__portrait > img:not(.medic-hero__portrait-mobile) {
    display: none;
  }

  .medic-hero__portrait .medic-hero__portrait-mobile {
    display: block;
    width: min(86vw, 22rem);
    height: auto;
    max-width: none;
    object-fit: contain;
    -webkit-mask-image: none;
    mask-image: none;
    filter: drop-shadow(0 1.25rem 1.6rem rgba(0, 71, 86, 0.16));
    transform: none;
  }

  /* Um único card compacto, três colunas e sobreposição suave na foto. */
  .medic-hero__stats-mobile {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: calc(100% - 0.4rem);
    min-height: 6.4rem;
    margin: -3.3rem auto 0;
    padding: 0.85rem 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.94);
    border-radius: 1.25rem;
    color: #082f54;
    background: linear-gradient(135deg, rgba(248, 254, 255, 0.82), rgba(226, 246, 250, 0.62));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.94),
      0 1rem 2.7rem rgba(6, 80, 107, 0.16);
    -webkit-backdrop-filter: blur(18px) saturate(138%);
    backdrop-filter: blur(18px) saturate(138%);
  }

  .medic-hero__stats-mobile > div {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    text-align: center;
  }

  .medic-hero__stats-mobile > div + div::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    bottom: 0.25rem;
    width: 1px;
    background: rgba(8, 47, 84, 0.16);
  }

  .medic-hero__stat-icon {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.42rem;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #09b5cc, #007da7);
    box-shadow: 0 0.45rem 0.85rem rgba(0, 126, 166, 0.18);
  }

  .medic-hero__stat-icon svg {
    width: 1.15rem;
    height: 1.15rem;
  }

  .medic-hero__stats-mobile dt {
    white-space: nowrap;
    font-size: clamp(1.3rem, 6.25vw, 1.7rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.052em;
  }

  .medic-hero__stats-mobile dd {
    margin: 0.34rem 0 0;
    color: #174d68;
    font-size: clamp(0.58rem, 2.6vw, 0.7rem);
    font-weight: 560;
    line-height: 1.2;
    letter-spacing: -0.015em;
  }

  body.hero-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 23.75rem) {
  .medic-hero {
    --hero-mobile-cta-height: 74px;
  }

  .medic-nav {
    padding-inline: 0.85rem;
  }

  .medic-nav__brand-name {
    font-size: 1rem;
  }

  .medic-nav__brand-tagline {
    font-size: 0.65rem;
  }

  .medic-nav__menu {
    width: 2.65rem;
    height: 2.65rem;
  }

  .medic-hero__content {
    padding-top: 2.9rem;
  }

  .medic-hero__title {
    font-size: 1.62rem;
  }

  .medic-hero__lede {
    font-size: 0.7rem;
  }

  .medic-hero__portrait .medic-hero__portrait-mobile {
    width: 82vw;
  }

  .medic-hero__stats-mobile {
    min-height: 6.1rem;
    margin-top: -3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .medic-nav__links,
  .medic-nav__menu,
  .whatsapp-float {
    transition-duration: 0.01ms !important;
  }
}
