/* ===== RESPONSIVE VARIABLES ===== */
:root {
    /* Responsive Spacing Scale (Desktop) */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Responsive Font Sizes (Desktop) */
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    --font-4xl: 2.25rem;
    --font-5xl: 3rem;
}

/* Mobile (375px - 480px): Apply reduced spacing */
@media (max-width: 480px) {
    :root {
        --spacing-2xl: 1.5rem;
        --spacing-3xl: 2rem;
        --font-4xl: 1.75rem;
        --font-5xl: 2.25rem;
    }
}

/* Tablet (481px - 768px): Intermediate spacing */
@media (min-width: 481px) and (max-width: 768px) {
    :root {
        --spacing-2xl: 2rem;
        --spacing-3xl: 2.5rem;
        --font-4xl: 2rem;
        --font-5xl: 2.5rem;
    }
}

/* Desktop (769px+): Full spacing */
@media (min-width: 769px) {
    :root {
        --spacing-2xl: 3rem;
        --spacing-3xl: 4rem;
        --font-4xl: 2.25rem;
        --font-5xl: 3rem;
    }
}

/* Same page-long gradient as the home page (fixed); visible when body is transparent */
html {
    min-height: 100%;
    background: linear-gradient(
        180deg,
        #ffffff 0%,
        #ffffff 12%,
        #f8fbfe 20%,
        #eef5fc 32%,
        #e2eef9 42%,
        #d2e5f5 50%,
        #c5daf0 56%,
        #b8d2eb 62%,
        #aec9e6 68%,
        #b6cfe9 74%,
        #c9dcf0 80%,
        #dce8f5 86%,
        #edf3fa 92%,
        #f7f9fc 96%,
        #ffffff 100%
    );
    background-attachment: fixed;
    background-size: 100% 100%;
}

body.white-bg,
body.home-page {
    background: transparent !important;
}

body.auth-body {
    background: transparent !important;
}

/* Dashboard / checkout / admin: solid surface over the html gradient */
body.blue-bg {
    background-color: #f1f5f9;
    min-height: 100%;
}

/* ===== PERMANENT SIDEBAR LAYOUT ===== */
body {
    margin-left: 280px !important;
}

/* Hidden elements (old navbar) */
.navbar { display: none; }

/* Hamburger button — hidden on desktop, shown on mobile */
.hamburger-btn {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 52px;
    height: 52px;
    z-index: 1100;
    background: #ffffff;
    border: none;
    border-radius: 0 0 12px 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.08);
    font-size: 1.5rem;
    color: #0066cc;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease;
}
.hamburger-btn:active {
    background: #eff6ff;
}

