/* ═══════════════════════════════════════════
   GLOBAL DESIGN SYSTEM — Kuasar
   ═══════════════════════════════════════════ */

:root {
    --bg-primary: #1c1c1c;
    --bg-secondary: #1c1c1c;
    --bg-card: #303030;
    --bg-card-hover: #3a3a3a;
    --accent-orange: #F9AE00;
    --accent-orange-glow: rgba(249, 174, 0, 0.25);
    --accent-blue: #3366ff;
    --accent-blue-glow: rgba(51, 102, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #8f9bb3;
    --text-muted: #5a6580;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ═══ RESET & BASE ═══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: 'Corbel', sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
img { max-width: 100%; height: auto; }

/* ═══ UTILITY ═══ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; position: relative; }
.section-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-orange); margin-bottom: 16px; }
.section-label::before { content: ''; width: 24px; height: 2px; background: var(--accent-orange); border-radius: 2px; }
.section-title { font-size: clamp(32px, 5vw, 48px); font-weight: 800; line-height: 1.15; margin-bottom: 20px; letter-spacing: -0.02em; }
.section-subtitle { font-size: 18px; color: var(--text-secondary); max-width: 600px; line-height: 1.7; }
.highlight { color: var(--accent-orange); }

/* ═══ BUTTONS ═══ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 36px; border-radius: 50px; font-weight: 600; cursor: pointer; border: none; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; }
.btn-primary { background: var(--accent-orange); color: #0f0f14; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 40px rgba(249, 174, 0, 0.4); }
.btn-secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }

/* ═══ NAVBAR ═══ */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 16px 0; transition: all 0.3s ease; }
.navbar.scrolled { background: rgba(15, 15, 20, 0.9); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border-subtle); padding: 12px 0; }
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar-logo img { height: 36px; width: auto; }
.navbar-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.navbar-links a { font-size: 16px; font-weight: 500; color: var(--text-secondary); }
.navbar-links a:hover { color: var(--text-primary); }
.navbar-cta { display: flex; align-items: center; gap: 12px; }
.navbar-cta .btn { padding: 10px 24px; font-size: 13px; }
.mobile-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 24px; cursor: pointer; }
.mobile-nav-cta { display: none; }

/* ═══ MEGA MENU ═══ */
.dropdown { position: relative; }
.mega-menu { position: absolute; top: 100%; left: -450px; width: 1250px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 50px; opacity: 0; visibility: hidden; transition: all 0.3s ease; box-shadow: var(--shadow-card); pointer-events: none; margin-top: 15px; text-align: left; }
.mega-menu::before { content: "Trae tus aplicaciones a Kuasar"; display: block; text-align: center; font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 30px; }
.dropdown:hover .mega-menu { opacity: 1; visibility: visible; pointer-events: auto; margin-top: 5px; z-index: 9999; }
.mega-menu-content { display: flex; gap: 20px; }
.mega-menu-col { flex: 1; }
.mega-menu-col h4 { font-size: 17px; color: var(--text-primary); margin-bottom: 16px; }
.sub-col { margin-bottom: 20px; }
.sub-col .mega-cat { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border-subtle); }
.sub-col a { display: block; font-size: 14px !important; color: var(--text-secondary) !important; margin-bottom: 8px; }
.sub-col a:hover { color: var(--accent-orange) !important; }
.mega-menu-col.mega-menu-img { background: transparent; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; padding: 0; }
.mega-menu-col.mega-menu-img img { max-width: 100%; transform: translateX(-2px); }

