/* ================================================================
   NAVBAR + MEGA MENÚ — Zubizarreta Systems
   ================================================================ */

:root { --nav-h: 68px; }

.zs-navbar {
    position: fixed; inset: 0 0 auto 0; z-index: 200;
    height: var(--nav-h);
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e5e7eb;
    transition: box-shadow 0.25s;
}

.zs-navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }

.zs-navbar .container {
    height: 100%; display: flex; align-items: center; gap: 0; position: relative;
}

.zs-brand {
    display: flex; align-items: baseline; gap: 6px;
    text-decoration: none; flex-shrink: 0; margin-right: 2.5rem;
}

.zs-brand-name {
    font-family: var(--font-display, Georgia, serif);
    font-size: 1.25rem; font-weight: 600; color: #111;
    letter-spacing: -0.03em; line-height: 1;
}

.zs-brand-sub {
    font-size: 0.58rem; font-weight: 700; letter-spacing: 0.16em;
    text-transform: uppercase; color: #9ca3af;
}

.zs-brand-img { height: 34px; width: auto; }

/* Hamburguesa */
.zs-hamburger {
    display: none; flex-direction: column; gap: 5px;
    width: 36px; height: 36px; padding: 7px;
    background: none; border: none; cursor: pointer; margin-left: auto; flex-shrink: 0;
}

.zs-hamburger span {
    display: block; width: 100%; height: 1.5px; background: #111;
    border-radius: 2px; transition: all 0.25s; transform-origin: center;
}

.zs-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.zs-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.zs-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Nav wrap */
.zs-nav-wrap { display: flex; align-items: center; flex: 1; gap: 0; }

/* Nav lista */
.zs-nav {
    display: flex; align-items: stretch; list-style: none;
    margin: 0; padding: 0; height: var(--nav-h); flex: 1;
}

.zs-nav > li { display: flex; align-items: stretch; }

.zs-nav > li > a {
    display: flex; align-items: center; padding: 0 13px;
    font-size: 13px; font-weight: 500; color: #6b7280;
    text-decoration: none; border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s; white-space: nowrap;
}

.zs-nav > li > a:hover, .zs-nav > li > a.zs-active {
    color: #111; border-bottom-color: #111;
}

