
/* ==========================================
   VARIABLES & RESET
   ========================================== */
:root {
    /* Identidad */
    --primary: #FACC15;
    --primary-dark: #CA8A04;
    --dark: #171717;
    --light: #F3F4F6;
    --white: #FFFFFF;
    --text: #374151;
    --radius: 8px;
    
    /* DEMO LAYER - INVARIANTES */
    --demo-accent: #22c55e;
    --demo-topbar-text: #ffffff;
    --demo-link: #86efac;
    --demo-link-shadow: 0 0 10px rgba(34,197,94,.35);
    --demo-glow: 0 0 0 3px rgba(34,197,94,.25), 0 0 12px rgba(34,197,94,.6);
    
    /* DEMO LAYER - ADAPTATIVOS (Defaults) */
    --site-bg: #FFFFFF;
    --demo-topbar-bg: rgba(6, 24, 14, 0.95);
    --demo-note-bg: rgba(34,197,94,.08);
    --demo-note-border: rgba(34,197,94,.18);
    --demo-shadow: 0 10px 30px rgba(0,0,0,.35);
    --demo-font: ui-sans-serif, system-ui, -apple-system, sans-serif;
    --demo-z: 9999;
    
    /* OFFSET & SAFE AREAS */
    --demo-topbar-h: 0px; 
    --demo-safe-top: env(safe-area-inset-top, 0px);
    --demo-topbar-offset: calc(var(--demo-topbar-h) + var(--demo-safe-top));
    --header-h: 70px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background-color: var(--site-bg);
    line-height: 1.6;
    /* Offset obligatorio para el Topbar */
    padding-top: var(--demo-topbar-offset);
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* Focus Visible */
:focus-visible { outline: 3px solid rgba(34,197,94,.85); outline-offset: 3px; }

/* ==========================================
   DEMO LAYER CSS (OBLIGATORIO)
   ========================================== */
#demo-layer .demo-topbar {
    position: fixed; /* Fixed para que siempre esté */
    top: 0; left: 0; width: 100%;
    z-index: var(--demo-z);
    background: var(--demo-topbar-bg);
    color: var(--demo-topbar-text);
    box-shadow: var(--demo-shadow);
    font-family: var(--demo-font);
    backdrop-filter: blur(8px);
    font-size: 14px;
}
#demo-layer .demo-container {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 15px; max-width: 1200px; margin: 0 auto;
}
#demo-layer .demo-left { display: flex; align-items: center; gap: 10px; }
#demo-layer .demo-right { text-align: right; }
#demo-layer .demo-topbar a {
    color: var(--demo-link);
    text-shadow: var(--demo-link-shadow);
    font-weight: 600;
}
#demo-layer .demo-dot {
    width: 10px; height: 10px; border-radius: 999px; display: inline-block;
    box-shadow: var(--demo-glow); background: var(--demo-accent);
    flex-shrink: 0;
}
/* Mobile layout for demo bar */
@media (max-width: 600px) {
    #demo-layer .demo-container { flex-direction: column; gap: 5px; text-align: center; }
    #demo-layer .demo-right { font-size: 0.9em; }
}

#demo-layer .demo-note {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--demo-note-border);
    background: var(--demo-note-bg);
    color: inherit;
    font-size: 0.95rem;
    position: relative;
}
#demo-layer .demo-note .demo-note-prefix {
    color: var(--demo-accent);
    font-weight: 700;
    margin-right: 5px;
}

/* ==========================================
   LAYOUT & UTILITIES
   ========================================== */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.bg-light { background: var(--light); }
.bg-dark { background: var(--dark); color: var(--white); }
.text-white { color: var(--white); }
.text-center { text-align: center; }
.section-title {
    font-size: 2rem; margin-bottom: 40px; text-align: center;
    position: relative; padding-bottom: 15px;
}
.section-title::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 60px; height: 4px; background: var(--primary);
}

/* Botones */
.btn {
    display: inline-block; padding: 12px 24px; border-radius: 4px;
    font-weight: 600; cursor: pointer; border: 2px solid transparent;
}
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--white); color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--dark); }
.full-width { width: 100%; }

/* ==========================================
   HEADER & NAV
   ========================================== */
.site-header {
    position: sticky; top: var(--demo-topbar-offset); /* Sticky debajo del demo */
    background: rgba(255,255,255,0.95);
    height: var(--header-h);
    display: flex; align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.5rem; color: var(--dark); text-transform: uppercase; letter-spacing: 1px; }

/* Desktop Nav */
.desktop-nav { display: none; gap: 20px; align-items: center; }
.desktop-nav a { font-weight: 500; font-size: 0.95rem; }

/* Mobile Toggle */
.menu-toggle {
    background: none; border: none; cursor: pointer; padding: 10px;
    display: block; /* Visible en mobile */
}
.hamburger {
    display: block; width: 25px; height: 3px; background: var(--dark);
    position: relative;
}
.hamburger::before, .hamburger::after {
    content: ''; position: absolute; width: 100%; height: 3px; background: var(--dark); left: 0;
}
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

