/* ── Shared site header / nav ─────────────────────
   Loaded by all pages (shop + admin).
   Source of truth for header, nav links, profile
   dropdown, and Discord login button.
   ──────────────────────────────────────────────── */

/* ── Header / Nav ────────────────────────────────── */
.site-header {
    background: var(--bg-card, #161627);
    border-bottom: 1px solid var(--border, #2a2a44);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Admin pages use wider layout */
.header-inner.header-wide {
    max-width: 100%;
    padding: 0 24px;
}

.site-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold, #c4a35a);
    white-space: nowrap;
    text-decoration: none;
}

.site-title:hover {
    text-decoration: none;
    opacity: 0.85;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex: 1;
}

.nav-links a {
    padding: 6px 14px;
    border-radius: var(--radius, 8px);
    color: var(--text-dim, #7a7a9a);
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--bg-hover, #1e1e35);
    color: var(--text, #d4d4e0);
    text-decoration: none;
}

/* ── Profile menu ───────────────────────────────── */
.profile-menu {
    position: relative;
    flex-shrink: 0;
    margin-left: auto;
}

.profile-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border, #2a2a44);
    background: var(--bg, #0e0e1a);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
}

.profile-btn:hover {
    border-color: var(--gold-dim, #8a7340);
}

.profile-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-dim, #7a7a9a);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card, #161627);
    border: 1px solid var(--border, #2a2a44);
    border-radius: var(--radius, 8px);
    padding: 16px;
    min-width: 220px;
    z-index: 150;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border, #2a2a44);
}

.profile-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.profile-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text, #d4d4e0);
}

.profile-balance {
    font-size: 13px;
    color: var(--gold, #c4a35a);
    font-weight: 600;
    margin-top: 2px;
}

.btn-logout {
    background: none;
    border: 1px solid var(--border, #2a2a44);
    color: var(--text-dim, #7a7a9a);
    padding: 6px 0;
    border-radius: var(--radius, 8px);
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    transition: border-color 0.15s, color 0.15s;
}

.btn-logout:hover {
    border-color: var(--red, #ED4245);
    color: var(--red, #ED4245);
}

/* ── Discord login button ───────────────────────── */
.btn-discord {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent, #5865F2);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius, 8px);
    font-size: 15px;
    font-weight: 600;
    transition: background 0.15s;
}

.btn-discord:hover {
    background: var(--accent-hover, #4752C4);
    text-decoration: none;
}

/* ── Login prompt (shared by shop + admin) ─────── */
.login-prompt {
    text-align: center;
    padding: 80px 20px;
}

.login-prompt p {
    color: var(--text-dim, #7a7a9a);
    margin-bottom: 20px;
    font-size: 16px;
}

/* ── Hamburger button (admin mobile only) ──────── */
.hamburger-btn {
    display: none;          /* hidden on desktop */
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-dim, #7a7a9a);
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    color: var(--text, #d4d4e0);
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .hamburger-btn { display: flex; }

    /* Collapse the main site nav into a dropdown panel below the header.
       Hidden by default; .mobile-open (toggled by the hamburger) reveals it. */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--bg-card, #161627);
        border-bottom: 1px solid var(--border, #2a2a44);
        padding: 6px 0;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
    .nav-links.mobile-open {
        display: flex;
    }
    .nav-links a {
        padding: 14px 24px;
        border-radius: 0;
        font-size: 15px;
    }
    .nav-links a:hover,
    .nav-links a.active {
        background: var(--bg-hover, #1e1e35);
        color: var(--gold, #c4a35a);
    }
}

/* ── Mobile sidebar overlay ────────────────────── */
.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
}

/* ── Mobile sidebar slide-out ──────────────────── */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--bg-card, #161627);
    border-right: 1px solid var(--border, #2a2a44);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px 16px;
    overflow-y: auto;
}

.mobile-sidebar-brand {
    padding: 16px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border, #2a2a44);
}

.mobile-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius, 8px);
    color: var(--text-dim, #7a7a9a);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.mobile-sidebar a:hover {
    background: var(--bg-hover, #1e1e35);
    color: var(--text, #d4d4e0);
    text-decoration: none;
}

.mobile-sidebar a.active {
    background: var(--bg-hover, #1e1e35);
    color: var(--text-bright, #eeeef4);
}

.mobile-sidebar a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}

.mobile-sidebar a.active svg {
    opacity: 1;
}

/* slide-in / slide-out transitions */
.mobile-sidebar-enter {
    transition: transform 0.2s ease-out;
}
.mobile-sidebar-enter-start {
    transform: translateX(-100%);
}
.mobile-sidebar-enter-end {
    transform: translateX(0);
}
.mobile-sidebar-leave {
    transition: transform 0.15s ease-in;
}
.mobile-sidebar-leave-start {
    transform: translateX(0);
}
.mobile-sidebar-leave-end {
    transform: translateX(-100%);
}
