/* SOLUTERRA — Mobile v4 · Fix completo */

html, body { overflow-x: hidden; max-width: 100vw; }
*, *::before, *::after { min-width: 0; }

@media (max-width: 900px) {
  /* ===== Containers & overflow ===== */
  body, main, section, .container { max-width: 100vw; overflow-x: clip; }
  .container { padding-left: 20px !important; padding-right: 20px !important; }
  :root { --section-py: clamp(48px, 12vw, 72px); }

  /* ===== Botões nunca estouram ===== */
  .btn, button.btn, a.btn {
    max-width: 100%;
    white-space: normal;
    word-break: keep-all;
  }

  /* ===== Inputs nunca estouram ===== */
  input, select, textarea {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  form { max-width: 100%; }
}

@media (max-width: 720px) {
  /* ============== HEADER ============== */
  .site-header-inner { padding: 14px 16px !important; gap: 10px !important; }
  .brand-seal-mini .seal-top { font-size: 13px !important; letter-spacing: 0.22em !important; }
  .brand-seal-mini .seal-sub { font-size: 7px !important; letter-spacing: 0.36em !important; margin-top: 3px !important; }
  .hamburger { width: 40px !important; height: 40px !important; flex-shrink: 0; }
  .desktop-only { display: none !important; }

  /* ============== TIPO ============== */
  .display-xl { font-size: 30px !important; line-height: 1.08 !important; }
  .h1 { font-size: 26px !important; line-height: 1.14 !important; }
  .h2 { font-size: 22px !important; line-height: 1.18 !important; }
  .h3 { font-size: 19px !important; }
  .eyebrow { font-size: 11px !important; letter-spacing: 0.14em !important; }

  /* ============== HERO ============== */
  .hero-v3 { padding: 36px 0 56px !important; }
  .hero-v3 .container { padding: 0 20px !important; }
  .hero-v3 .hero-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 32px !important; }
  .hero-v3 .hero-copy { max-width: 100% !important; }
  .hero-v3 .hero-eyebrow {
    font-size: 9.5px !important;
    letter-spacing: 0.18em !important;
    display: inline-block !important;
    margin-bottom: 18px !important;
    line-height: 1.5;
  }
  .hero-v3 .hero-h1 {
    font-size: 32px !important;
    line-height: 1.08 !important;
    letter-spacing: -0.02em !important;
    margin: 0 0 20px 0 !important;
  }
  .hero-v3 .hero-rule { margin-bottom: 16px !important; }
  .hero-v3 .hero-rule .line { width: 40px !important; }
  .hero-v3 .hero-lede { font-size: 14.5px !important; line-height: 1.55 !important; margin: 0 0 20px 0 !important; }
  .hero-v3 .hero-micro { font-size: 11.5px !important; margin-bottom: 24px !important; }
  .hero-v3 .hero-micro .ic-shield { width: 22px !important; height: 22px !important; }
  .hero-v3 .hero-cta-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100%;
  }
  .hero-v3 .hero-cta-row .btn {
    width: 100% !important;
    box-sizing: border-box;
    justify-content: center !important;
    padding: 14px 20px !important;
    font-size: 11px !important;
    letter-spacing: 0.14em !important;
  }
  .hero-visual {
    padding: 8px !important;
    border-radius: 22px 22px 14px 14px !important;
    margin: 0;
  }
  .hero-photo { aspect-ratio: 4/5 !important; border-radius: 16px 16px 10px 10px !important; }
  .hero-medal { width: 92px !important; height: 92px !important; left: -4px !important; bottom: 14px !important; }
  .hero-medal .medal-inner { width: 40px !important; height: 40px !important; }
  .hero-medal .medal-ring text { font-size: 6.6px !important; letter-spacing: 0.2em !important; }
  .hero-photo .ph-label { font-size: 8.5px !important; padding: 5px 10px !important; bottom: 10px !important; }

  /* ============== TWO COL ============== */
  .two-col, .two-col-12 { grid-template-columns: 1fr !important; gap: 26px !important; }

  /* ============== POSICIONAMENTO ============== */
  .sv-paper .h1 { font-size: 24px !important; }
  .sv-paper .body-lg { font-size: 15px !important; }

  /* ============== SÓCIAS (sv-olive) ============== */
  .sv-olive .placeholder { aspect-ratio: 4/3 !important; }
  .sv-olive .cta-row, .sv-olive [style*="cta-row"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  .sv-olive .cta-row .btn, .sv-olive .btn-secondary { width: 100% !important; justify-content: center !important; box-sizing: border-box; }

  /* ============== SERVIÇOS CARROSSEL ============== */
  .services-block { padding: 48px 0 !important; }
  .services-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
    grid-template-columns: none !important;
  }
  .services-head .h1 { font-size: 24px !important; margin-top: 12px !important; }
  .services-head .lede { font-size: 14px !important; margin-top: 12px !important; }
  .services-head-cta { padding: 10px 16px !important; font-size: 10px !important; letter-spacing: 0.14em !important; }
  .services-head-cta .arrow { width: 22px !important; height: 22px !important; }

  .services-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    gap: 14px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 4px 20px 14px 20px !important;
    margin: 0 -20px !important;
    scrollbar-width: none;
    scroll-padding-left: 20px;
  }
  .services-grid::-webkit-scrollbar { display: none; }
  .services-grid .service-card {
    flex: 0 0 78vw !important;
    max-width: 290px;
    scroll-snap-align: start !important;
    border-radius: 16px !important;
    border: 1px solid rgba(191,163,106,.22) !important;
    padding: 22px 20px !important;
    min-height: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .services-grid .service-card .sc-title { font-size: 18px !important; }
  .services-grid .service-card .sc-desc { font-size: 13.5px !important; }
  .services-grid .service-card--feature .sc-list { display: none; }
  .services-grid .service-card--feature .sc-title { font-size: 20px !important; }

  /* Carousel UI: dots + setas */
  .carousel-ui {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 0;
  }
  .carousel-ui .dots {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
  }
  .carousel-ui .dot {
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: rgba(191,163,106,.25);
    border: 0;
    cursor: pointer;
    transition: all .3s;
  }
  .carousel-ui .dot.is-active { background: var(--gold-light); width: 34px; }
  .carousel-ui .nav {
    display: flex;
    gap: 8px;
  }
  .carousel-ui .nav button {
    width: 38px; height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(191,163,106,.32);
    background: rgba(244,239,227,.04);
    color: var(--gold-light);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all .25s;
  }
  .carousel-ui .nav button:hover, .carousel-ui .nav button:active {
    background: var(--gold-light);
    color: var(--graphite);
  }
  .carousel-ui.on-light .nav button { color: var(--gold-deep); border-color: rgba(168,121,69,.32); }
  .carousel-ui.on-light .nav button:hover, .carousel-ui.on-light .nav button:active { background: var(--gold-deep); color: var(--ivory); }
  .carousel-ui.on-light .dot { background: rgba(168,121,69,.25); }
  .carousel-ui.on-light .dot.is-active { background: var(--gold-deep); }

  .services-foot {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center;
    padding: 20px !important;
    margin-top: 28px !important;
    gap: 14px !important;
  }
  .services-foot-label { font-size: 15px !important; text-align: center; }
  .services-foot .btn { width: 100% !important; justify-content: center !important; padding: 13px 18px !important; font-size: 11px !important; box-sizing: border-box; }

  /* ============== PROCESSO CARROSSEL ============== */
  .process {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    padding: 4px 20px 14px 20px !important;
    margin: 0 -20px !important;
    gap: 12px !important;
    scrollbar-width: none;
    scroll-padding-left: 20px;
  }
  .process::-webkit-scrollbar { display: none; }
  .process .step {
    flex: 0 0 75vw !important;
    max-width: 270px;
    scroll-snap-align: start;
    border-top: 0 !important;
    border: 1px solid var(--divider) !important;
    background: var(--ivory) !important;
    padding: 20px 18px !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-paper);
  }
  .step h3 { font-size: 17px !important; }

  /* ============== DIFERENCIAIS ============== */
  .sv-cartorio .pillars { display: grid !important; gap: 0 !important; grid-template-columns: 1fr !important; }
  .sv-cartorio .pillar { padding: 22px 0 !important; border-top: 1px solid rgba(191,163,106,.18); }
  .sv-cartorio .pillar:first-child { border-top: 0; }
  .sv-cartorio .pillar h3 { font-size: 19px !important; }
  .sv-cartorio .pillar p { font-size: 13.5px !important; }

  /* ============== DEPOIMENTOS ============== */
  .testimonials-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
    margin-bottom: 22px !important;
  }
  .testimonials-nav { width: 100%; justify-content: space-between; }
  .t-arrow { width: 40px !important; height: 40px !important; }
  .testimonial-track { gap: 14px !important; padding: 4px 20px 14px !important; margin: 0 -20px; scroll-padding-left: 20px; }
  .testimonial-card {
    flex: 0 0 80% !important;
    padding: 22px 20px !important;
    border-radius: 16px !important;
    box-sizing: border-box;
  }
  .testimonial-card blockquote { font-size: 16px !important; line-height: 1.4 !important; }
  .testimonial-card .quotemark { font-size: 56px !important; top: 4px !important; right: 14px !important; }
  .testimonial-card cite { font-size: 11.5px !important; margin-top: 18px !important; }

  /* ============== FAQ ============== */
  #faq .grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .faq-q { font-size: 15px !important; padding: 16px 0 !important; gap: 14px !important; line-height: 1.3 !important; }
  .faq-q .toggle { width: 26px !important; height: 26px !important; flex-shrink: 0; }
  .faq-a-inner { font-size: 13.5px !important; padding-bottom: 18px !important; }

  /* ============== CTA FINAL ============== */
  .cta-final { padding: 48px 0 !important; }
  .cta-final .grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding: 0 20px !important;
    box-sizing: border-box;
  }
  .cta-final h2 { font-size: 24px !important; }
  .cta-final .lede { font-size: 14px !important; }
  .contact-items { margin-top: 20px !important; }
  .contact-item .body { font-size: 13px !important; }
  .cta-final .on-terra form { width: 100%; }
  .cta-final .on-terra form .field { margin-bottom: 12px; }
  .cta-final .on-terra .input,
  .cta-final .on-terra .select,
  .cta-final .on-terra .textarea {
    padding: 12px 14px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    box-sizing: border-box;
  }
  .cta-final .btn { width: 100% !important; justify-content: center !important; box-sizing: border-box; }

  /* ============== FOOTER ============== */
  .footer-cta { padding: 32px 20px !important; }
  .footer-cta-inner {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }
  .footer-cta-title { font-size: 20px !important; line-height: 1.2 !important; }
  .footer-cta-actions { flex-direction: column !important; align-items: stretch !important; }
  .footer-cta-actions .btn { width: 100% !important; justify-content: center !important; box-sizing: border-box; }
  .footer-main {
    grid-template-columns: 1fr !important;
    padding: 36px 20px 20px !important;
    gap: 28px !important;
  }
  .footer-tagline { font-size: 13px !important; }
  .site-footer h5, .site-footer .footer-col-label { font-size: 10px !important; margin-bottom: 12px !important; }
  .site-footer .footer-main a { font-size: 13.5px !important; }
  .footer-contact-list li { font-size: 13px !important; }
  .legal {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 16px 20px 22px !important;
    font-size: 11px !important;
    gap: 8px !important;
  }
  .legal-links { flex-wrap: wrap; gap: 8px; }

  /* ============== MARQUEE ============== */
  .marquee-item { font-size: 16px !important; gap: 18px !important; }

  /* ============== BIG QUOTE ============== */
  .bigquote { padding: 48px 0 !important; }
  .bigquote blockquote { font-size: 20px !important; line-height: 1.25 !important; }
  .bigquote blockquote::before { font-size: 80px !important; top: -20px !important; left: -8px !important; }

  /* ============== FAB ============== */
  .fab { width: 50px !important; height: 50px !important; bottom: 18px !important; right: 18px !important; }
  .fab .fab-label { display: none !important; }
}

