﻿/* =========================================================
   PUBLIC HEADER — CENTER BRAND (MOBILE / TABLET)
   ========================================================= */

:root {
    --bg: #ffffff;
    --bg-soft: #f6f7f9;
    --text: #0f172a;
    --text-soft: #475569;
}

body[data-mode="dark"] {
    --bg: #0b0f14;
    --bg-soft: #121826;
    --text: #e5e7eb;
    --text-soft: #94a3b8;
}

body {
    background: var(--bg);
    color: var(--text);
    transition: background-color .35s ease, color .35s ease;
}


.public-header {
    position: sticky;
    top: 0;
    z-index: 120;
    backdrop-filter: blur(18px);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}

.public-header-inner {
    height: 72px;
    padding: 0 22px;
    display: grid;
    grid-template-columns: auto 1fr auto; /* left brand | nav | right actions */
    align-items: center;
    gap: 16px;
}

/* Left brand (desktop) */
.public-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -.2px;
    white-space: nowrap;
}

.public-logo {
    height: 42px;
    width: auto;
}

.public-brand-name {
    font-size: 15px;
}

/* Center nav (desktop) */
.public-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

    .public-nav a {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        border-radius: 16px;
        font-weight: 700;
        color: var(--text);
        text-decoration: none;
        transition: all .25s ease;
        user-select: none;
        cursor: pointer;
    }

        .public-nav a:hover {
            background: color-mix(in srgb, var(--primary) 14%, transparent);
        }

        .public-nav a.active {
            color: var(--primary);
            background: color-mix(in srgb, var(--primary) 14%, transparent);
            box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent);
        }

/* CTA */
.public-cta-link {
    background: var(--primary);
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 18px;
    font-weight: 900;
    box-shadow: 0 10px 26px color-mix(in srgb, var(--primary) 42%, transparent);
}

    .public-cta-link:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 32px color-mix(in srgb, var(--primary) 56%, transparent);
    }

/* Right actions (desktop) */
.public-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Center logo for tablet/mobile */
.public-brand-center {
    display: none;
    justify-content: center;
    align-items: center;
}

/* ================= HAMBURGER ================= */
.hamburger-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 14px;
    position: relative;
    align-items: center;
    justify-content: center;
}

    .hamburger-btn:hover {
        background: color-mix(in srgb, var(--primary) 12%, transparent);
    }

    .hamburger-btn span {
        position: absolute;
        left: 10px;
        right: 10px;
        height: 3px;
        background: var(--text);
        border-radius: 4px;
        transition: all .3s ease;
    }

        .hamburger-btn span:nth-child(1) {
            top: 14px;
        }

        .hamburger-btn span:nth-child(2) {
            top: 21px;
        }

        .hamburger-btn span:nth-child(3) {
            top: 28px;
        }

/* Tablet/mobile layout */
@media (max-width:1024px) {
    .public-header-inner {
        grid-template-columns: 1fr auto 1fr; /* left spacer | center logo | right hamburger */
        padding: 0 14px;
    }

    .public-brand {
        display: none;
    }

    .public-nav {
        display: none;
    }

    .public-brand-center {
        display: flex;
        animation: logoSlideFade .45s ease-out both;
        justify-self: center;
    }

    .public-right {
        display: flex;
        justify-self: end;
    }

    .hamburger-btn {
        display: flex;
    }
}

@keyframes logoSlideFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.public-brand-center {
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    line-height: 1.1;
}

/* Brand text wrapper */
.public-brand-center-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Main vendor name */
.public-brand-center-name {
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.2px;
    color: var(--text);
    white-space: nowrap;
}

/* Tagline */
.public-brand-center-tagline {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-soft);
    margin-top: 2px;
    white-space: nowrap;
    opacity: 0.85;
}

/* =========================================================
   HEADER GRID — MOBILE/TABLET LAYOUT
   ========================================================= */

