/* Rose Bronze R9 — release front: mobile footer, visible drawer close (A4), Safari viewport.
   Loaded last. Does not touch Scroll Stack (procedures-r3), Codrops (services-formation-r7),
   reviews, brand-r6 or hero-r3 rules. Desktop footer is unchanged. */

/* ---- A4: drawer ---------------------------------------------------------------------- */
.mobile-drawer {
  height: 100vh;               /* fallback */
  height: 100dvh;              /* fixed overlay: follows the visible area, no layout shift */
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-sand-card);
  color: var(--color-espresso);
  transition: border-color var(--transition-fast), color var(--transition-fast);
  touch-action: manipulation;
}

.drawer-close svg { width: 20px; height: 20px; }

.drawer-close:hover {
  border-color: var(--color-rose-gold);
  color: var(--color-terracotta);
}

/* ---- Final CTA: one heading (approved lead sentence) + one CTA "Reserve seu momento" ---- */
.footer-cta h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.25rem);
  line-height: 1.3;
  margin-bottom: 1.75rem;
  text-wrap: balance;
}

/* ---- Mobile footer (≤767px) ---------------------------------------------------------- */
@media (max-width: 767px) {
  .footer-cta { padding: 2.75rem 0 3rem; }
  .footer-cta h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 330px;
    margin-inline: auto;
  }
  .footer-cta .btn { width: 100%; max-width: 340px; }

  .site-footer {
    padding: 2.25rem 0 calc(1.5rem + env(safe-area-inset-bottom, 0px));
    font-size: 0.9375rem;
  }

  /* Reorder visually: services → contact → description → legal → logo (signature last).
     DOM order (and tab order) is unchanged; the logo is not focusable. */
  .site-footer > .container { display: flex; flex-direction: column; }
  .site-footer .footer-grid,
  .site-footer .footer-brand { display: contents; }

  .site-footer .footer-col:nth-child(2) { order: 1; }
  .site-footer .footer-col:nth-child(3) { order: 2; margin-top: 1.75rem; }
  .site-footer .footer-brand > p { order: 3; margin-top: 1.75rem; max-width: none; line-height: 1.55; }
  .site-footer .footer-brand > div { order: 4; margin-top: 0.5rem !important; font-size: 0.875rem !important; }
  .site-footer .footer-bottom { order: 5; }
  .site-footer .footer-brand .footer-logo {
    order: 6;
    --brand-logo-h: 70px;
    align-self: center;
    margin: 1.75rem 0 0;
  }

  .footer-col h4 { margin-bottom: 0.4rem; }

  /* Services: two balanced columns, 44px targets, long names wrap cleanly. */
  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: 0;
  }
  .footer-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-block: 0.3rem;
    line-height: 1.3;
  }

  /* Contact: compact lines, links with 44px targets. */
  .site-footer .footer-col p { margin: 0 !important; line-height: 1.5; }
  .site-footer .footer-col p:first-of-type { margin-bottom: 0.35rem !important; }
  .site-footer .footer-col p a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .footer-bottom {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    gap: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
  }

  /* The logo right below closes the footer: avoid repeating the full name next to it. */
  .footer-legal-name {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