/* Botón mega */
.zs-mega-btn {
    display: flex; align-items: center; gap: 5px; padding: 0 13px;
    height: 100%; font-size: 13px; font-weight: 500; color: #6b7280;
    background: none; border: none; border-bottom: 2px solid transparent;
    cursor: pointer; font-family: inherit; white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.zs-mega-btn svg { transition: transform 0.2s; flex-shrink: 0; }
.zs-has-mega.open .zs-mega-btn { color: #111; border-bottom-color: #111; }
.zs-has-mega.open .zs-mega-btn svg { transform: rotate(180deg); }

/* ── MEGA PANEL ──────────────────────────────────────────── */
.zs-mega {
    display: none; position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: #fff; border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1); z-index: 199;
    animation: megaSlide 0.18s ease;
}

@keyframes megaSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

.zs-has-mega.open .zs-mega { display: block; }

/* Grid del mega — auto columns para cualquier número de grupos */
.zs-mega-inner {
    max-width: 1200px; margin: 0 auto;
    padding: 1.75rem clamp(1rem,4vw,2rem);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0;
    align-items: start;
}

/* Columna */
.zs-mega-col {
    display: flex; flex-direction: column; gap: 1px;
    padding: 0 1.25rem;
    border-right: 1px solid #f3f4f6;
}

.zs-mega-col:first-child { padding-left: 0; }
.zs-mega-col:last-child  { border-right: none; padding-right: 0; }

.zs-mega-heading {
    font-size: 10px; font-weight: 800; letter-spacing: 0.14em;
    text-transform: uppercase; color: #9ca3af;
    display: block; padding-bottom: 0.625rem; margin-bottom: 4px;
    border-bottom: 1px solid #f3f4f6; text-decoration: none;
    transition: color 0.15s;
}

a.zs-mega-heading:hover { color: #16a34a; }

.zs-mega-link {
    font-size: 13px; font-weight: 500; color: #374151;
    text-decoration: none; padding: 5px 8px; border-radius: 5px;
    display: block; transition: background 0.12s, color 0.12s;
    line-height: 1.3;
}

.zs-mega-link:hover { background: #f9fafb; color: #111; }

.zs-mega-empty {
    font-size: 12px; color: #9ca3af; font-style: italic; padding: 5px 8px; display: block;
}

.zs-mega-ver-todos {
    font-size: 11px; font-weight: 700; color: #16a34a;
    text-decoration: none; padding: 7px 8px 0; display: block;
    margin-top: 4px; border-top: 1px solid #f3f4f6; transition: opacity 0.15s;
}

.zs-mega-ver-todos:hover { opacity: 0.75; }

/* Columna blog */
.zs-mega-col-blog {
    background: #f9fafb; border-radius: 8px;
    padding: 1rem 1.25rem !important; border-right: none !important;
}

.zs-mega-article {
    display: flex; flex-direction: column; gap: 3px;
    padding: 7px 8px; border-radius: 6px; text-decoration: none;
    transition: background 0.12s; margin-bottom: 3px;
}

.zs-mega-article:hover { background: #f0fdf4; }

.zs-mega-article-tag {
    font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: #16a34a;
}

.zs-mega-article-title { font-size: 12px; font-weight: 500; color: #111; line-height: 1.4; }

/* Footer del mega */
.zs-mega-footer {
    max-width: 1200px; margin: 0 auto;
    padding: 0.875rem clamp(1rem,4vw,2rem);
    border-top: 1px solid #f3f4f6;
    display: flex; align-items: center; gap: 0.75rem;
}

/* Overlay */
.zs-mega-overlay {
    display: none; position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: rgba(0,0,0,0.2); z-index: 198;
}

.zs-mega-overlay.active { display: block; }

/* CTA WhatsApp */
.zs-nav-cta {
    display: inline-flex; align-items: center; gap: 7px;
    background: #25d366; color: #fff; border-radius: 6px;
    padding: 8px 14px; font-size: 13px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
    margin-left: 1.25rem; flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
}

.zs-nav-cta:hover { background: #1fba58; transform: translateY(-1px); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .zs-hamburger { display: flex; }

    .zs-nav-wrap {
        display: none; position: fixed;
        top: var(--nav-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch;
        background: #fff; border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 8px 32px rgba(0,0,0,0.1);
        padding: 0.625rem; max-height: calc(100vh - var(--nav-h));
        overflow-y: auto; z-index: 199;
    }

    .zs-nav-wrap.open { display: flex; }

    .zs-nav { flex-direction: column; height: auto; gap: 2px; }
    .zs-nav > li { flex-direction: column; }

    .zs-nav > li > a {
        padding: 0.875rem 1rem; border-bottom: none; border-radius: 6px;
    }

    .zs-nav > li > a:hover,
    .zs-nav > li > a.zs-active { background: #f9fafb; border-bottom-color: transparent; }

    .zs-mega-btn {
        padding: 0.875rem 1rem; border-bottom: none; border-radius: 6px; width: 100%;
        justify-content: space-between;
    }

    .zs-mega-btn:hover, .zs-has-mega.open .zs-mega-btn {
        background: #f9fafb; border-bottom-color: transparent;
    }

    /* Mega accordion en mobile */
    .zs-mega {
        position: static; box-shadow: none; border: none;
        border-radius: 6px; background: #f9fafb; animation: none; margin-bottom: 4px;
    }

    .zs-mega-inner {
        grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem;
    }

    .zs-mega-col {
        border-right: none; border-bottom: 1px solid #e5e7eb;
        padding: 0 0 1rem !important;
    }

    .zs-mega-col:last-child, .zs-mega-col:nth-last-child(2):nth-child(odd) {
        border-bottom: none; padding-bottom: 0 !important;
    }

    .zs-mega-col-blog { background: none; }
    .zs-mega-footer { display: none; }
    .zs-mega-overlay { display: none !important; }
    .zs-nav-cta { margin: 0.5rem 1rem; }
}

@media (max-width: 480px) {
    .zs-mega-inner { grid-template-columns: 1fr; }
}
