
/* --- VARIABLES & TOKENS --- */
:root {
    /* 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-shadow: 0 10px 30px rgba(0,0,0,.35);
    --demo-radius: 14px;
    --demo-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    --demo-z: 9999;
    
    /* ADAPTATIVOS DEMO (Se calculan en JS, defaults aquí) */
    --site-bg: #ffffff;
    --demo-topbar-bg: rgba(20, 20, 20, 0.95); 
    --demo-note-bg: rgba(34,197,94,.08);
    --demo-note-border: rgba(34,197,94,.18);
    
    /* Variables de Altura Topbar */
    --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));

    /* BRAND THEME */
    --primary: #FACC15; /* Amarillo */
    --primary-dark: #EAB308;
    --secondary: #1F2937; /* Gris oscuro */
    --text-main: #374151;
    --text-light: #9CA3AF;
    --bg-light: #F3F4F6;
    --bg-white: #FFFFFF;
    --radius: 8px;
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --container-w: 1200px;
    --nav-h: 70px;
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    padding-top: var(--demo-topbar-offset); /* EVITA QUE TOPBAR TAPE CONTENIDO */
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--site-bg);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}
img, video { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; margin: 0; }

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

/* --- LAYOUT UTILS --- */
.container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 20px;
}
.section-padding { padding: 80px 0; }
.text-center { text-align: center; }
.bg-light { background-color: var(--bg-light); }
.bg-dark { background-color: var(--secondary); color: white; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

/* --- DEMO LAYER STYLES (OBLIGATORIO) --- */
#demo-layer .demo-topbar {
    position: fixed; /* Fixed para garantizar visibilidad siempre */
    top: 0; left: 0; right: 0;
    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);
    padding: 10px 0;
    font-size: 14px;
}
#demo-layer .demo-content-wrapper {
    display: flex; justify-content: space-between; align-items: center;
    max-width: 100%; padding: 0 20px; flex-wrap: wrap; gap: 10px;
}
#demo-layer .demo-left { display: flex; align-items: center; gap: 10px; }
#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;
}
#demo-layer .demo-back-link {
    color: var(--demo-link); text-shadow: var(--demo-link-shadow); font-weight: 600;
}
#demo-layer .demo-note {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--demo-radius);
    border: 1px solid var(--demo-note-border);
    background: var(--demo-note-bg);
    color: inherit;
    font-size: 0.95rem;
}
#demo-layer .demo-note-prefix { color: var(--demo-accent); font-weight: 700; margin-right: 5px; }

/* --- COMPONENTS --- */
.btn {
    display: inline-block; padding: 12px 30px; border-radius: 4px; font-weight: 600; cursor: pointer; border: none;
}
.btn-primary { background: var(--primary); color: var(--secondary); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-outline { border: 2px solid white; color: white; margin-left: 10px; }
.btn-block { display: block; width: 100%; }

/* --- HEADER & NAV --- */
.site-header {
    background: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: var(--nav-h);
    display: flex; align-items: center;
    position: sticky; top: var(--demo-topbar-offset); /* Sticky bajo el topbar */
    z-index: 100;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--secondary); }
.nav-list { display: flex; gap: 20px; align-items: center; }
.nav-link { font-weight: 500; font-size: 0.95rem; }
.nav-link.active { color: var(--primary-dark); font-weight: 700; }
.nav-cta { background: var(--secondary); color: var(--primary); padding: 8px 20px; border-radius: 4px; font-weight: 600; }

/* --- HERO --- */
.hero-section {
    position: relative; height: 600px; display: flex; align-items: center; color: white; overflow: hidden;
}
.video-bg-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }
#hero-video { width: 100%; height: 100%; object-fit: cover; }
.overlay { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.5); }
.hero-content { position: relative; z-index: 1; }
.badge-hero { background: var(--primary); color: var(--secondary); padding: 5px 10px; font-size: 0.8rem; font-weight: bold; text-transform: uppercase; border-radius: 2px; }
h1 { font-size: 3.5rem; line-height: 1.1; margin: 20px 0; }
.highlight { color: var(--primary); }
.hero-sub { font-size: 1.2rem; max-width: 600px; margin-bottom: 30px; opacity: 0.9; }

