/* ═══════════════════════════════════════════════
   public-nav.css  –  Unified nav + footer for all
   public templates (landing, funciones, etc.)
   ═══════════════════════════════════════════════ */

/* ── Z-INDEX HIERARCHY ──
   overlay:  1040  (covers page content)
   panel:    1050  (mobile slide-in above overlay)
   nav bar:  1060  (top bar — toggle stays clickable)
   menu:     1061  (desktop links sit above nav bar background)
   ─────────────────────────── */

/* ── Skip to content (a11y) ── */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 1070;
    padding: 0.5rem 1rem;
    background: var(--green, #008060);
    color: #fff;
    border-radius: 0 0 8px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-to-content:focus {
    top: 0;
}

/* ── NAV BAR (desktop) ── */
.public-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    padding: 0 2.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.public-nav.scrolled {
    border-bottom-color: var(--border-light);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.03);
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.nav-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nav-logo .v-tag,
.nav-panel-brand .v-tag {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--green);
    background: var(--green-bg);
    padding: 2px 6px;
    border-radius: 5px;
    margin-left: 2px;
    font-weight: 500;
}

/* ── Mobile toggle button ── */
.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.nav-mobile-toggle:hover {
    background: var(--bg-tint);
}


/* ── Nav menu (desktop: fixed overlay aligned to nav bar) ── */
.nav-menu {
    position: fixed;
    top: 0;
    right: 2.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    z-index: 1061;
}

.nav-menu-inner {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-menu-inner a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-menu-inner a:hover {
    color: var(--text);
    background: var(--bg-tint);
}

.nav-menu-inner a.active {
    color: var(--text);
    background: var(--bg-tint);
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 0.5rem;
    flex-shrink: 0;
}

.nav-menu-inner a.nav-login {
    color: var(--text);
    font-weight: 600;
}

.nav-menu-inner a.nav-cta {
    background: var(--green);
    color: #fff;
    padding: 0.5rem 1.1rem;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.nav-menu-inner a.nav-cta:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* ── Dark overlay behind mobile panel ── */
.nav-overlay {
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.nav-overlay.open {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

/* ── Panel header (mobile only) ── */
.nav-panel-header {
    display: none;
}

/* ── FOOTER ── */
.public-footer {
    background: var(--surface, #fff);
    border-top: 1px solid var(--border-light);
    padding: 3rem 2rem 0;
    font-size: 0.9rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-family: var(--font-display);
    text-decoration: none;
    color: inherit;
}

.footer-logo-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--green, #008060);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-brand-col {
    margin-bottom: 2rem;
}

.footer-tagline {
    margin: 0.4rem 0 0;
    font-size: 0.84rem;
    color: var(--text-muted, #999);
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.footer-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-group-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text, #1a1a1a);
    margin: 0 0 0.3rem;
}

.footer-group a {
    color: var(--text-secondary, #666);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-group a:hover {
    color: var(--green, #008060);
}

.footer-bottom {
    border-top: 1px solid var(--border-light, #e8e5df);
    margin-top: 2.5rem;
    padding: 1.5rem 0;
}

.footer-copy {
    color: var(--text-muted, #999);
    font-size: 0.83rem;
}

/* ── RESPONSIVE: footer mobile (<640px) ── */
@media (max-width: 639px) {
    .footer-inner {
        text-align: center;
    }

    .footer-brand-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-links-grid {
        text-align: left;
    }
}

/* ── RESPONSIVE: footer tablet (640-1023px) ── */
@media (min-width: 640px) and (max-width: 1023px) {
    .footer-brand-col {
        margin-bottom: 2rem;
    }

    .footer-links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── RESPONSIVE: footer desktop (≥1024px) ── */
@media (min-width: 1024px) {
    .footer-inner {
        display: grid;
        grid-template-columns: 200px 1fr;
        grid-template-rows: auto auto;
        gap: 0 3rem;
    }

    .footer-brand-col {
        grid-row: 1;
        grid-column: 1;
    }

    .footer-links-grid {
        grid-row: 1;
        grid-column: 2;
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-bottom {
        grid-column: 1 / -1;
    }
}

/* ── RESPONSIVE: intermediate nav (769px-1100px) ── */
@media (max-width: 1100px) and (min-width: 769px) {
    .nav-menu-inner a {
        font-size: 0.78rem;
        padding: 0.4rem 0.55rem;
    }
    .nav-menu-inner a.nav-cta {
        font-size: 0.78rem;
        padding: 0.45rem 0.9rem;
    }
    .nav-menu {
        right: 1.5rem;
    }
    .public-nav {
        padding: 0 1.5rem;
    }
}

/* ── RESPONSIVE: mobile <=768px ── */
@media (max-width: 768px) {
    /* Nav bar shrink */
    .public-nav {
        padding: 0 1.2rem;
    }

    /* Show hamburger */
    .nav-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Nav menu: slide-in panel from right */
    .nav-menu {
        right: 0;
        bottom: 0;
        height: auto;
        width: 280px;
        max-width: 85vw;
        background: var(--bg-tint, #f3f1ed);
        z-index: 1050;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: hidden;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu.open {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-menu-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 1.5rem 2rem;
    }

    /* Panel header with branding + close */
    .nav-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.2rem 0;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid var(--border-light, #e8e5df);
    }

    .nav-panel-brand {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        text-decoration: none;
        color: var(--text, #1a1a1a);
    }

    .nav-panel-close {
        background: none;
        border: none;
        color: var(--text-secondary, #666);
        cursor: pointer;
        padding: 0.4rem;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s, color 0.2s;
    }

    .nav-panel-close:hover {
        background: rgba(0, 0, 0, 0.06);
        color: var(--text, #1a1a1a);
    }

    .nav-menu-inner a {
        font-size: 1rem;
        padding: 0.85rem 1rem;
        border-radius: 10px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-menu-inner a.active {
        background: var(--bg-green-soft, #f0faf4);
        color: var(--green);
        font-weight: 600;
    }

    /* Divider becomes horizontal */
    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 0.75rem 0;
    }

    /* CTA in mobile panel */
    .nav-menu-inner a.nav-cta {
        margin-top: 0.5rem;
        justify-content: center;
        padding: 0.75rem 1.1rem;
        border-radius: 10px;
        font-size: 0.92rem;
    }

    .nav-menu-inner a.nav-login {
        justify-content: center;
    }

}

/* ── Focus-visible for keyboard navigation ── */
.nav-menu-inner a:focus-visible {
    outline: 2px solid var(--green, #008060);
    outline-offset: 2px;
    border-radius: 8px;
}

.nav-menu-inner a.nav-cta:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.4);
}

.nav-panel-close:focus-visible {
    outline: 2px solid var(--green, #008060);
    outline-offset: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .public-nav,
    .nav-menu,
    .nav-overlay,
    .nav-menu-inner a,
    .nav-menu-inner a.nav-cta,
    .nav-mobile-toggle,
    .nav-panel-close,
    .skip-to-content {
        transition: none !important;
    }

    .nav-menu-inner a.nav-cta:hover {
        transform: none;
    }

    .nav-menu {
        transition: none !important;
    }
}