/* ============== TINY (<400px) ============== */
@media (max-width: 400px) {
  .hero-v3 .hero-h1 { font-size: 28px !important; }
  .display-xl { font-size: 26px !important; }
  .h1 { font-size: 22px !important; }
  .services-grid .service-card { flex: 0 0 82vw !important; }
  .process .step { flex: 0 0 80vw !important; }
}

/* ============== BOTÕES — feedback tátil (todos os dispositivos) ============== */
.btn:active, button.btn:active, a.btn:active {
  transform: scale(0.96) !important;
  transition: transform 80ms ease !important;
  opacity: 0.92;
}

/* ============== SINGLE DE SERVIÇO — responsividade mobile ============== */
@media (max-width: 640px) {
  /* Botões no hero empilham verticalmente */
  .cs-hero .pg-hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .cs-hero .pg-hero-cta .btn {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Passos do serviço */
  .cs-step { grid-template-columns: 36px 1fr; gap: 14px; padding: 18px 0; }
  .cs-step-n { width: 32px; height: 32px; font-size: 11px; }
  .cs-step h3 { font-size: 17px !important; margin: 4px 0 4px; }
  .cs-step p { font-size: 14px !important; }
}

@media (max-width: 500px) {
  /* Factbar: coluna única em telas muito pequenas */
  .cs-factbar {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .cs-fact {
    padding: 14px 0 !important;
    border-left: 0 !important;
    border-top: 1px solid rgba(191,163,106,.2);
  }
  .cs-fact:first-child { padding-top: 0 !important; border-top: 0 !important; }
  .cs-fact + .cs-fact { padding-left: 0 !important; }
  .cs-fact .v { font-size: 15px !important; }
}

/* ============================================================
   MODAL WHATSAPP — global overflow fix (todos os viewports)
   ============================================================ */
.wa-modal-backdrop { overflow-y: auto; overscroll-behavior: contain; }
.wa-modal {
  max-height: calc(100vh - 48px);
  overflow-y: auto; overflow-x: hidden !important;
  width: 100%; max-width: 460px !important;
  box-sizing: border-box;
}
.wa-modal * { box-sizing: border-box; max-width: 100%; }
.wa-modal-body .input, .wa-modal-body .select {
  width: 100% !important; max-width: 100% !important; box-sizing: border-box;
}
.wa-modal-submit { width: 100% !important; box-sizing: border-box; justify-content: center !important; }
.wa-modal-terms { max-width: 100%; }

/* ============================================================
   MODAL WHATSAPP — bottom sheet compacto (mobile ≤ 600px)
   Objetivo: popover flutuante, não tela cheia.
   ============================================================ */
@media (max-width: 600px) {
  /* Slide-up from bottom */
  .wa-modal-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .wa-modal {
    width: 100% !important; max-width: 100% !important;
    max-height: 82vh !important;
    border-radius: 18px 18px 0 0 !important;
    border: 0 !important;
  }
  /* Pill handle visual indicator — cor terra, visível no fundo ivory */
  .wa-modal::before {
    content: "";
    display: block;
    width: 32px; height: 4px;
    background: rgba(85,67,30,.18);
    border-radius: 2px;
    margin: 8px auto 0;
  }

  /* ---- Head compacto: remove sub, reduz espaço ---- */
  .wa-modal-head {
    padding: 8px 18px 10px !important;
    border-radius: 0 !important;
  }
  .wa-modal-head .eyebrow {
    font-size: 8.5px !important;
    margin-bottom: 5px !important;
    gap: 6px !important;
  }
  .wa-modal-head .eyebrow .badge { padding: 3px 7px !important; font-size: 7.5px !important; gap: 4px !important; }
  .wa-modal-head .eyebrow .badge .dot { width: 5px !important; height: 5px !important; }
  .wa-modal-head h2 { font-size: 15px !important; line-height: 1.18 !important; }
  /* Sub oculto no mobile — ocupa espaço sem agregar valor no contexto compacto */
  .wa-modal-head .sub { display: none !important; }
  .wa-modal-close {
    width: 28px !important; height: 28px !important;
    top: 8px !important; right: 12px !important;
  }

  /* ---- Campos compactos ---- */
  .wa-modal-body { padding: 12px 16px 14px !important; }
  .wa-modal-body .field { margin-bottom: 9px !important; max-width: 100%; }
  .wa-modal-body .label { font-size: 8.5px !important; letter-spacing: 0.14em !important; }
  .wa-modal-body .input, .wa-modal-body .select {
    padding: 9px 12px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
  }

  /* ---- Termos: inline compacto — 30% do card original ---- */
  .wa-modal-terms {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    margin-bottom: 12px !important;
    gap: 7px !important;
    align-items: flex-start;
  }
  .wa-modal-terms input[type="checkbox"] {
    width: 13px !important; height: 13px !important;
    margin-top: 1px !important;
  }
  .wa-modal-terms .text {
    font-size: 9.5px !important;
    line-height: 1.35 !important;
    color: var(--text-muted) !important;
  }

  /* ---- Submit e rodapé ---- */
  .wa-modal-submit { padding: 11px 16px !important; font-size: 11px !important; }
  .wa-modal-foot { font-size: 9.5px !important; margin-top: 8px !important; gap: 8px !important; }

  /* ---- Thanks state ---- */
  .wa-modal-thanks { padding: 22px 18px 20px !important; }
  .wa-modal-thanks h3 { font-size: 17px !important; }
  .wa-modal-thanks p { font-size: 12.5px !important; }
  .wa-modal-thanks .check { width: 52px !important; height: 52px !important; margin-bottom: 16px !important; }
}

/* ============================================================
   MODAL LGPD / Preferências — fix botões mobile (≤ 560px)
   ============================================================ */
@media (max-width: 560px) {
  .cp-head { padding: 22px 18px 16px !important; }
  .cp-cats { padding: 2px 18px !important; }
  .pref-cat { padding: 14px 4px !important; gap: 14px !important; }
  .pref-cat-txt h4 { font-size: 13.5px !important; }
  .pref-cat-txt p { font-size: 12px !important; }

  /* Footer: coluna, botões empilhados em ordem de importância */
  .cp-foot {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 14px 18px 20px !important;
  }
  .cp-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 7px !important;
    order: 1;
  }
  .cp-actions .btn-primary {
    order: 1;
    flex: none !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 13px 18px !important;
  }
  .cp-actions .btn-secondary {
    order: 2;
    flex: none !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 12px 18px !important;
  }
  .cp-actions .btn-text {
    order: 3;
    text-align: center !important;
    width: 100% !important;
    padding: 9px 8px !important;
    font-size: 11.5px !important;
  }
  .cp-policy { text-align: center !important; order: 2; font-size: 10.5px !important; }
}

/* ============================================================
   FOOTER — UX overhaul
   ============================================================ */

/* Tablet: 2-col layout em vez de 4-col esmagado */
@media (min-width: 720px) and (max-width: 999px) {
  .footer-main {
    grid-template-columns: 1.6fr 1fr !important;
    gap: 40px 48px !important;
  }
  .footer-cta-inner { grid-template-columns: 1fr !important; gap: 20px !important; }
  .footer-cta-actions {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
  .footer-cta-actions .btn { width: auto !important; }
}

/* Mobile: separadores visuais entre seções */
@media (max-width: 719px) {
  .footer-main > div + div {
    border-top: 1px solid rgba(217,210,196,.14);
    padding-top: 20px;
    margin-top: 4px;
  }

  /* Newsletter form: empilha label + input em coluna em telas estreitas */
  .footer-news > div[style*="display:flex"],
  .footer-news > div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .footer-news input[type="email"] {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .footer-news .btn {
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  /* Padding-bottom para não sobrepor o FAB flutuante */
  .site-footer .legal {
    padding-bottom: 88px !important;
  }

  /* Espaçamento mínimo de toque para links do footer */
  .site-footer .footer-main a:not(.footer-social a) {
    min-height: 38px;
    display: flex;
    align-items: center;
  }

  /* Parceiros: links da equipe */
  .footer-partner {
    min-height: 36px;
    display: flex !important;
    align-items: center;
  }

  /* Social: ícones maiores em mobile */
  .footer-social a { width: 44px !important; height: 44px !important; }

  /* CTA do footer: mais compacto */
  .footer-cta { padding: 36px 20px !important; }
  .footer-cta-title { font-size: 22px !important; line-height: 1.18 !important; }

  /* Legal: wrap compacto dos links */
  .legal-links { gap: 6px 10px !important; }
  .dot-sep { display: none !important; }
  .legal-links a::after { content: "·"; margin-left: 10px; opacity: .45; }
  .legal-links a:last-child::after { content: ""; }
}