/* Panel overlay — hidden on desktop, available on mobile */
.panel-overlay {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

/* ===== TABLET: still permanent sidebar but narrower ===== */
@media (max-width: 768px) {
    body { margin-left: 220px !important; }
}

/* ===== MOBILE: hamburger + overlay sidebar ===== */
@media (max-width: 768px) {
    body {
        margin-left: 0 !important;
        padding-top: 52px;
    }

    .hamburger-btn {
        display: flex !important;
    }

    .side-panel {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px;
        z-index: 1050;
    }

    .side-panel.open {
        transform: translateX(0);
    }

    .panel-overlay {
        display: block !important;
        pointer-events: none;
        opacity: 0;
    }

    .panel-overlay.active {
        pointer-events: auto;
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .side-panel {
        width: 260px;
    }
}

/* ===== SIDEBAR ===== */
.side-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 40%, #f1f5f9 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.06);
    border-right: 1px solid #e2e8f0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    color: #1e293b;
}

.side-panel::-webkit-scrollbar { display: none; }

/* ===== HEADER ===== */
.panel-header {
    padding: 0.75rem 1.25rem 0.75rem;
    border-bottom: 1px solid #1a4a8a;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0a2a5e 0%, #0f3d7a 100%);
    position: relative;
}

/* Subtle glow behind logo */
.panel-header::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(0, 102, 204, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.panel-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.panel-logo-link:hover {
    transform: scale(1.03);
    filter: brightness(1.1);
}

.panel-logo {
    height: 55px;
    width: auto;
}

.panel-logo.panel-logo--hero {
    height: auto;
    max-height: 64px;
    width: 100%;
    max-width: 220px;
    object-fit: contain;
}

.panel-tagline {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* ===== CONTENT ===== */
.panel-content {
    flex: 1;
    padding: 0.5rem 0 1rem;
    overflow-y: auto;
    scrollbar-width: none;
}

.panel-content::-webkit-scrollbar { display: none; }

/* ===== SECTIONS ===== */
.panel-section {
    padding: 0 0.75rem;
    margin-bottom: 0.25rem;
}

.panel-section--cart {
    margin-bottom: 0.5rem;
}

/* Section titles with decorative lines */
.panel-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    padding: 0.75rem 0.5rem 0.25rem;
}

.section-title-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.section-title-text {
    white-space: nowrap;
}

/* Divider between sections */
.panel-divider {
    height: 1px;
    margin: 0.25rem 1.5rem 0.5rem;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* ===== NAV ITEMS ===== */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-menu a,
.nav-menu a.nav-item {
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    padding: 0.7rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 10px;
    border-left: none;
    margin-bottom: 0;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Hover glow effect */
.nav-menu a::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.06), rgba(59, 130, 246, 0.03));
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.nav-menu a:hover {
    color: #0066cc;
    background: #eff6ff;
    border-left-color: transparent;
    transform: translateX(3px);
}

.nav-menu a:hover::before {
    opacity: 1;
}

.nav-menu a:hover .nav-icon {
    color: #0066cc;
    filter: drop-shadow(0 0 4px rgba(0, 102, 204, 0.2));
}

/* Active state */
.nav-menu a.active {
    color: #0066cc;
    background: #eff6ff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(0, 102, 204, 0.12),
                0 1px 4px rgba(0, 102, 204, 0.08);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #0066cc, #3b82f6);
    box-shadow: 0 0 6px rgba(0, 102, 204, 0.3);
}

.nav-menu a.active .nav-icon {
    color: #0066cc;
}

.nav-menu a:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Nav icons */
.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #94a3b8;
    transition: color 0.25s ease, filter 0.25s ease;
}

.nav-label {
    flex: 1;
}

/* ===== CART BUTTON ===== */
.cart-icon-panel {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.75rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #475569;
    font-weight: 600;
    text-align: left;
    font-family: inherit;
    line-height: 1.3;
    -webkit-tap-highlight-color: transparent;
}

.cart-icon-panel:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
    transform: translateY(-1px);
}

.cart-icon-panel:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.cart-icon-wrapper {
    position: relative;
    flex-shrink: 0;
}

.cart-svg-icon {
    width: 20px;
    height: 20px;
    color: #94a3b8;
    transition: color 0.25s ease;
}

.cart-icon-panel:hover .cart-svg-icon {
    color: #0066cc;
}

.cart-icon-panel__label {
    flex: 1;
    min-width: 0;
}

.cart-chevron {
    width: 16px;
    height: 16px;
    color: #cbd5e1;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.cart-icon-panel:hover .cart-chevron {
    color: #0066cc;
    transform: translateX(2px);
}

/* Cart badge */
.panel-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4),
                0 0 0 2px #ffffff;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4), 0 0 0 2px #ffffff; }
    50% { box-shadow: 0 2px 10px rgba(239, 68, 68, 0.6), 0 0 0 2px #ffffff; }
}

/* ===== FOOTER ===== */
.panel-footer {
    margin-top: auto;
    padding: 1rem 0.75rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* User info row */
.panel-user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.5rem;
    color: #64748b;
    font-size: 0.8rem;
}

.panel-user-icon {
    width: 18px;
    height: 18px;
    color: #94a3b8;
}

