/* ============================================================
   TOKENS — DARK (default)
   ============================================================ */
:root {
    --bg:         #0c0f16;
    --bg-s:       #10141e;
    --bg-card:    #141923;
    --accent:     #f59e0b;
    --accent-lt:  #fbbf24;
    --accent-dim: rgba(245,158,11,0.10);
    --accent-rgb: 245,158,11;
    --wa:         #25d366;
    --text:       #edf0f4;
    --muted:      #7a8494;
    --dim:        #3c4455;
    --border:     #1a2030;
    --border-lt:  #222d40;
    --shadow:     rgba(0,0,0,0.4);

    --ff-head: 'Barlow Condensed', sans-serif;
    --ff-body: 'DM Sans', sans-serif;
    --max-w:   1160px;
    --r:       6px;

    /* Custom beziers (Emil Kowalski) */
    --ease-out-expo:   cubic-bezier(0.16, 1, 0.3, 1);
    --ease-clip:       cubic-bezier(0.77, 0, 0.175, 1);
    --ease-standard:   cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Light mode ─────────────────────────────────────────────── */
[data-theme="light"] {
    --bg:        #f4f1ec;
    --bg-s:      #eceae4;
    --bg-card:   #e5e2db;
    --accent:    #b07208;
    --accent-lt: #c98409;
    --accent-dim: rgba(176,114,8,0.10);
    --accent-rgb: 176,114,8;
    --text:      #12100d;
    --muted:     #6b6155;
    --dim:       #a09080;
    --border:    #d5d1c9;
    --border-lt: #cac6bc;
    --shadow:    rgba(0,0,0,0.12);
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Base reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--ff-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background 0.35s var(--ease-standard), color 0.35s var(--ease-standard);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px;
}

.section-label {
    display: block;
    font-family: var(--ff-head);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.section-header { margin-bottom: 64px; }

.section-title {
    font-family: var(--ff-head);
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 700;
    line-height: 1.05;
    color: var(--text);
}

/* ============================================================
   CLIP-PATH REVEALS (Emil Kowalski)
   ============================================================ */
/* Los estados ocultos iniciales solo se aplican si hay JS (.js se añade en el <head>).
   Sin JavaScript, todo el contenido se muestra directamente. */
.js .h1-clip {
    clip-path: inset(0 0 110% 0);
}
.h1-clip {
    display: block;
    transition: clip-path 0.9s var(--ease-clip);
}
.h1-clip.clipped  { clip-path: inset(0 0 -20% 0); }

.js .reveal-fade { opacity: 0; }
.reveal-fade {
    transition: opacity 0.7s var(--ease-out-expo);
}
.reveal-fade.visible { opacity: 1; }

.js .reveal-up {
    opacity: 0;
    transform: translateY(20px);
}
.reveal-up {
    transition: opacity 0.6s var(--ease-out-expo),
                transform 0.6s var(--ease-out-expo);
}
.reveal-up.visible { opacity: 1; transform: translateY(0); }

/* Compensa el header fijo al navegar con anclas */
section[id] { scroll-margin-top: 80px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 22px;
    border-radius: var(--r);
    font-family: var(--ff-body);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.2s var(--ease-out-expo),
                box-shadow 0.2s var(--ease-out-expo),
                background 0.2s var(--ease-standard);
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Hover gated — Emil Kowalski */
@media (hover: hover) {
    .btn-wa:hover   { background: #1fbe5b; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,211,102,0.28); }
    .btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
    .btn-primary:hover { background: var(--accent-lt); transform: translateY(-2px); }
}

.btn-wa { background: var(--wa); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--border-lt);
}
.btn-wa-lg { padding: 14px 26px; font-size: 1rem; }
.btn-primary {
    background: var(--accent);
    color: #0c0f16;
    font-weight: 600;
    width: 100%;
    justify-content: center;
    font-size: 0.95rem;
    padding: 14px;
}

/* ============================================================
   HEADER
   ============================================================ */
#header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 18px 0;
    border-bottom: 1px solid transparent;
    transition: background 0.3s var(--ease-standard),
                padding 0.3s var(--ease-standard),
                border-color 0.3s var(--ease-standard),
                backdrop-filter 0.3s;
}
#header.scrolled {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 0;
    border-bottom-color: var(--border);
}
[data-theme="dark"] #header.scrolled  { background: rgba(12,15,22,0.92); }
[data-theme="light"] #header.scrolled { background: rgba(244,241,236,0.92); }

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-badge {
    font-family: var(--ff-head);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1.5px solid rgba(var(--accent-rgb),0.35);
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 5px;
    letter-spacing: -0.04em;
    transition: border-color 0.2s, background 0.2s;
}
.logo-badge.sm { width: 32px; height: 32px; font-size: 1rem; }

@media (hover: hover) {
    .logo:hover .logo-badge { border-color: var(--accent); background: rgba(var(--accent-rgb),0.18); }
}

.logo-text {
    font-family: var(--ff-head);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    display: flex;
    flex-direction: column;
}
.logo-text small { font-size: 0.66rem; color: var(--muted); font-weight: 400; letter-spacing: 0.04em; }

nav ul { list-style: none; display: flex; align-items: center; gap: 28px; }
nav ul a { text-decoration: none; color: var(--muted); font-size: 0.86rem; transition: color 0.18s; }

@media (hover: hover) {
    nav ul a:hover { color: var(--text); }
}

.nav-cta {
    background: var(--accent) !important;
    color: #0c0f16 !important;
    padding: 7px 16px;
    border-radius: 5px;
    font-weight: 600 !important;
    font-size: 0.86rem !important;
    transition: background 0.18s !important;
}
@media (hover: hover) {
    .nav-cta:hover { background: var(--accent-lt) !important; color: #0c0f16 !important; }
}

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Theme toggle */
.theme-toggle {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-lt);
    border-radius: 50%;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
@media (hover: hover) {
    .theme-toggle:hover { color: var(--text); border-color: var(--accent); }
}
.theme-toggle svg { width: 16px; height: 16px; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4.5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.menu-toggle span {
    display: block;
    width: 20px; height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s var(--ease-standard), opacity 0.25s;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
    display: none;
    position: fixed;
    top: 66px; left: 0; right: 0;
    z-index: 99;
    background: var(--bg-s);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px 24px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s var(--ease-standard), transform 0.25s var(--ease-standard);
    pointer-events: none;
}
.mobile-nav.open { opacity: 1; transform: translateY(0); pointer-events: all; }
.mobile-nav ul { list-style: none; }
.mobile-nav ul li { border-bottom: 1px solid var(--border); }
.mobile-nav ul a { display: block; padding: 13px 0; color: var(--text); text-decoration: none; font-size: 1rem; }

/* ============================================================
   HERO
   ============================================================ */
#hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 40%;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
    position: relative;
}

.hero-left {
    display: flex;
    align-items: center;
    padding: 80px 0 80px 32px;
    max-width: calc(var(--max-w) * 0.6 + 32px);
    margin-left: auto;
}

.hero-content { max-width: 620px; }

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ff-head);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 32px;
}
.eyebrow-dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    animation: blink 2.5s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