/* --- SECTIONS --- */
.card-feature { background: white; padding: 30px; border-radius: var(--radius); border-bottom: 4px solid var(--primary); transition: 0.3s; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.card-feature:hover { transform: translateY(-5px); }
.icon-box { font-size: 2.5rem; margin-bottom: 15px; }

/* TABS */
.tabs-container { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.tab-buttons { display: flex; background: #eee; }
.tab-btn { flex: 1; padding: 20px; border: none; background: transparent; cursor: pointer; font-weight: 600; border-bottom: 3px solid transparent; }
.tab-btn.active { background: white; border-bottom-color: var(--primary); color: var(--secondary); }
.tab-content { display: none; padding: 40px; animation: fadeIn 0.5s; }
.tab-content.active { display: block; }
.service-detail { display: flex; gap: 30px; align-items: center; }
.service-detail img { width: 40%; border-radius: var(--radius); }

/* GALLERY */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.gallery-item { margin: 0; position: relative; cursor: pointer; overflow: hidden; border-radius: var(--radius); aspect-ratio: 4/3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.gallery-item:hover img { transform: scale(1.1); }
.gallery-item figcaption { position: absolute; bottom: 0; left: 0; width: 100%; padding: 10px; background: rgba(0,0,0,0.7); color: white; font-size: 0.9rem; transform: translateY(100%); transition: 0.3s; }
.gallery-item:hover figcaption { transform: translateY(0); }

/* STEPPER */
.stepper { display: flex; justify-content: space-between; position: relative; gap: 20px; margin-top: 40px; }
.step { flex: 1; text-align: center; position: relative; z-index: 1; }
.step-number { width: 50px; height: 50px; background: var(--secondary); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; font-weight: bold; font-size: 1.2rem; }

/* CONTACT FORM */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-family: inherit; }
.contact-list li { margin-bottom: 15px; font-size: 1.1rem; }

/* ACCORDION (FAQ) */
.accordion-item { border: 1px solid #ddd; margin-bottom: 10px; border-radius: 4px; background: white; }
.accordion-item summary { padding: 15px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.accordion-item summary::after { content: '+'; font-size: 1.5rem; color: var(--primary); }
.accordion-item[open] summary::after { content: '-'; }
.accordion-content { padding: 0 15px 15px; color: #666; }

/* --- MOBILE FIRST GARANTIA (<768px) --- */
@media (max-width: 767px) {
    /* GARANTÍA: 1 COLUMNA */
    .grid-3, .contact-wrapper, .service-detail, .stepper { grid-template-columns: 1fr; display: flex; flex-direction: column; }
    
    /* NAV DRAWER */
    .menu-toggle { display: block; background: none; border: none; cursor: pointer; }
    .hamburger { display: block; width: 25px; height: 3px; background: var(--secondary); position: relative; }
    .hamburger::before, .hamburger::after { content: ''; position: absolute; width: 100%; height: 3px; background: var(--secondary); left: 0; }
    .hamburger::before { top: -8px; }
    .hamburger::after { top: 8px; }
    
    .nav-drawer {
        position: fixed;
        top: var(--demo-topbar-offset);
        left: -100%;
        width: 80%;
        height: calc(100vh - var(--demo-topbar-offset));
        background: white;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: 0.3s ease-in-out;
        padding: 20px;
        overflow-y: auto;
    }
    .nav-drawer.active { left: 0; }
    .nav-list { flex-direction: column; align-items: flex-start; gap: 15px; }
    .nav-cta { display: block; width: 100%; text-align: center; margin-top: 10px; }
    
    /* ADJUSTMENTS */
    h1 { font-size: 2.2rem; }
    .hero-section { height: auto; padding: 100px 0 60px; min-height: 500px; }
    .btn-outline { margin: 10px 0 0 0; display: inline-block; }
    .service-detail img { width: 100%; margin-bottom: 20px; }
    
    /* DEMO TOPBAR MOBILE */
    #demo-layer .demo-content-wrapper { flex-direction: column; align-items: flex-start; }
    #demo-layer .demo-right { align-self: flex-start; font-size: 0.85rem; }
    
    /* TABS -> ACCORDION in Mobile via JS logic mostly, but styling adjustments */
    .tab-buttons { display: none; } /* Ocultar botones de tabs en mobile si usamos lógica de acordeón o stack */
    .tab-content { display: block; border-bottom: 1px solid #eee; padding: 20px 0; } /* Mostrar todos apilados */
}

@media (min-width: 768px) {
    .menu-toggle { display: none; }
    .nav-drawer { position: static; height: auto; width: auto; background: transparent; box-shadow: none; display: block; }
}

/* --- LIGHTBOX --- */
.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 10000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: 0.3s; }
.lightbox.active { opacity: 1; pointer-events: all; }
.lightbox img { max-height: 90vh; max-width: 90vw; }
.lightbox-close { position: absolute; top: 20px; right: 20px; background: none; border: none; color: white; font-size: 3rem; cursor: pointer; }

/* --- A/B TESTING VARIANTS (Estilos activados por clase en body) --- */
/* Var B: Header no sticky, botones outline primarios */
body.ab-b .site-header { position: relative; top: 0; }
body.ab-b .btn-primary { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