.panel-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Footer buttons */
.panel-footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    border: 1px solid transparent;
}

.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.panel-footer-btn--primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.panel-footer-btn--primary:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: #fff;
}

.panel-footer-btn--secondary {
    background: #ffffff;
    color: #475569;
    border-color: #e2e8f0;
}

.panel-footer-btn--secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
}

.panel-footer-btn--ghost {
    background: transparent;
    color: #94a3b8;
    border: none;
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.panel-footer-btn--ghost:hover {
    color: #0066cc;
    background: #eff6ff;
}

.panel-footer-btn:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* ===== RESPONSIVE REFINEMENTS ===== */
@media (max-width: 480px) {
    .panel-tagline { display: none; }
    .nav-menu a { font-size: 0.85rem; padding: 0.65rem 0.7rem; }
    .nav-icon { width: 18px; height: 18px; }
    .panel-footer-btn { padding: 0.85rem 1rem; font-size: 0.9rem; }
    .mini-basket-container { width: 85vw; max-width: 320px; }
}

/* Mini Basket — same slot as side panel (left), not a right-edge drawer */
.mini-basket-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    z-index: 2000;
}

.mini-basket-container {
    background: white;
    width: 70vw;
    max-width: 280px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    animation: miniBasketPanelIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

@keyframes miniBasketPanelIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.mini-basket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.mini-basket-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
    font-weight: 700;
}

.mini-basket-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mini-basket-close:hover {
    color: #333;
}

.mini-basket-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.basket-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.basket-item:last-child {
    border-bottom: none;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.item-price {
    color: #0066cc;
    font-weight: 600;
}

.item-quantity {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.qty-btn:hover {
    border-color: #0066cc;
    color: #0066cc;
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: 500;
}

.remove-item {
    color: #e63946;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    padding-left: 1rem;
}

.remove-item:hover {
    text-decoration: underline;
}

.mini-basket-summary {
    padding: 1.5rem;
    border-top: 2px solid #f0f0f0;
    background: #f9f9f9;
    flex-shrink: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #666;
}

.summary-row.total {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    border-top: 1px solid #ddd;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.mini-basket-actions {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-shrink: 0;
}

.btn-checkout {
    width: 100%;
    padding: 1rem;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-checkout:hover {
    background: #004499;
}

.btn-continue-shopping {
    width: 100%;
    padding: 1rem;
    background: white;
    color: #0066cc;
    border: 2px solid #0066cc;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-continue-shopping:hover {
    background: #f0f8ff;
}

/* ===== Public site: same hero lockup as home (hero-logo.svg) ===== */
.site-hero-brand {
    background: transparent;
    color: #333;
    padding: 4.75rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
}

.site-hero-brand-inner {
    position: relative;
    text-align: center;
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Match home hero: soft radial behind logo for contrast */
.site-hero-brand-inner::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(104%, 760px);
    aspect-ratio: 866 / 532;
    max-height: min(52vh, 520px);
    background: radial-gradient(
        ellipse 78% 82% at 50% 50%,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(245, 249, 252, 0.35) 35%,
        rgba(220, 235, 248, 0.2) 55%,
        rgba(255, 255, 255, 0) 78%
    );
    z-index: 0;
    pointer-events: none;
}

.site-hero-brand .hero-logo,
.site-hero-brand-inner .hero-logo {
    position: relative;
    z-index: 1;
    display: block;
    width: auto;
    max-width: min(100%, 720px);
    height: auto;
    max-height: min(50vh, 500px);
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 40, 90, 0.2)) drop-shadow(0 12px 28px rgba(0, 70, 140, 0.28));
}

@media (max-width: 480px) {
    .site-hero-brand {
        padding: 4.25rem 1rem 1rem;
    }

    .site-hero-brand .hero-logo,
    .site-hero-brand-inner .hero-logo {
        max-height: min(42vh, 380px);
    }
}
