/* =========================================================
   GLOBAL.CSS — BAK'TUN TECHNOLOGY
   Paleta: Crema cálida · Dorado maya · Equilibrado y elegante
   ========================================================= */

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── VARIABLES ──────────────────────────────────────────── */
:root {
    /* Base — crema cálida, no blanco puro */
    --bg-base:      #f2ebe0;   /* crema tostada — fondo principal */
    --bg-soft:      #ede4d5;   /* un tono más abajo — secciones alternas */
    --bg-warm:      #e6dbc8;   /* crema profunda — cards, formularios */
    --bg-deep:      #ddd0b8;   /* separadores y zonas con más presencia */
    --white:        #fdfbf6;   /* "blanco" cálido — solo para contraste máximo */

    /* Dorados */
    --gold:         #c9a961;
    --gold-l:       #d9bc7a;
    --gold-bright:  #e8cc8a;
    --gold-deep:    #a8883d;
    --gold-ink:     #7a6028;
    --gold-rich:    #b8952e;   /* dorado más saturado para acentos fuertes */

    /* Dorados translúcidos */
    --gold-tint:    rgba(201, 169, 97, 0.14);
    --gold-tint-s:  rgba(201, 169, 97, 0.30);
    --gold-tint-m:  rgba(201, 169, 97, 0.50);
    --gold-tint-bg: rgba(201, 169, 97, 0.08);

    /* Textos — cálidos, nunca negro frío */
    --ink:          #221a08;
    --ink-mid:      #3d2f10;
    --ink-soft:     #6b5530;
    --ink-muted:    #9e8660;
    --ink-ghost:    #c0a878;

    /* Bordes — siempre dorados */
    --border:       rgba(168, 136, 61, 0.22);
    --border-s:     rgba(168, 136, 61, 0.42);
    --border-m:     rgba(168, 136, 61, 0.65);
    --border-solid: #d4b87a;

    /* Sombras ámbares */
    --shadow-xs:    0 2px 8px  rgba(140, 100, 20, 0.10);
    --shadow-sm:    0 4px 16px rgba(140, 100, 20, 0.14);
    --shadow-md:    0 8px 32px rgba(140, 100, 20, 0.18);
    --shadow-lg:    0 16px 56px rgba(140, 100, 20, 0.22);
    --shadow-xl:    0 28px 80px rgba(140, 100, 20, 0.28);

    /* Tipografía */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body:    'Poppins', system-ui, sans-serif;

    /* Layout */
    --radius-xs:    6px;
    --radius-sm:    10px;
    --radius-md:    16px;
    --radius-lg:    24px;
    --radius-xl:    40px;
    --max:          1400px;

    /* Transiciones */
    --t-fast:       0.16s ease;
    --t-base:       0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --t-spring:     0.42s cubic-bezier(0.34, 1.48, 0.64, 1);

    /* Retrocompatibilidad */
    --teal:         var(--ink);
    --teal-l:       var(--ink-mid);
    --bg:           var(--bg-base);
    --bg2:          var(--bg-soft);
    --fg:           var(--ink);
    --fg2:          var(--ink-soft);
    --light-bg:     var(--bg-soft);
    --accent-gold:  var(--gold);
    --accent-light-gold: var(--gold-l);
    --ivory:        var(--bg-base);
    --cream:        var(--bg-soft);
    --cream-deep:   var(--bg-warm);
}

/* ── BASE ───────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

img { display: block; max-width: 100%; }
a   { text-decoration: none; color: inherit; }

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }

/* ══════════════════════════════════════════════════════════
   HEADER / NAV
══════════════════════════════════════════════════════════ */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 72px;

    /* Crema cálida translúcida — no blanco */
    background: rgba(240, 232, 218, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-s);

    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Línea dorada animada al fondo del header */
header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--gold-tint-m) 15%,
        var(--gold) 45%,
        var(--gold-bright) 55%,
        var(--gold) 65%,
        var(--gold-tint-m) 85%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