#hero h1 {
    font-family: var(--ff-head);
    font-size: clamp(4rem, 14vw, 7rem);
    font-weight: 800;
    line-height: 0.88;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    padding-bottom: 0.15em;
}
.h1-accent { color: var(--accent); }

.hero-sub {
    font-size: 1.05rem;
    color: var(--muted);
    line-height: 1.75;
    margin-bottom: 40px;
    max-width: 480px;
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* Right: canvas */
.hero-right {
    position: relative;
    height: 100vh;
    overflow: hidden;
}
#heroCanvas { width: 100%; height: 100%; display: block; }

/* ============================================================
   SERVICIOS — editorial list (no icon tiles)
   ============================================================ */
#servicios { padding: 120px 0; }

.services-list { display: flex; flex-direction: column; }

.service-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 0 32px;
    align-items: start;
    padding: 36px 0;
    border-top: 1px solid var(--border);
    position: relative;
    transition: border-color 0.2s;
}
.service-row:last-child { border-bottom: 1px solid var(--border); }

/* Amber left accent on hover */
@media (hover: hover) {
    .service-row::before {
        content: '';
        position: absolute;
        left: 0; top: 0; bottom: 0;
        width: 2px;
        background: var(--accent);
        transform: scaleY(0);
        transform-origin: bottom;
        transition: transform 0.3s var(--ease-out-expo);
    }
    .service-row:hover::before { transform: scaleY(1); }
    .service-row:hover .svc-num { color: var(--accent); }
    .service-row:hover h3 { color: var(--accent); }
}

