/* =========================================
   VARIABLES & TOKENS
   ========================================= */
:root {
    --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-topbar-bg: rgba(6,24,14,.85);
    --demo-note-bg: rgba(34,197,94,.14);
    --demo-note-border: rgba(34,197,94,.28);
    --demo-shadow: 0 10px 30px rgba(0,0,0,.35);
    --demo-radius: 14px;
    --demo-font: ui-sans-serif, system-ui, -apple-system, sans-serif;
    --demo-z: 9999;
    
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --secondary: #0ea5e9;
    --surface: #f8fafc;
    --surface-dark: #1e293b;
    --text: #0f172a;
    --text-light: #64748b;
    --text-inverse: #f8fafc;
    
    --container-width: 1120px;
    --header-height: 70px; 
    --radius: 8px;
    
    --demo-topbar-h: 0px;
    --site-nav-h: 0px;
    --demo-safe-top: env(safe-area-inset-top, 0px);
    --demo-topbar-offset: calc(var(--demo-topbar-h) + var(--demo-safe-top));
    
    --demo-note-text: var(--text);
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    background: #ffffff;
    line-height: 1.6;
    font-size: 16px;
    padding-top: var(--demo-topbar-offset);
}

img, video { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* TYPOGRAPHY */
h1, h2, h3 { font-family: 'Oswald', sans-serif; line-height: 1.2; text-transform: uppercase; letter-spacing: 0.02em; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 1rem; color: var(--primary-dark); }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; color: var(--text-light); }

/* UTILITIES */
.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding-inline: 20px; }
.section-padding { padding-block: 60px; }
.bg-surface { background: var(--surface); }
.bg-darker { background: #0f172a; color: var(--text-inverse); }
.light-text h2, .light-text p { color: var(--text-inverse); }

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

/* =========================================
   DEMO LAYER STYLES
   ========================================= */
#demo-layer .demo-topbar {
    position: fixed; 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);
    font-size: 14px;
    padding: 10px 0;
    transition: height 0.2s; /* Smooth resize */
}
.demo-container { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.demo-left { display: flex; align-items: center; gap: 10px; }
.demo-right a { color: var(--demo-link); text-shadow: var(--demo-link-shadow); font-weight: 600; font-size: 13px; }
#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 NOTE */
#demo-layer .demo-note {
    margin-top: 24px;
    padding: 16px;
    border-radius: var(--demo-radius);
    border: 1px solid var(--demo-note-border);
    background: var(--demo-note-bg);
    color: var(--demo-note-text);
    box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset;
    backdrop-filter: blur(6px);
    font-size: 0.95rem;
}
#demo-layer .demo-note .demo-note-prefix { color: var(--demo-accent); font-weight: 800; margin-right: 6px; }

/* TOPBAR MOBILE FIX:
   Alineación estricta a la IZQUIERDA, apilado (stacked).
*/
@media (max-width: 768px) {
    .demo-container {
        flex-direction: column;
        align-items: flex-start; /* Alineado a la izquierda */
        text-align: left; /* Alineado a la izquierda */
        gap: 4px;
        padding-bottom: 5px;
    }
    .demo-text {
        white-space: normal; /* Permitir wrap */
        overflow: visible;
        max-width: 100%;
        display: block;
        font-size: 12px;
        line-height: 1.4;
    }
    .demo-left {
        width: 100%;
        align-items: flex-start; /* Asegura que el punto y el texto empiecen arriba */
    }
    .demo-dot {
        margin-top: 4px; /* Ajuste visual para alinear con primera linea de texto */
    }
    .demo-right {
        display: block; /* Mostrar enlace */
        width: 100%;
        margin-left: 0;
        padding-left: 20px; /* Indentación visual para alinear con el texto de arriba (saltando el punto) */
    }
    .demo-right a {
        font-size: 12px;
        display: block;
    }
}

/* =========================================
   SITE NAV (STICKY)
   ========================================= */
.site-nav {
    position: sticky;
    top: var(--demo-topbar-offset);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9990;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    height: 70px;
    display: flex; align-items: center;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: var(--container-width); margin: 0 auto; padding-inline: 20px; }