@media (max-width:1024px) {

    .public-header-inner {
        grid-template-columns: 1fr auto 1fr;
    }

    /* Hide desktop brand + nav */
    .public-brand,
    .public-nav {
        display: none;
    }

    /* Show centered brand text */
    .public-brand-center {
        display: flex;
        justify-self: center;
        animation: fadeSlideDown .35s ease-out both;
    }

    /* Hamburger stays on RIGHT */
    .public-right {
        justify-self: end;
    }
}

/* Subtle entrance animation */
@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
    z-index: 998;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 290px;
    height: 100vh;
    background: var(--bg);
    box-shadow: -12px 0 30px rgba(0,0,0,.25);
    transform: translateX(100%);
    transition: transform .35s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

body.drawer-open .mobile-drawer {
    transform: translateX(0);
}

body.drawer-open .mobile-drawer-overlay {
    opacity: 1;
    pointer-events: auto;
}

.drawer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    font-weight: 900;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}

.drawer-logo {
    height: 34px;
    width: auto;
}

.drawer-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

    .drawer-close:hover {
        background: color-mix(in srgb, var(--primary) 12%, transparent);
    }

.drawer-nav {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .drawer-nav a {
        padding: 12px 14px;
        border-radius: 14px;
        font-weight: 800;
        color: var(--text);
        text-decoration: none;
        transition: background .25s ease;
        cursor: pointer;
    }

        .drawer-nav a:hover {
            background: color-mix(in srgb, var(--primary) 14%, transparent);
        }

@media (min-width:1025px) {
    .mobile-drawer,
    .mobile-drawer-overlay {
        display: none !important;
    }
}

.public-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--bg);
    border-top: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
    display: none;
    justify-content: space-around;
    align-items: center;
    z-index: 140;
}

    .public-mobile-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        font-weight: 800;
        color: var(--text);
        text-decoration: none;
        cursor: pointer;
    }

        .public-mobile-nav a.active {
            color: var(--primary);
            filter: drop-shadow(0 0 10px color-mix(in srgb, var(--primary) 45%, transparent));
        }

@media (max-width:1024px) {
    .public-mobile-nav {
        display: flex;
    }

    body.has-mobile-nav {
        padding-bottom: 80px;
    }
}

@media (min-width:1025px) {
    .public-mobile-nav {
        display: none !important;
    }

    body.has-mobile-nav {
        padding-bottom: 0;
    }
}

.public-footer {
    display: block;
    padding: 26px;
    text-align: center;
    font-size: 13px;
    color: var(--text-soft);
    border-top: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}

@media (max-width:1024px) {
    .public-footer {
        display: none;
    }
}

.theme-fab {
    position: fixed;
    right: 18px;
    bottom: 92px;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 160;
    background: var(--bg);
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}

.theme-fab-menu {
    position: fixed;
    right: 18px;
    bottom: 154px;
    width: 210px;
    border-radius: 18px;
    background: var(--bg);
    border: 1px solid color-mix(in srgb, var(--primary) 14%, transparent);
    box-shadow: 0 16px 44px rgba(0,0,0,.20);
    padding: 12px;
    z-index: 160;
    display: none;
}

    .theme-fab-menu.open {
        display: block;
    }

.theme-mode-btn {
    width: 100%;
    border: 0;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
}

.theme-colors {
    display: flex;
    gap: 10px;
    padding-top: 12px;
}

.theme-color-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid color-mix(in srgb, var(--text) 10%, transparent);
}

    .theme-color-btn[data-color="orange"] {
        background: #f97316;
    }

    .theme-color-btn[data-color="blue"] {
        background: #3b82f6;
    }

    .theme-color-btn[data-color="green"] {
        background: #22c55e;
    }

    .theme-color-btn[data-color="purple"] {
        background: #8b5cf6;
    }

    .theme-color-btn[data-color="red"] {
        background: #ef4444;
    }


/* =========================================================
   FIXED PUBLIC HEADER
   ========================================================= */

.public-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(18px);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}

/* =========================================================
   PAGE OFFSET — PREVENT CONTENT FROM HIDING UNDER HEADER
   ========================================================= */

body {
    padding-top: 72px; /* must match header height */
}

/* Tablet / mobile slight adjustment if needed */
@media (max-width:1024px) {
    body {
        padding-top: 72px;
    }
}