.svc-meta { padding-top: 4px; }

.svc-num {
    font-family: var(--ff-head);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dim);
    letter-spacing: 0.06em;
    transition: color 0.2s;
}

.svc-body h3 {
    font-family: var(--ff-head);
    font-size: 1.55rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
    transition: color 0.2s;
    line-height: 1.1;
}
.svc-body p { color: var(--muted); font-size: 0.92rem; line-height: 1.72; }

.svc-tags {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    padding-top: 4px;
    min-width: 140px;
}
.svc-tags span {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--muted);
    background: var(--bg-card);
    border: 1px solid var(--border-lt);
    padding: 3px 10px;
    border-radius: 99px;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

/* ============================================================
   NOSOTROS
   ============================================================ */
#nosotros {
    padding: 120px 0;
    background: var(--bg-s);
}

.nosotros-layout {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 80px;
    align-items: start;
}

.nosotros-left h2 {
    font-family: var(--ff-head);
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 20px;
    color: var(--text);
}
.nosotros-lead { color: var(--muted); font-size: 0.97rem; line-height: 1.78; }

.nosotros-right { display: flex; flex-direction: column; }

.feature {
    display: flex;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}
.feature:first-child { border-top: 1px solid var(--border); }

.feat-n {
    font-family: var(--ff-head);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.08em;
    padding-top: 3px;
    min-width: 22px;
    flex-shrink: 0;
}
.feat-body h4 {
    font-family: var(--ff-head);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text);
}
.feat-body p { color: var(--muted); font-size: 0.87rem; line-height: 1.65; }

/* ============================================================
   PROCESO — timeline
   ============================================================ */
#proceso { padding: 120px 0; }

.steps {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    margin-top: 56px;
}

.step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
}

.step-number {
    font-family: var(--ff-head);
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    opacity: 0.75;
}

.step-body h4 {
    font-family: var(--ff-head);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.step-body p { color: var(--muted); font-size: 0.88rem; line-height: 1.7; }

/* .step-connector {
    width: 60px;
    height: 1px;
    background: var(--border-lt);
    margin-top: 28px;
    flex-shrink: 0;
    position: relative;
}
.step-connector::after {
    content: '';
    position: absolute;
    right: -4px; top: -3px;
    width: 6px; height: 6px;
    border-right: 1px solid var(--border-lt);
    border-top: 1px solid var(--border-lt);
    transform: rotate(45deg);
} */

/* ============================================================
   CONTACTO
   ============================================================ */
#contacto {
    padding: 120px 0;
    background: var(--bg-s);
}

.contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 80px;
    align-items: start;
}

.contacto-left h2 {
    font-family: var(--ff-head);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.0;
    margin-bottom: 16px;
    color: var(--text);
}
.contacto-desc { color: var(--muted); margin-bottom: 28px; font-size: 0.97rem; }
.o-divider { margin-top: 20px; font-size: 0.78rem; color: var(--dim); }

/* Teléfono clicable */
.contacto-tel {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--ff-head);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.18s;
}
.contacto-tel svg { width: 20px; height: 20px; color: var(--accent); }
@media (hover: hover) {
    .contacto-tel:hover { color: var(--accent); }
}
.form-legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) {
    .form-legal a:hover { color: var(--accent); }
}

/* Form */
.contacto-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-card);
    border: 1.5px solid var(--border-lt);
    border-radius: var(--r);
    padding: 11px 14px;
    color: var(--text);
    font-family: var(--ff-body);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.18s var(--ease-standard);
    width: 100%;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--dim); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237a8494' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}
.form-group select option { background: var(--bg-card); }
.form-group textarea { resize: vertical; min-height: 110px; }

.form-legal { font-size: 0.73rem; color: var(--dim); line-height: 1.5; }
.form-success {
    display: none; padding: 12px 16px;
    background: rgba(37,211,102,0.08); border: 1px solid rgba(37,211,102,0.22);
    border-radius: var(--r); color: #4ade80; font-size: 0.86rem; text-align: center;
}
.form-error {
    display: none; padding: 12px 16px;
    background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.22);
    border-radius: var(--r); color: #f87171; font-size: 0.86rem; text-align: center;
}