.brand-logo { font-family: 'Oswald', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.nav-links { display: none; gap: 24px; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; color: var(--text); }
.nav-links .btn-nav { background: var(--primary); color: white; padding: 8px 16px; border-radius: 4px; }

/* HAMBURGER MENU FIX */
.mobile-toggle { 
    display: block; 
    padding: 10px; 
    margin-right: -10px; /* Alineación óptica */
}

/* Estilos de las líneas del menú */
.hamburger-box {
    width: 24px;
    height: 20px;
    position: relative;
    display: inline-block;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -1px;
}

.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
    width: 24px;
    height: 2px;
    background-color: var(--text); /* NEGRO para contraste */
    border-radius: 2px;
    position: absolute;
    transition-property: transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
    content: "";
}

.hamburger-inner::before { top: -8px; }
.hamburger-inner::after { bottom: -8px; }

@media (min-width: 769px) {
    .mobile-toggle { display: none; }
    .nav-links { display: flex; }
}

/* =========================================
   MOBILE DRAWER
   ========================================= */
.mobile-drawer-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 9991;
    opacity: 0; visibility: hidden; transition: 0.3s;
}
.mobile-drawer {
    position: fixed; top: var(--demo-topbar-offset); right: -100%; bottom: 0;
    width: 80%; max-width: 300px;
    background: white; z-index: 9992;
    transition: 0.3s ease-in-out;
    display: flex; flex-direction: column;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}
.mobile-drawer.active { right: 0; }
.mobile-drawer-overlay.active { opacity: 1; visibility: visible; }

