/* =========================================
   1. RESET & BASE
   ========================================= */

/* Skip to Content (Accessibility) */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--purple, #B571DE);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-to-content:focus {
    top: 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    /* Layout */
    overflow-x: hidden;
    margin: 0;
    padding: 0;

    /* Visual */
    background-color: var(--bg-cream);
    color: var(--text-color);

    /* Typography */
    font-family: var(--font-primary);
}

/* Container and Grids extracted to layout.css */
/* Utilities extracted to utilities.css */

/* =========================================
   4. LOADER
   ========================================= */
/* =========================================
   4. LOADER
   ========================================= */
.loader-container {
    /* Layout */
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;

    /* Visual */
    background-color: var(--bg-cream, #fefbf3);
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    width: 80px;
    height: 80px;
    animation: breathe 2s infinite ease-in-out;
    filter: drop-shadow(0 0 10px rgba(157, 96, 207, 0.3));
    /* Soft Purple Glow */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(157, 96, 207, 0.3));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(157, 96, 207, 0.6));
    }
}

body.loaded .loader-container {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.no-scroll {
    overflow: hidden;
    height: 100%;
}

/* =========================================
   5. HEADER & NAVBAR
   ========================================= */
#header-placeholder {
    display: block;
    min-height: 72px; /* Match new header height */
}

#footer-placeholder {
    display: block;
    min-height: 400px;
}

/* .header base */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.header.hidden {
    transform: translateY(-100%);
}

/* =========================================
   6. FOOTER
   ========================================= */
.footer {
    /* Layout */
    position: relative;
    width: 100%;
    overflow: hidden;

    /* Box Model */
    margin-top: 80px;
    padding: 60px 0 20px;
    border-radius: 20px 20px 0 0;

    /* Visual */
    background: radial-gradient(120% 100% at 50% 0%, var(--soft-orange) 0%, var(--purple-light) 40%, var(--cyan) 100%);
    color: var(--white);
}

/* Subtle pattern overlay if desired, or just clean gradient */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.15;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.div-space {
    margin-left: auto;
}

.footer-logo {
    margin-bottom: 5px;
    width: 160px;
    height: auto;
    filter: brightness(0) invert(1);
    /* Ensure white logo */
}

.footer-socials {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    align-items: center;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}

.article-card svg.bi-arrow-up-right,
.food-card svg.bi-arrow-up-right,
.routine-card svg.bi-arrow-up-right,
.card-icon svg.bi-arrow-up-right,
.article-image svg.bi-arrow-up-right,
.article-header svg.bi-arrow-up-right {
    color: var(--white);
    fill: var(--white);
    opacity: 0.9;
}

.social-icon i {
    font-size: 20px;
    color: var(--white);
    transition: transform 0.3s ease;
    line-height: 1;
    display: flex;
}

.social-icon:hover {
    background-color: var(--cyan);
    transform: translateY(-2px);
}

.social-icon:hover i {
    color: var(--white);
}

.footer-heading {
    color: var(--teal-light);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

.footer-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 30px;
    height: 2px;
    background-color: var(--teal);
}

.footer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav-item {
    margin-bottom: 12px;
}

.footer-nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-nav-link:hover {
    color: var(--teal-light) !important;
    transform: translateX(5px);
}

.footer-bottom {
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    padding-top: 30px;
    padding-bottom: 20px;
}

.footer-legal-links {
    display: flex;
    gap: 20px;
}

.footer-legal-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-legal-link:hover {
    color: var(--white);
    text-decoration: underline;
}

@media (max-width: 1200px) {
    .footer {
        padding: 60px;
        border-radius: 25px 25px 0 0;
    }
}

@media (max-width: 900px) {
    .footer {
        padding: 40px 20px;
    }
}

/* =========================================
   7. STANDARDIZED PAGE CONTAINER
   ========================================= */
.page-container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding: 60px 0.75rem 0;
}

@media (min-width: 576px) {
    .page-container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .page-container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .page-container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .page-container {
        max-width: 1140px;
    }
}
/* ============================================================
   HEADER REDESIGN — Vitalia
   3-column layout · Avatar dropdown · Mobile drawer panel
   ============================================================ */