/* Honeypot anti-spam: fuera de pantalla (no display:none, muchos bots lo detectan) */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 1px;
    width: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer { padding: 32px 0; border-top: 1px solid var(--border); }
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.footer-left { display: flex; align-items: center; gap: 10px; }
.footer-name { font-family: var(--ff-head); font-size: 0.85rem; color: var(--muted); }
.footer-copy { font-size: 0.75rem; color: var(--dim); }

.footer-legal { display: flex; gap: 18px; }
.footer-legal a {
    font-size: 0.75rem;
    color: var(--dim);
    text-decoration: none;
    transition: color 0.18s;
}
@media (hover: hover) {
    .footer-legal a:hover { color: var(--text); }
}

/* ============================================================
   WHATSAPP FLOAT
   ============================================================ */
.wa-float {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 54px; height: 54px;
    background: var(--wa);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(37,211,102,0.32);
    transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s var(--ease-out-expo);
}
@media (hover: hover) {
    .wa-float:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(37,211,102,0.48); }
}
.wa-float svg { width: 28px; height: 28px; color: #fff; }

/* ============================================================
   PÁGINAS LEGALES
   ============================================================ */
.legal-main { padding: 150px 0 90px; }
.legal-content { max-width: 780px; }

.legal-content h1 {
    font-family: var(--ff-head);
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 10px;
    color: var(--text);
}
.legal-updated { font-size: 0.8rem; color: var(--dim); margin-bottom: 48px; }

.legal-content h2 {
    font-family: var(--ff-head);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--accent);
    margin: 44px 0 12px;
}
.legal-content h3 {
    font-family: var(--ff-head);
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 8px;
}
.legal-content p, .legal-content li {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.75;
    margin-bottom: 10px;
}
.legal-content ul, .legal-content ol { padding-left: 22px; margin-bottom: 14px; }
.legal-content li { margin-bottom: 6px; }
.legal-content a { color: var(--accent-lt); text-decoration: underline; text-underline-offset: 2px; }
.legal-content strong { color: var(--text); font-weight: 600; }

/* Datos que la empresa debe completar, resaltados para localizarlos */
.dato-pendiente {
    background: var(--accent-dim);
    border-bottom: 1.5px dashed rgba(var(--accent-rgb), 0.6);
    color: var(--accent-lt);
    padding: 0 4px;
    border-radius: 3px;
    font-weight: 500;
    white-space: nowrap;
}

/* Tabla de cookies */
.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 0.85rem;
}
.cookie-table th, .cookie-table td {
    text-align: left;
    padding: 10px 12px;
    border: 1px solid var(--border-lt);
    color: var(--muted);
    vertical-align: top;
}
.cookie-table th {
    font-family: var(--ff-head);
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.04em;
    background: var(--bg-card);
}

/* Enlace volver */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.86rem;
    margin-bottom: 36px;
    transition: color 0.18s;
}
@media (hover: hover) {
    .back-link:hover { color: var(--accent); }
}

@media (max-width: 600px) {
    .legal-main { padding: 120px 0 72px; }
    .cookie-table { font-size: 0.78rem; }
    .cookie-table th, .cookie-table td { padding: 8px; }
}

/* ============================================================
   RESPONSIVE — mobile-first
   ============================================================ */

/* Tablet y móvil grande */
@media (max-width: 960px) {
    nav { display: none; }
    .menu-toggle { display: flex; }
    .mobile-nav { display: block; }

    #hero {
        grid-template-columns: 1fr;
        min-height: 100svh; /* svh = viewport real en móvil (excluye barra del browser) */
    }
    /* Canvas oculto en tablet/móvil: no aporta nada en pantalla pequeña */
    .hero-right { display: none; }

    .hero-left {
        padding: 110px 32px 72px;
        max-width: none;
        margin: 0;
        /* Centrado vertical con espacio para WA float */
        display: flex;
        align-items: center;
        min-height: 100svh;
    }

    .nosotros-layout,
    .contacto-grid { grid-template-columns: 1fr; gap: 48px; }

    .service-row { grid-template-columns: 60px 1fr; }
    .svc-tags { display: none; }

    .steps { flex-direction: column; gap: 32px; }
    .step-connector {
        width: 1px; height: 24px;
        align-self: flex-start; margin-left: 24px;
    }
    .step-connector::after {
        right: -3px; top: auto; bottom: -4px;
        transform: rotate(135deg);
    }
}