/* ═══ PRICING DROPDOWN ═══ */
.simple-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
    margin-top: 15px;
    z-index: 1000;
}
.dropdown:hover .simple-dropdown { opacity: 1; visibility: visible; margin-top: 5px; }
.pricing-dropdown-content { display: flex; align-items: center; gap: 30px; }
.pricing-img { flex: 1.2; background: transparent; border-radius: var(--radius-sm); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pricing-links { flex: 2; }
.simple-dropdown a { display: block; padding: 12px; border-radius: var(--radius-sm); transition: 0.2s; }
.simple-dropdown a span { display: block; font-size: 15px !important; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.simple-dropdown a small { display: block; font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.simple-dropdown a:hover { background: rgba(15, 15, 20, 0.4); padding-left: 20px; }
.simple-dropdown a:hover span { color: var(--accent-orange); }


/* ═══ REVEAL ANIMATIONS ═══ */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ═══ FOOTER ═══ */
.footer { background: #111111; padding: 80px 0 40px; border-top: 1px solid var(--border-subtle); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand p { color: var(--text-secondary); font-size: 14px; margin-top: 20px; max-width: 300px; }
.footer-col h4 { color: #fff; font-size: 16px; font-weight: 700; margin-bottom: 24px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { color: var(--text-muted); font-size: 14px; }
.footer-col a:hover { color: var(--accent-orange); }
.footer-bottom { margin-top: 60px; padding-top: 40px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { color: var(--text-muted); font-size: 13px; }
.footer-socials { display: flex; gap: 16px; }
.footer-socials a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 16px; font-family: 'Inter', sans-serif; }
.footer-socials a:hover { background: var(--accent-orange); color: #000; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
    .mega-menu { width: 900px; left: -250px; }
}

@media (max-width: 991px) {
    .navbar-links { display: none; }
    .navbar-cta .btn-secondary { display: none; }
    .mobile-toggle { display: block; }
    .footer-grid { grid-template-columns: 1fr 1fr; }

    /* ── Mobile nav overlay ── */
    .navbar-links.active {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 68px;
        left: 0;
        right: 0;
        height: calc(100vh - 68px);
        background: rgba(15, 15, 20, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 999;
        padding: 8px 0 40px;
        overflow-y: auto;
        border-top: 1px solid var(--border-subtle);
        animation: mobileMenuIn 0.22s ease;
    }
    @keyframes mobileMenuIn {
        from { opacity: 0; transform: translateY(-6px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .navbar-links.active > li { width: 100%; }
    .navbar-links.active > li:not(.mobile-nav-cta) > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 24px;
        font-size: 16px;
        font-weight: 600;
        color: var(--text-secondary);
        border-bottom: 1px solid var(--border-subtle);
        transition: color 0.2s, background 0.2s;
    }
    .navbar-links.active > li:not(.mobile-nav-cta) > a:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.03);
    }
    .navbar-links.active .mega-menu,
    .navbar-links.active .simple-dropdown { display: none !important; }

    /* ── Mobile accordion: show dropdown when .open ── */
    .navbar-links.active .dropdown.open .mega-menu,
    .navbar-links.active .dropdown.open .simple-dropdown {
        display: block !important;
        position: static !important;
        width: 100% !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        background: rgba(255, 255, 255, 0.02);
        border: none;
        border-top: 1px solid var(--border-subtle);
        border-radius: 0;
        padding: 8px 0 8px 24px;
        margin-top: 0;
        box-shadow: none;
        transform: none;
        left: auto;
    }
    .navbar-links.active .dropdown.open > a { color: var(--accent-orange) !important; }
    .navbar-links.active .dropdown.open > a span { display: inline-block; transform: rotate(180deg); }
    /* Mega-menu mobile layout */
    .navbar-links.active .dropdown.open .mega-menu::before { display: none !important; }
    .navbar-links.active .dropdown.open .mega-menu-content { flex-direction: column; gap: 0; }
    .navbar-links.active .dropdown.open .mega-menu-img { display: none; }
    .navbar-links.active .dropdown.open .mega-menu-col { margin-bottom: 4px; }
    .navbar-links.active .dropdown.open .mega-menu-col h4 { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; padding: 8px 0 4px; border-bottom: 1px solid var(--border-subtle); }
    .navbar-links.active .dropdown.open .sub-col { margin-bottom: 2px; }
    .navbar-links.active .dropdown.open .sub-col .mega-cat { font-size: 11px; }
    .navbar-links.active .dropdown.open .sub-col a { display: block; padding: 7px 0; font-size: 14px !important; color: var(--text-secondary) !important; border-bottom: none; }
    .navbar-links.active .dropdown.open .sub-col a:hover { color: var(--accent-orange) !important; padding-left: 6px; }
    /* Simple-dropdown (Precios) mobile layout */
    .navbar-links.active .dropdown.open .pricing-img { display: none; }
    .navbar-links.active .dropdown.open .pricing-dropdown-content { flex-direction: column; gap: 0; }
    .navbar-links.active .dropdown.open .simple-dropdown a { padding: 10px 0; border-radius: 0; border-bottom: 1px solid var(--border-subtle); }
    .navbar-links.active .dropdown.open .simple-dropdown a:last-child { border-bottom: none; }
    .navbar-links.active .dropdown.open .simple-dropdown a span { font-size: 14px !important; }
    .navbar-links.active .dropdown.open .simple-dropdown a:hover { padding-left: 6px; background: none; }

    .navbar-links.active .mobile-nav-cta {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 24px 24px 0;
    }
    .navbar-links.active .mobile-nav-cta .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: 15px;
    }

    /* ── Hero banner mobile reorganization ──
       Imagen arriba → texto abajo (orden visual de banner)
       !important necesario porque cada page CSS redefine estos
       en su propio bloque @media (max-width: 991px) */
    .hero { min-height: auto !important; padding-bottom: 56px !important; }
    .hero-content-wrapper { flex-direction: column-reverse !important; gap: 24px !important; }
    .hero-image { margin-top: 0 !important; width: 100% !important; }
    .hero-image img { max-height: 240px !important; animation: none !important; }
}

@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }

    /* ── Shared component mobile overrides ── */
    .cta-box { padding: 48px 20px !important; }
    .hero-actions { flex-direction: column; gap: 12px; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .section-subtitle { font-size: 16px; }
}

@media (max-width: 480px) {
    .btn { padding: 14px 28px; font-size: 14px; }
}