header.scrolled {
    background: rgba(234, 224, 206, 0.96);
    box-shadow: var(--shadow-md);
    border-color: var(--border-m);
}
header.scrolled::after { opacity: 1; }

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 clamp(20px, 5%, 60px);
    max-width: var(--max);
    margin: 0 auto;
}

/* ── LOGO ───────────────────────────────────────────────── */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img { height: 42px; width: auto; }

.logo-text h1 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--gold-ink);
    letter-spacing: 0.08em;
    line-height: 1;
}

.logo-text p {
    font-family: var(--font-body);
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    color: var(--ink-muted);
    font-weight: 500;
    margin-top: 3px;
    text-transform: uppercase;
}

/* ── NAV LINKS ──────────────────────────────────────────── */
.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2px;
}

.nav-links a {
    display: block;
    padding: 8px 15px;
    color: var(--ink-soft);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm);
    transition: color var(--t-fast), background var(--t-base);
    position: relative;
}

.nav-links a:hover {
    color: var(--gold-ink);
    background: rgba(168, 136, 61, 0.12);
}

/* ── MENÚ HAMBURGUESA ───────────────────────────────────── */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-m);
    color: var(--gold-deep);
    font-size: 1rem;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast), border-color var(--t-fast);
    flex-shrink: 0;
}
.menu-toggle:hover {
    background: var(--gold-tint-s);
    border-color: var(--gold);
}

/* ── BOTÓN TEMA ─────────────────────────────────────────── */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-m);
    color: var(--gold-deep);
    font-size: 0.9rem;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: background var(--t-fast), border-color var(--t-fast);
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--gold-tint-s);
    border-color: var(--gold);
}
.theme-toggle i {
    position: absolute;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.theme-toggle .fa-sun {
    opacity: 0;
    transform: scale(0.4) rotate(-90deg);
}
.theme-toggle .fa-moon {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* ══════════════════════════════════════════════════════════
   BOTONES
══════════════════════════════════════════════════════════ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--gold-ink) 0%, var(--gold-deep) 40%, var(--gold) 100%);
    background-size: 200% 100%;
    background-position: 0 0;
    color: var(--white);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 13px 28px;
    border-radius: var(--radius-xl);
    border: none;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition:
        background-position var(--t-base),
        transform var(--t-spring),
        box-shadow var(--t-base);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.15);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    background-position: 100% 0;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.btn-secondary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(168, 136, 61, 0.10);
    color: var(--gold-ink);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 26px;
    border-radius: var(--radius-xl);
    border: 1.5px solid var(--border-m);
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: all var(--t-base);
    text-decoration: none;
}
.btn-secondary:hover,
.btn-outline:hover {
    background: rgba(168, 136, 61, 0.20);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    color: var(--gold-ink);
}

/* ── DOWNLOAD BUTTON ────────────────────────────────────── */
.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(168, 136, 61, 0.08);
    color: var(--gold-deep);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-m);
    padding: 11px 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--t-base), border-color var(--t-fast), color var(--t-fast), transform var(--t-spring);
    letter-spacing: 0.02em;
}
.download-button:hover {
    background: linear-gradient(135deg, var(--gold-deep), var(--gold));
    border-color: transparent;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════════════════════════════════
   SECTION REVEAL
══════════════════════════════════════════════════════════ */
.section-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.section-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════
   SECTION LABEL / TAG
══════════════════════════════════════════════════════════ */
.section-label,
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-ink);
    background: rgba(168, 136, 61, 0.14);
    border: 1px solid var(--border-m);
    border-radius: var(--radius-xl);
    padding: 6px 16px;
    margin-bottom: 14px;
}
.section-label i,
.section-tag i {
    font-size: 0.72rem;
    color: var(--gold-rich);
}

/* ── SECTION HEADINGS ───────────────────────────────────── */
.section-h,
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin-bottom: 14px;
}
.section-h em,
.section-title em {
    color: var(--gold-rich);
    font-style: italic;
}

