/* =============================================================================
   AntWebStudios — sistema visual compartido
   Se usa en todas las páginas públicas (home, cotizador, FAQ, soporte, legales,
   errores). El Portal Partners mantiene sus propios estilos.
   ========================================================================== */

:root {
    /* Color */
    --bg:          #0E0E0D;   /* negro carbón */
    --bg-raised:   #161614;
    --bg-soft:     #1C1B19;
    --line:        #2A2926;
    --line-strong: #3A3834;
    --text:        #F2EFEA;   /* claro cálido para lectura */
    --text-soft:   #C9C4BC;
    --muted:       #A8A39B;   /* 7.4:1 sobre --bg */
    --accent:      #FF6A00;   /* naranja de marca */
    --accent-hover:#FF8126;
    --on-accent:   #0E0E0D;   /* texto sobre naranja: 6.4:1 */
    --wa:          #25D366;

    /* Tipografía (máx. dos familias) */
    --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
    --font-body:    'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Espaciado y forma */
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --maxw: 1160px;
    --maxw-text: 680px;
    --radius: 14px;
    --radius-sm: 10px;
    --section-y: clamp(4.5rem, 10vw, 8rem);
    --header-h: 68px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text-soft);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--on-accent); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Accesibilidad ---------- */
.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 2000;
    background: var(--accent); color: var(--on-accent);
    padding: .75rem 1rem; border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--text { max-width: calc(var(--maxw-text) + var(--gutter) * 2); }
.section { padding-block: var(--section-y); }
.section + .section { border-top: 1px solid var(--line); }

.eyebrow {
    display: inline-block;
    font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 1rem;
}
.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.section-head h2 { font-size: clamp(2rem, 4.6vw, 3rem); }
.section-head p:not(.eyebrow) { margin-top: 1rem; color: var(--muted); font-size: 1.125rem; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    min-height: 52px; padding: .85rem 1.6rem;
    border-radius: 999px; border: 1px solid transparent;
    font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
    transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--text-soft); }
.btn--wa { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--wa svg { color: var(--wa); }
.btn--wa:hover { border-color: var(--wa); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.link-arrow {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--text); font-weight: 600; text-decoration: none;
    border-bottom: 1px solid var(--line-strong); padding-bottom: 2px;
    transition: border-color .2s, color .2s;
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }
.link-arrow svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

.text-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.text-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------- Header ---------- */
.site-nav {
    position: sticky; top: 0; z-index: 900;
    background: rgba(14, 14, 13, .86);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.site-nav.is-scrolled { border-bottom-color: var(--line); }
.site-nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; letter-spacing: -0.02em; }
.brand img { width: 28px; height: 28px; }
.brand__name span { color: var(--accent); }

.site-nav__menu { display: flex; align-items: center; gap: 2rem; list-style: none; }
.site-nav__menu a { color: var(--text-soft); text-decoration: none; font-size: .9375rem; font-weight: 500; transition: color .2s; }
.site-nav__menu a:hover, .site-nav__menu a[aria-current="page"] { color: var(--text); }
.site-nav__menu .nav-cta {
    color: var(--text); padding: .55rem 1.1rem; border: 1px solid var(--line-strong); border-radius: 999px;
}
.site-nav__menu .nav-cta:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle {
    display: none; align-items: center; justify-content: center;
    width: 48px; height: 48px; margin-right: -12px;
    background: none; border: 0; cursor: pointer; color: var(--text);
}
.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 860px) {
    /* backdrop-filter convierte al header en el contenedor de los elementos
       position:fixed y el menú quedaba del alto de la barra (~49px). En celular
       usamos fondo sólido para que el menú se mida contra la pantalla. */
    .site-nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
    .nav-toggle { display: inline-flex; }
    .site-nav__menu {
        position: fixed; top: var(--header-h); left: 0; right: 0;
        height: calc(100vh - var(--header-h));
        height: calc(100dvh - var(--header-h));
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 1rem var(--gutter) max(2rem, env(safe-area-inset-bottom));
        overscroll-behavior: contain;
        background: var(--bg);
        border-top: 1px solid var(--line);
        overflow-y: auto;
        visibility: hidden; opacity: 0; transform: translateY(-8px);
        transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s linear .2s;
    }
    .site-nav__menu.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
    .site-nav__menu li { border-bottom: 1px solid var(--line); }
    .site-nav__menu a { display: block; padding: 1.1rem 0; font-size: 1.25rem; font-family: var(--font-display); color: var(--text); }
    .site-nav__menu .nav-cta { border: 0; padding: 1.1rem 0; color: var(--accent); }
    body.nav-open { overflow: hidden; }
}

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 4rem 2.5rem; font-size: .9375rem; }
.site-foot__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2.5rem; }
.site-foot__about p { color: var(--muted); margin-top: 1rem; max-width: 30ch; }
.site-foot h2 { font-family: var(--font-body); font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.site-foot ul { list-style: none; display: grid; gap: .6rem; }
.site-foot a { color: var(--text-soft); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot__bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
    margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
    color: var(--muted); font-size: .875rem;
}
.site-foot__bottom a { color: var(--muted); }
@media (max-width: 860px) {
    .site-foot__grid { grid-template-columns: 1fr 1fr; }
    .site-foot__about { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
    .site-foot__grid { grid-template-columns: 1fr; }
}

/* ---------- Botón flotante de WhatsApp (discreto, sin animación) ---------- */
.wa-float {
    position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 800;
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--wa); color: #0B2915;
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    transition: transform .2s var(--ease);
}
.wa-float:hover { transform: translateY(-2px); }
.wa-float svg { width: 28px; height: 28px; }

/* ---------- Encabezado de página interna ---------- */
.page-head { padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); max-width: 18ch; }
.page-head p { margin-top: 1.25rem; color: var(--muted); font-size: 1.125rem; max-width: 56ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin-top: 0; font-size: .875rem; color: var(--muted); margin-bottom: 1.5rem; list-style: none; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--line-strong); }