.drawer-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.drawer-title { font-weight: 700; font-size: 1.2rem; }
.drawer-close { font-size: 1.5rem; padding: 5px; }
.drawer-links { padding: 20px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.drawer-links a { font-size: 1.1rem; font-weight: 500; color: var(--text); display: block; }
.drawer-links .btn-drawer { color: var(--primary); font-weight: 700; }

/* =========================================
   COMPONENTS
   ========================================= */

/* HERO */
.hero-section {
    position: relative;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    padding-top: 40px; 
}
.video-bg-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: -2; }
.video-bg { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to right, rgba(2, 6, 23, 0.85), rgba(2, 6, 23, 0.5)); z-index: -1; }
.hero-content { position: relative; z-index: 1; }
.hero-badge { background: var(--secondary); color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; display: inline-block; margin-bottom: 16px; }
.hero-title { margin-bottom: 16px; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.hero-subtitle { font-size: 1.2rem; margin-bottom: 32px; max-width: 600px; color: #e2e8f0; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: 6px; font-weight: 600; transition: transform 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--primary); color: white; }
.btn-outline { border: 2px solid white; color: white; }
.btn-sm { padding: 8px 16px; font-size: 0.9rem; background: var(--secondary); color: white; margin-top: 10px; }
.btn-whatsapp-lg { background: #25D366; color: white; font-weight: 700; width: 100%; padding: 16px; text-align: center; border-radius: 8px; margin-top: 16px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

/* GRID & CARDS */
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media(min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card-feature { background: white; padding: 32px; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: 0.3s; border: 1px solid #f1f5f9; }
.card-feature:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); border-color: var(--secondary); }
.icon-box { font-size: 2.5rem; margin-bottom: 16px; }

/* TABS */
.tabs-wrapper { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; }
.tabs-nav { display: flex; border-bottom: 1px solid #e2e8f0; overflow-x: auto; }
.tab-btn { flex: 1; padding: 16px; font-weight: 600; color: var(--text-light); text-align: center; white-space: nowrap; border-bottom: 3px solid transparent; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: #f0f9ff; }
.tabs-content { padding: 32px; }
.service-card-layout { display: flex; flex-direction: column; gap: 24px; }
@media(min-width: 768px) { .service-card-layout { flex-direction: row; align-items: center; } }
.service-img { flex: 1; border-radius: 8px; overflow: hidden; }
.service-img img { width: 100%; height: 250px; object-fit: cover; }
.service-info { flex: 1; }
.check-list li { position: relative; padding-left: 24px; margin-bottom: 8px; color: var(--text-light); }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: bold; }

/* GALLERY */
.gallery-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media(min-width: 600px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
.gallery-item { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; group; cursor: pointer; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-label {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.7); color: white;
    padding: 10px; font-size: 0.9rem; font-weight: 500;
    transform: translateY(100%); transition: 0.3s;
}
.gallery-item:hover .gallery-label, .gallery-item:focus-within .gallery-label { transform: translateY(0); }
.gallery-zoom { position: absolute; top: 10px; right: 10px; background: white; border-radius: 50%; width: 32px; height: 32px; opacity: 0; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.gallery-item:hover .gallery-zoom { opacity: 1; }

/* STEPPER */
.stepper { display: flex; flex-direction: column; gap: 32px; position: relative; }
@media(min-width: 768px) { .stepper { flex-direction: row; gap: 0; } }
.step { flex: 1; position: relative; padding: 0 20px; text-align: center; }
.step-num { width: 40px; height: 40px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; margin: 0 auto 16px; position: relative; z-index: 2; }
.step-content h3 { font-size: 1.1rem; }
@media(min-width: 768px) {
    .step:not(:last-child)::after {
        content: ""; position: absolute; top: 20px; left: 50%; width: 100%; height: 2px; background: #e2e8f0; z-index: 1;
    }
}

/* ACCORDION */
.accordion { display: flex; flex-direction: column; gap: 12px; }
.accordion-item { border: 1px solid #e2e8f0; border-radius: 8px; background: white; overflow: hidden; }
.accordion-trigger { padding: 16px; font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 40px; }
.accordion-trigger::after { content: "+"; position: absolute; right: 20px; font-size: 1.2rem; color: var(--primary); transition: 0.3s; }
details[open] .accordion-trigger::after { transform: rotate(45deg); }
.accordion-content { padding: 0 16px 16px; color: var(--text-light); border-top: 1px solid transparent; }
details[open] .accordion-content { border-color: #f1f5f9; animation: slideDown 0.3s; }

/* CONTACT (Modificado: Grid 2 Columnas Desktop + Mapa) */
.contact-wrapper { display: grid; grid-template-columns: 1fr; gap: 40px; }

@media(min-width: 768px) { 
    .contact-wrapper { grid-template-columns: 1fr 1fr; align-items: flex-start; } 
}

.contact-card { background: #f8fafc; padding: 24px; border-radius: 8px; margin-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.c-item { display: flex; flex-direction: column; }
.c-item strong { color: var(--primary-dark); }

/* FOOTER */
.site-footer { background: #0f172a; color: #94a3b8; padding: 40px 0; font-size: 0.9rem; border-top: 1px solid #1e293b; }
.footer-content { display: flex; flex-direction: column; gap: 24px; text-align: center; }
@media(min-width: 768px) { .footer-content { flex-direction: row; justify-content: space-between; text-align: left; } }
.footer-brand span { display: block; color: white; font-weight: 700; margin-bottom: 4px; }
.footer-links { display: flex; gap: 16px; justify-content: center; }
.footer-links a:hover { color: white; }
.demo-disclaimer { opacity: 0.5; font-size: 0.8rem; margin-top: 8px; }

/* FLOATING WA */
.float-wa { position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px; background: #25D366; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 9900; transition: 0.3s; }
.float-wa:hover { transform: scale(1.1); }

/* LIGHTBOX */
.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 10000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; }
.lightbox[aria-hidden="false"] { opacity: 1; visibility: visible; }
.lightbox-content { position: relative; max-width: 90%; max-height: 85%; }
.lightbox-content img { max-height: 80vh; border-radius: 4px; }
.lightbox-caption { color: white; text-align: center; margin-top: 10px; font-size: 1.1rem; }
.lightbox-close, .lightbox-prev, .lightbox-next { position: absolute; color: white; font-size: 2rem; padding: 10px; background: rgba(255,255,255,0.1); border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox button:hover { background: rgba(255,255,255,0.3); }

/* SCROLL MARGIN FOR STICKY NAV */
section { scroll-margin-top: calc(var(--demo-topbar-offset) + 80px); }