/* ── 1. HEADER SHELL ──────────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(254, 251, 243, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, background 0.3s ease;
}

.header.hidden {
    transform: translateY(-100%);
}

/* ── 2. INNER LAYOUT (3 columns) ──────────────────────────── */
.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0;
    padding: 0 24px;
    height: 68px;
    max-width: 1280px;
    margin: 0 auto;
}

/* ── 3. LOGO (left col) ───────────────────────────────────── */
.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    /* Left col: align logo to the left */
    justify-content: flex-start;
}

.navbar-brand .logo {
    width: 130px;
    height: auto;
    display: block;
    transition: opacity 0.2s ease;
}

.navbar-brand .logo:hover {
    opacity: 0.85;
}

/* ── 4. CENTER NAV ──────────────────────────────────────────  */
.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.header-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted, #707070);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
    position: relative;
}

.header-nav-link > svg {
    opacity: 0.65;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.header-nav-link:hover > svg,
.header-nav-link.active > svg {
    opacity: 1;
}

.header-nav-link:hover {
    color: var(--text-color, #333);
    background: rgba(0, 0, 0, 0.04);
}

.header-nav-link.active,
.header-nav-link.bold-active {
    color: var(--text-color, #333);
    font-weight: 600;
}

/* ── 5. AUTH ZONE (right col) ─────────────────────────────── */
.header-auth {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* Guest buttons */
.nav-guest-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-login-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted, #707070);
    text-decoration: none;
    padding: 7.5px 18px;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 50px;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.nav-login-link:hover {
    color: var(--text-color, #333);
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.25);
}

.nav-btn-signup {
    display: inline-flex;
    align-items: center;
    padding: 9px 20px;
    border-radius: 50px;
    background: var(--purple, #B571DE);
    color: var(--white);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 12px rgba(181, 113, 222, 0.3);
}

.nav-btn-signup:hover {
    background: var(--purple-dark, #9b55c8);
    box-shadow: 0 4px 18px rgba(181, 113, 222, 0.45);
    transform: translateY(-1px);
}

/* ── 6. USER MENU (logged in) ─────────────────────────────── */
.nav-user-menu {
    position: relative;
}

/* Avatar button — icon only */
.nav-avatar-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    padding: 2px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.nav-avatar-btn:hover {
    border-color: var(--purple, #B571DE);
    box-shadow: 0 0 0 3px rgba(181, 113, 222, 0.15);
}

.nav-avatar-btn[aria-expanded="true"] {
    border-color: var(--purple, #B571DE);
    box-shadow: 0 0 0 3px rgba(181, 113, 222, 0.2);
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--purple, #B571DE);
    color: var(--white);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0;
    user-select: none;
    flex-shrink: 0;
}

/* Premium crown badge */
.nav-avatar-crown[hidden],
.nav-mobile-crown[hidden] {
    display: none !important;
}

.nav-avatar-crown {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--gold, #e8a010);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
    color: var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.nav-avatar-crown svg {
    width: 8px;
    height: 8px;
}

/* ── 7. DROPDOWN PANEL ───────────────────────────────────── */
.nav-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 230px;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 6px;
    z-index: 9999;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
    pointer-events: none;
}

.nav-user-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0s;
    pointer-events: auto;
}

/* Dropdown header — user info */
.nav-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 12px;
}

.nav-dropdown-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--purple, #B571DE);
    color: var(--white);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}

.nav-dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nav-dropdown-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-dropdown-email {
    font-size: 0.775rem;
    color: var(--text-muted, #707070);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Dropdown items */
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color, #333);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.15s ease, color 0.12s ease;
}

.nav-dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.nav-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-dropdown-item:hover svg {
    opacity: 1;
}

/* Plan item */
.nav-dropdown-item--plan {
    color: var(--purple-dark, #693a87);
}

.nav-dropdown-item--plan svg,
.nav-plan-icon {
    opacity: 1 !important;
    width: 16px;
    height: 16px;
}

.nav-dropdown-item--plan.is-premium svg,
.is-premium .nav-plan-icon {
    color: var(--gold);
}

.nav-dropdown-item--plan:hover {
    background: rgba(181, 113, 222, 0.07);
}

/* Danger item */
.nav-dropdown-item--danger {
    color: var(--color-danger);
}

.nav-dropdown-item--danger svg {
    opacity: 1;
    color: var(--color-danger);
}

.nav-dropdown-item--danger:hover {
    background: rgba(215, 58, 58, 0.07);
}

.nav-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 4px 8px;
}

/* ── 8. HAMBURGER BUTTON (mobile) ──────────────────────────── */
.nav-hamburger {
    display: none; /* shown at mobile breakpoint */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    padding: 4px;
    transition: background 0.2s ease;
    z-index: 1002;
    flex-shrink: 0;
}

.nav-hamburger:hover {
    background: rgba(0, 0, 0, 0.06);
}

.hamburger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-color, #333);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                width 0.3s ease;
    transform-origin: center;
}

/* Hamburger → X animation */
.nav-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── 9. MOBILE OVERLAY ────────────────────────────────────── */
.nav-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(20, 20, 30, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-mobile-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ── 10. MOBILE PANEL (drawer) ────────────────────────────── */
.nav-mobile-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 90vw);
    z-index: 1051;
    background: var(--bg-cream, #fefbf3);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow-y: auto;

    /* Hidden state */
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-mobile-panel.is-open {
    transform: translateX(0);
}

/* Panel header */
.nav-mobile-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.nav-mobile-logo {
    width: 110px;
    height: auto;
    display: block;
}

.nav-mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    cursor: pointer;
    color: var(--text-color, #333);
    transition: background 0.2s ease;
}

.nav-mobile-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.nav-mobile-close svg {
    width: 16px;
    height: 16px;
}

/* Mobile user block */
.nav-mobile-user-block {
    padding: 16px 20px;
}

.nav-mobile-user-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(181, 113, 222, 0.06);
    border-radius: 14px;
    border: 1px solid rgba(181, 113, 222, 0.12);
}

.nav-mobile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.nav-mobile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--purple, #B571DE);
    color: var(--white);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.nav-mobile-crown {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--gold, #e8a010);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-cream, #fefbf3);
    color: var(--white);
}

.nav-mobile-crown svg {
    width: 8px;
    height: 8px;
}

.nav-mobile-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nav-mobile-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-mobile-user-email {
    font-size: 0.78rem;
    color: var(--text-muted, #707070);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Mobile guest block */
.nav-mobile-guest-block {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-mobile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.nav-mobile-btn--primary {
    background: var(--purple, #B571DE);
    color: var(--white);
    box-shadow: 0 3px 14px rgba(181, 113, 222, 0.3);
}

.nav-mobile-btn--primary:hover {
    background: var(--purple-dark, #9b55c8);
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(181, 113, 222, 0.4);
}

.nav-mobile-btn--ghost {
    background: transparent;
    color: var(--text-color, #333);
    border: 1.5px solid rgba(0, 0, 0, 0.12);
}

.nav-mobile-btn--ghost:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.2);
}

/* Mobile divider */
.nav-mobile-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0 20px;
}

/* Mobile nav links */
.nav-mobile-nav {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-mobile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color, #333);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    width: 100%;
    transition: background 0.18s ease, color 0.18s ease;
    position: relative;
}

.nav-mobile-link svg {
    width: 18px;
    height: 18px;
    opacity: 0.55;
    flex-shrink: 0;
    transition: opacity 0.18s ease;
}

.nav-mobile-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--purple, #B571DE);
}

.nav-mobile-link:hover svg {
    opacity: 1;
}

.nav-mobile-link.active,
.nav-mobile-link.bold-active {
    background: rgba(181, 113, 222, 0.07);
    color: var(--purple, #B571DE);
    font-weight: 600;
}

.nav-mobile-link.active svg,
.nav-mobile-link.bold-active svg {
    opacity: 1;
}



/* Plan link */
.nav-mobile-link--plan {
    color: var(--purple-dark, #693a87);
}

.nav-mobile-link--plan svg {
    opacity: 1;
}

.nav-mobile-link--plan.is-premium svg {
    color: var(--gold);
}

/* Danger */
.nav-mobile-link--danger {
    color: var(--color-danger);
}

.nav-mobile-link--danger svg {
    color: var(--color-danger);
    opacity: 1;
}

.nav-mobile-link--danger:hover {
    background: rgba(215, 58, 58, 0.06);
    color: var(--color-danger);
}

/* Mobile user actions */
.nav-mobile-user-actions {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
}

/* ── 11. INTERSTICIAL "MI ESPACIO" ────────────────────────── */
/* NOTE: The interstitial is moved to document.body by JS (initEspacioInterstitial)
   so it is NOT clipped inside the header's stacking context */
.espacio-interstitial {
    position: fixed;
    inset: 0;
    /* z-index must be above header (1000) and mobile panel (1051) */
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    pointer-events: none;
}

.espacio-interstitial.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0s linear 0s;
    pointer-events: auto;
}

.espacio-interstitial-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 30, 0.5);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.espacio-interstitial-card {
    position: relative;
    z-index: 1;
    background: var(--white);
    border-radius: 24px;
    padding: 40px 36px 36px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.06);

    /* Slide-up animation */
    transform: translateY(16px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.espacio-interstitial.is-open .espacio-interstitial-card {
    transform: translateY(0);
}

.espacio-interstitial-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #707070);
    transition: background 0.2s ease;
}

.espacio-interstitial-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.espacio-interstitial-close svg {
    width: 14px;
    height: 14px;
}

.espacio-interstitial-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(181, 113, 222, 0.15), rgba(128, 202, 205, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--purple, #B571DE);
}

.espacio-interstitial-icon svg {
    width: 26px;
    height: 26px;
}

.espacio-interstitial-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color, #333);
    margin: 0 0 10px;
    font-family: var(--font-primary);
    line-height: 1.3;
}

.espacio-interstitial-desc {
    font-size: 0.9rem;
    color: var(--text-muted, #707070);
    line-height: 1.6;
    margin: 0 0 28px;
}

.espacio-interstitial-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.espacio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.espacio-btn--primary {
    background: var(--purple, #B571DE);
    color: var(--white);
    box-shadow: 0 3px 14px rgba(181, 113, 222, 0.3);
}

.espacio-btn--primary:hover {
    background: var(--purple-dark, #9b55c8);
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(181, 113, 222, 0.4);
}

.espacio-btn--ghost {
    background: transparent;
    color: var(--text-color, #333);
    border: 1.5px solid rgba(0, 0, 0, 0.12);
}

.espacio-btn--ghost:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.2);
}

/* ── 12. TRANSPARENT HEADER (landing page override) ─────── */
.page-landing .header:not(.header-scrolled) {
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.page-landing .header:not(.header-scrolled) .header-nav-link {
    color: rgba(255, 255, 255, 0.8);
}

.page-landing .header:not(.header-scrolled) .header-nav-link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.page-landing .header:not(.header-scrolled) .nav-login-link {
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.35);
}

.page-landing .header:not(.header-scrolled) .nav-login-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.55);
}

.page-landing .header:not(.header-scrolled) .nav-avatar-btn {
    border-color: rgba(255, 255, 255, 0.35);
}

.page-landing .header:not(.header-scrolled) .hamburger-bar {
    background: var(--white);
}

/* ── 13. DESKTOP BREAKPOINT ──────────────────────────────── */
@media (min-width: 992px) {
    .header-inner {
        padding: 0 48px;
        height: 72px;
        /* Reaffirm true centering on desktop */
        grid-template-columns: 1fr auto 1fr;
    }

    .nav-hamburger {
        display: none !important;
    }

    .nav-mobile-overlay,
    .nav-mobile-panel {
        display: none !important;
    }

    .header-nav {
        gap: 2px;
    }
}

/* ── 14. MOBILE BREAKPOINT ───────────────────────────────── */
@media (max-width: 991px) {
    .header-inner {
        /* Switch to flex on mobile — grid loses its meaning when
           nav and auth are display:none, so hamburger ends up next
           to the logo instead of at the far right */
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 16px;
        height: 62px;
        /* reset grid columns */
        grid-template-columns: unset;
    }

    /* Hide desktop nav & auth */
    .header-nav,
    .header-auth {
        display: none !important;
    }

    /* Show hamburger — flex pushes it to the right automatically */
    .nav-hamburger {
        display: flex !important;
        margin-left: auto; /* extra safety — always to the right */
    }

    /* Show overlay when panel is open */
    .nav-mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .nav-mobile-overlay.is-open {
        pointer-events: auto;
    }
}

/* Active link highlight: keep supporting .navbar-nav .nav-link.active 
   used by highlightActiveLink() in load-components.js            */
.header-nav-link.active::after,
.header-nav-link.bold-active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: var(--purple, #B571DE);
    border-radius: 4px;
}