/* Drawer Mobile */
.mobile-drawer {
    position: fixed;
    top: var(--demo-topbar-offset); /* Empieza debajo del demo */
    left: 0; width: 100%; height: calc(100vh - var(--demo-topbar-offset));
    z-index: 2000;
    pointer-events: none; /* Transparente cuando cerrado */
}
.drawer-content {
    position: absolute; top: 0; right: -100%; /* Oculto derecha */
    width: 80%; max-width: 300px; height: 100%;
    background: var(--white);
    padding: 20px;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    pointer-events: auto;
    display: flex; flex-direction: column;
}
.drawer-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0; transition: opacity 0.3s;
    pointer-events: auto;
    display: none; /* Oculto por defecto */
}
/* Estado Abierto */
.mobile-drawer.open .drawer-content { right: 0; }
.mobile-drawer.open .drawer-backdrop { display: block; opacity: 1; }
.mobile-drawer.open { pointer-events: auto; }

.drawer-nav a { display: block; padding: 15px 0; border-bottom: 1px solid #eee; font-size: 1.1rem; }
.drawer-close {
    align-self: flex-end; font-size: 2rem; background: none; border: none; cursor: pointer; margin-bottom: 20px;
}

/* ==========================================
   SECCIONES & COMPONENTES
   ========================================== */
/* Hero */
.hero {
    height: 80vh; min-height: 500px;
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: var(--white);
    padding-top: var(--header-h); /* Compensar header sticky */
}
.hero h1 { font-size: 2.5rem; margin-bottom: 20px; line-height: 1.2; }
.hero-sub { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.9; }
.hero-actions { display: flex; flex-direction: column; gap: 15px; align-items: center; }

/* Grids - Mobile First (1 columna) */
.grid-3 { display: grid; gap: 30px; grid-template-columns: 1fr; }
.grid-2 { display: grid; gap: 40px; grid-template-columns: 1fr; }

/* Cards */
.card {
    background: var(--white); padding: 30px; border-radius: var(--radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); text-align: center;
    transition: transform 0.3s;
}
.card:hover { transform: translateY(-5px); }
.icon { font-size: 3rem; margin-bottom: 15px; }

/* Tabs */
.tabs-header { display: flex; overflow-x: auto; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #ddd; }
.tab-btn {
    background: none; border: none; padding: 10px 20px; font-size: 1rem;
    cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab-btn.active { border-bottom-color: var(--primary); font-weight: bold; }
.tab-panel { display: none; animation: fadeIn 0.4s; }
.tab-panel.active { display: block; }
.panel-inner { display: flex; flex-direction: column; gap: 20px; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
.gallery-item { position: relative; overflow: hidden; border-radius: var(--radius); display: block; }
.gallery-item .overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(250, 204, 21, 0.8); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: 0.3s; color: #000; font-weight: bold;
}
.gallery-item:hover .overlay { opacity: 1; }

/* Stepper */
.stepper { display: flex; flex-direction: column; gap: 30px; }
.step { position: relative; padding-left: 50px; }
.step-num {
    position: absolute; left: 0; top: 0;
    width: 35px; height: 35px; background: var(--primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}

/* Accordion */
.accordion-item { border-bottom: 1px solid #ddd; }
.accordion-trigger {
    width: 100%; text-align: left; background: none; border: none;
    padding: 20px 0; font-size: 1.1rem; font-weight: 600;
    display: flex; justify-content: space-between; cursor: pointer;
}
.accordion-content { display: none; padding-bottom: 20px; color: #666; }
.accordion-content.open { display: block; }
.accordion-trigger[aria-expanded="true"] .icon { transform: rotate(45deg); }
.icon { transition: 0.3s; }

/* Form */
.form-group { margin-bottom: 20px; }
.form-control {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px;
    font-family: inherit;
}

/* Lightbox */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 10000;
    display: none; align-items: center; justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox-img { max-width: 90%; max-height: 90%; border-radius: 4px; }
.lightbox-close {
    position: absolute; top: 20px; right: 20px;
    background: none; border: none; color: #fff; font-size: 3rem; cursor: pointer;
}

/* Back to top */
#back-to-top {
    position: fixed; bottom: 20px; right: 20px;
    width: 40px; height: 40px; background: var(--primary);
    border: none; border-radius: 50%; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    font-size: 1.2rem; z-index: 900;
}
#back-to-top.visible { display: flex; }

/* ==========================================
   MEDIA QUERIES (DESKTOP)
   ========================================== */
@media (min-width: 768px) {
    .desktop-nav { display: flex; }
    .menu-toggle { display: none; }
    .hero h1 { font-size: 3.5rem; }
    .hero-actions { flex-direction: row; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .panel-inner { flex-direction: row; align-items: center; }
    .panel-inner img { width: 50%; }
    .gallery-grid { grid-template-columns: repeat(4, 1fr); }
    .stepper { flex-direction: row; }
    .step { padding-left: 0; padding-top: 50px; text-align: center; }
    .step-num { left: 50%; transform: translateX(-50%); }
    
    /* Layout Demo Notes Side (Optional) */
    .container { position: relative; }
}

/* ==========================================
   ANIMACIONES
   ========================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