.section-p,
.section-subtitle {
    font-size: 1rem;
    color: var(--ink-soft);
    line-height: 1.75;
    max-width: 540px;
    margin-bottom: 48px;
}
.section-subtitle {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* ══════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════ */
footer {
    background: var(--bg-warm);
    border-top: 1px solid var(--border-s);
    color: var(--ink);
}

/* Footer compacto */
.foot-mini {
    background: var(--bg-deep);
    border-top: 1px solid var(--border-s);
    padding: 28px clamp(20px, 5%, 60px);
    text-align: center;
}
.foot-mini p { font-size: 0.8rem; color: var(--ink-muted); }
.foot-mini a {
    color: var(--gold-deep);
    font-weight: 500;
    transition: color var(--t-fast);
}
.foot-mini a:hover { color: var(--gold-rich); }

/* Footer con columnas */
.footer-inner { max-width: var(--max); margin: 0 auto; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
    padding: 64px clamp(20px, 5%, 60px) 48px;
    border-bottom: 1px solid var(--border-s);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.footer-brand .logo-text h1 { color: var(--gold-ink); }
.footer-brand p {
    font-size: 0.83rem;
    color: var(--ink-muted);
    line-height: 1.7;
    max-width: 240px;
}

.footer-col h4 {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin-bottom: 18px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-col ul li a {
    font-size: 0.85rem;
    color: var(--ink-soft);
    transition: color var(--t-fast), padding-left var(--t-base);
    display: block;
}
.footer-col ul li a:hover {
    color: var(--gold-deep);
    padding-left: 5px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px clamp(20px, 5%, 60px);
}
.footer-bottom p {
    font-size: 0.77rem;
    color: var(--ink-muted);
}
.footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--ink-muted);
    border: 1px solid var(--border-m);
    border-radius: var(--radius-xs);
    padding: 4px 10px;
    font-weight: 600;
    background: rgba(168, 136, 61, 0.08);
}
.footer-badge i { color: var(--gold-rich); }

footer > p {
    font-size: 0.85rem;
    color: var(--ink-muted);
    text-align: center;
    padding: 24px clamp(20px, 5%, 60px);
}

/* ══════════════════════════════════════════════════════════
   SCROLL TO TOP
══════════════════════════════════════════════════════════ */
#toTop {
    position: fixed;
    right: 22px;
    bottom: 90px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-warm);
    color: var(--gold-deep);
    border: 1.5px solid var(--border-m);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    box-shadow: var(--shadow-sm);
    transition: opacity 0.25s ease, transform 0.25s ease, box-shadow var(--t-base);
    z-index: 999;
}
#toTop.show {
    opacity: 1;
    pointer-events: auto;
}
#toTop:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: var(--shadow-md);
    background: var(--gold-tint-s);
}

/* ══════════════════════════════════════════════════════════
   WHATSAPP FLOTANTE
══════════════════════════════════════════════════════════ */
.whatsapp-floating {
    position: fixed;
    left: 20px;
    bottom: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.38);
    z-index: 999;
    text-decoration: none;
    transition: transform var(--t-spring), box-shadow var(--t-base);
}
.whatsapp-floating:hover {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 16px 40px rgba(37, 211, 102, 0.5);
}

/* ══════════════════════════════════════════════════════════
   MODO CLARO (toggle JS)
══════════════════════════════════════════════════════════ */
body.light-mode {
    background: var(--bg-soft);
    color: var(--ink);
}
body.light-mode header {
    background: rgba(230, 219, 200, 0.92);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — NAVEGACIÓN
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    header { height: 64px; }

    .menu-toggle { display: flex; }

    .theme-toggle { width: 36px; height: 36px; }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(234, 224, 206, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-m);
        padding: 16px 20px 20px;
        gap: 2px;
        box-shadow: var(--shadow-md);
    }
    .nav-links.active { display: flex; }

    .nav-links a {
        padding: 11px 16px;
        border-radius: var(--radius-sm);
        font-size: 0.9rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .footer-bottom { flex-direction: column; align-items: flex-start; }

    #toTop { right: 16px; bottom: 84px; }
    .whatsapp-floating { left: 16px; bottom: 20px; }
}

@media (max-width: 480px) {
    nav { padding: 0 16px; }
    .logo-text h1 { font-size: 1.1rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom p { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}