/* Móvil */
@media (max-width: 600px) {
    .container { padding: 0 20px; }

    #servicios, #nosotros, #proceso { padding: 72px 0; }

    /* Espacio inferior extra para que el botón WA flotante no tape el formulario */
    #contacto { padding: 72px 0 100px; }

    footer { padding-bottom: 88px; } /* ídem en footer */

    .hero-left { padding: 96px 20px 56px; min-height: 100svh; }

    /* H1 escalado para móvil: 3 líneas cortas necesitan tamaño más contenido */
    /*#hero h1 { font-size: clamp(2.6rem, 11vw, 5rem); }*/

    #hero h1 {
        font-size: 17vw;
    }

    /* Botones apilados y a ancho completo en móvil */
    .hero-ctas { flex-direction: column; }
    .hero-ctas .btn { width: 100%; justify-content: center; }

    .form-row { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; text-align: center; }

    .service-row {
        grid-template-columns: 44px 1fr;
        padding: 24px 0;
        gap: 0 16px;
    }
    .svc-body h3 { font-size: 1.3rem; }

    /* Touch targets mínimos 44px (Apple HIG / WCAG 2.5.5) */
    .btn { min-height: 44px; }
    .theme-toggle { width: 44px; height: 44px; }
    .mobile-nav ul a { min-height: 44px; display: flex; align-items: center; }

    /* WA float más pequeño en móvil y separado del borde */
    .wa-float { width: 50px; height: 50px; bottom: 20px; right: 16px; }
    .wa-float svg { width: 24px; height: 24px; }

    /* Sección nosotros más compacta */
    #nosotros .nosotros-layout { gap: 36px; }
    .feature { padding: 20px 0; }

    /* Steps en móvil más legibles */
    .step-number { font-size: 2.2rem; }
}

/* ============================================================
   MEJORAS MÓVIL Y NAVEGABILIDAD (Fase 2)
   ============================================================ */

/* Scroll-to-top button */
.scroll-top {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-lt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
    cursor: pointer;
    color: var(--muted);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s var(--ease-standard),
                transform 0.3s var(--ease-standard),
                color 0.2s, border-color 0.2s;
    pointer-events: none;
}
.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
@media (hover: hover) {
    .scroll-top:hover {
        color: var(--accent);
        border-color: var(--accent);
    }
}
.scroll-top svg {
    width: 18px;
    height: 18px;
}

/* Teléfono en header para móvil */
.header-tel {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--accent);
    text-decoration: none;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid rgba(var(--accent-rgb),0.25);
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.header-tel svg {
    width: 18px;
    height: 18px;
}
@media (hover: hover) {
    .header-tel:hover {
        border-color: var(--accent);
        background: rgba(var(--accent-rgb),0.15);
    }
}

/* Footer: sección asociaciones */
.footer-partners {
    width: 100%;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.footer-partners p {
    font-size: 0.72rem;
    color: var(--dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.partner-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}
.partner-logos a {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.65;
    transition: opacity 0.2s;
    filter: grayscale(0.3);
}
@media (hover: hover) {
    .partner-logos a:hover {
        opacity: 1;
        filter: grayscale(0);
    }
}
.partner-logos img,
.partner-logos svg {
    max-height: 36px;
    width: auto;
}

/* Mejoras móvil específicas */
@media (max-width: 960px) {
    .header-tel {
        display: inline-flex;
        margin-right: 8px;
    }
    /* Canvas oculto en tablet/móvil para ahorrar batería */
    .hero-right {
        display: none !important;
    }
    #hero {
        grid-template-columns: 1fr;
        min-height: 100svh;
    }
    .hero-left {
        max-width: none;
        margin: 0;
        padding: 110px 32px 72px;
        display: flex;
        align-items: center;
        min-height: 100svh;
    }
}

@media (max-width: 600px) {
    /* Tipografía más legible en móvil */
    body {
        line-height: 1.7;
    }
    .hero-sub {
        font-size: 1.1rem;
        line-height: 1.8;
    }
    .svc-body p {
        font-size: 0.95rem;
    }
    .step-body p {
        font-size: 0.92rem;
    }
    /* Botones más grandes para touch */
    .btn {
        min-height: 48px;
        font-size: 0.95rem;
    }
    .btn-primary {
        padding: 16px;
    }
    /* Formulario más espacioso */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px 16px;
        font-size: 16px; /* evita zoom en iOS */
    }
    /* Footer en columna */
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 18px;
    }
    .footer-legal {
        order: -1;
    }
    .footer-partners {
        margin-top: 16px;
        padding-top: 16px;
    }
    /* Scroll-to-top más accesible */
    .scroll-top {
        bottom: 82px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
    .scroll-top svg {
        width: 20px;
        height: 20px;
    }
    /* WA float no tapa */
    .wa-float {
        width: 52px;
        height: 52px;
        bottom: 18px;
        right: 18px;
    }
}