/* ---------- Preguntas (details/summary nativo) ---------- */
.qa { border-top: 1px solid var(--line); }
.qa:last-child { border-bottom: 1px solid var(--line); }
.qa summary {
    display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
    padding: 1.4rem 0; cursor: pointer; list-style: none;
    font-family: var(--font-display); font-size: clamp(1.125rem, 2.4vw, 1.3rem); font-weight: 500; color: var(--text);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
    content: ""; flex-shrink: 0; width: 12px; height: 12px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translate(-3px, -3px); transition: transform .2s var(--ease);
}
.qa[open] summary::after { transform: rotate(-135deg) translate(-3px, -3px); border-color: var(--accent); }
.qa summary:hover { color: var(--accent); }
.qa__body { padding: 0 0 1.6rem; color: var(--muted); max-width: 62ch; }
.qa__body p + p { margin-top: .75rem; }
.qa__body a { color: var(--text); }
.qa__body strong { color: var(--text-soft); font-weight: 600; }

/* ---------- Bloque CTA de cierre (reutilizable) ---------- */
.closing { text-align: left; }
.closing h2 { font-size: clamp(2.25rem, 6vw, 4rem); max-width: 16ch; }
.closing h2 em { font-style: normal; color: var(--accent); }
.closing p { margin-top: 1.25rem; color: var(--muted); font-size: 1.125rem; max-width: 48ch; }
.closing__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.25rem; }
.closing__meta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .5rem 2rem; color: var(--muted); font-size: .9375rem; }
.closing__meta a { color: var(--text-soft); }

@media (max-width: 520px) {
    .closing__actions .btn, .hero__actions .btn { width: 100%; }
}

/* ---------- Páginas legales (texto largo) ---------- */
.legal-body { padding-block: 3rem 5rem; }

/* ---------- Páginas de servicio y guías ---------- */
.svc-facts {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
    margin: 2.5rem 0 0; padding-top: 1.75rem; border-top: 1px solid var(--line);
}
.svc-facts dt { color: var(--muted); font-size: .875rem; }
.svc-facts dd { margin: .25rem 0 0; font-family: var(--font-display); color: var(--text); font-size: 1.375rem; font-weight: 600; }
@media (max-width: 640px) { .svc-facts { grid-template-columns: 1fr; gap: 1rem; } }

.prose { padding-block: clamp(2.5rem, 6vw, 4rem); }
.prose > section + section { margin-top: clamp(2.75rem, 6vw, 4rem); }
.prose h2 { font-size: clamp(1.625rem, 3.6vw, 2.25rem); margin-bottom: 1rem; }
.prose h3 { font-size: 1.25rem; margin: 1.75rem 0 .5rem; }
.prose p { color: var(--text-soft); }
.prose p + p { margin-top: 1rem; }
.prose a:not(.btn):not(.link-arrow) { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.prose a:not(.btn):not(.link-arrow):hover { color: var(--accent); text-decoration-color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.checks { list-style: none; display: grid; gap: .7rem; margin-top: 1rem; }
.checks li { position: relative; padding-left: 1.75rem; color: var(--text-soft); }
.checks li::before { content: ""; position: absolute; left: .1rem; top: .5em; width: 10px; height: 5px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.prose ol.numbered { padding-left: 1.25rem; display: grid; gap: .7rem; margin-top: 1rem; color: var(--text-soft); }
.prose ol.numbered li::marker { color: var(--accent); font-family: var(--font-display); font-weight: 600; }
.note { margin-top: 1.5rem; padding: 1.1rem 1.25rem; background: var(--bg-raised); border-radius: var(--radius-sm); color: var(--muted) !important; font-size: .9375rem; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; list-style: none; margin-top: 1rem; }
.related a { display: block; height: 100%; padding: 1.1rem 1.25rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); text-decoration: none !important; color: var(--text) !important; font-weight: 600; transition: border-color .2s; }
.related a span { display: block; margin-top: .25rem; color: var(--muted); font-weight: 400; font-size: .9375rem; }
.related a:hover { border-color: var(--accent); }