/* Animaciones más rápidas en móvil */
@media (max-width: 600px) {
    .reveal-fade {
        transition-duration: 0.5s;
    }
    .reveal-up {
        transition-duration: 0.45s;
    }
    .h1-clip {
        transition-duration: 0.7s;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .scroll-top {
        transition: none;
    }
    .hero-right canvas {
        animation: none;
    }
}

/* Logo APIEM en footer: fondo claro para contraste */
.partner-logos a[href*="apiem"] {
    background: #fff;
    border-radius: 6px;
    padding: 6px 12px;
    opacity: 1;
    filter: none;
    transition: transform 0.2s var(--ease-out-expo);
}
.partner-logos a[href*="apiem"] img {
    max-height: 40px;
    width: auto;
    display: block;
}
@media (hover: hover) {
    .partner-logos a[href*="apiem"]:hover {
        transform: scale(1.04);
    }
}

/* Logo REM en header */
.logo-img {
    height: 55px;
    width: auto;
    display: block;
    transition: opacity 0.2s;
}
@media (max-width: 960px) {
    .logo-img {
        height: 48px;
    }
}
@media (max-width: 600px) {
    .logo-img {
        height: 38px;
    }
}

/* ============================================================
   BANNER DE COOKIES
   ============================================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: var(--bg-s);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-out-expo);
}
.cookie-banner.visible {
    transform: translateY(0);
}
.cookie-banner-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-banner-inner p {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    flex: 1;
    min-width: 240px;
}
.cookie-banner-inner a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.btn-cookie {
    padding: 10px 20px;
    border-radius: var(--r);
    font-family: var(--ff-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-cookie-accept {
    background: var(--accent);
    color: #0c0f16;
}
.btn-cookie-reject {
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--border-lt);
}
@media (hover: hover) {
    .btn-cookie:hover {
        transform: translateY(-1px);
    }
    .btn-cookie-accept:hover {
        background: var(--accent-lt);
    }
    .btn-cookie-reject:hover {
        border-color: var(--accent);
        color: var(--text);
    }
}

@media (max-width: 600px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 0 20px;
        gap: 14px;
    }
    .cookie-banner-actions {
        justify-content: stretch;
    }
    .btn-cookie {
        flex: 1;
        text-align: center;
        padding: 12px;
    }
    /* Ajuste para que el banner no tape el botón WA flotante */
    .cookie-banner.visible ~ .wa-float,
    .cookie-banner.visible ~ footer {
        /* No es necesario, el WA float está a la derecha */
    }
}

/* Logo REM en footer */
.footer-logo-img {
    height: 42px;
    width: auto;
    display: block;
}
@media (max-width: 600px) {
    .footer-logo-img {
        height: 38px;
    }
}

/* Logo APIEM más grande */
.partner-logos a[href*="apiem"] {
    background: #fff;
    border-radius: 6px;
    padding: 8px 16px;
    opacity: 1;
    filter: none;
    transition: transform 0.2s var(--ease-out-expo);
    max-width: 100%;
}
.partner-logos a[href*="apiem"] img {
    max-height: 60px;
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
}
@media (hover: hover) {
    .partner-logos a[href*="apiem"]:hover {
        transform: scale(1.04);
    }
}
@media (max-width: 600px) {
    .partner-logos a[href*="apiem"] img {
        max-height: 50px;
        width: auto;
    }
}

/* Subtítulo dentro del H1 */
.h1-sub {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 600;
    opacity: 0.9;
}
@media (max-width: 600px) {
    .h1-sub {
        font-size: clamp(1.6rem, 5vw, 2.2rem);
    }
}
