@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    /* DealDash Color System */
    --bg: #F6F8FB;
    /* New Dashboard BG */
    --surface: #FFFFFF;
    --muted-bg: #F7FAFF;
    --border: #E9EDF5;
    --text: #0F172A;
    --text-muted: #64748B;
    --blue: #2563EB;
    /* Dashboard Accent */
    --blue-hover: #1D4ED8;
    --yellow: #FACC15;
    --yellow-hover: #EAB308;
    --success: #16A34A;
    --danger: #DC2626;

    /* Dashboard Pastels */
    --kpi-pink: #FFE4E6;
    --kpi-yellow: #FEF3C7;
    --kpi-green: #DCFCE7;
    --kpi-purple: #EDE9FE;

    /* Shadows - Soft and minimal */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 8px 24px rgba(149, 157, 165, 0.08);

    /* Missing Tokens */
    --bg-glass: rgba(255, 255, 255, 0.9);
    --bg-deep: #F1F5F9;
    --border-soft: #F1F5F9;
    --accent-glow: rgba(37, 99, 235, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

/* Layout Utilities */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-wide {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    font-size: 1rem;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button - Blue */
.btn-primary {
    background: var(--blue);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--blue-hover);
    box-shadow: var(--shadow);
}

/* Deal Button - Yellow */
.btn-deal {
    background: var(--yellow);
    color: var(--text);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.btn-deal:hover:not(:disabled) {
    background: var(--yellow-hover);
    box-shadow: var(--shadow);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--blue);
    border: 2px solid var(--blue);
}

.btn-outline:hover:not(:disabled) {
    background: var(--blue);
    color: #FFFFFF;
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--muted-bg);
    color: var(--text);
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: 1.25rem;
}

/* Card System */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-flat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

/* Badge System */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-live {
    background: #DCFCE7;
    color: var(--success);
}

.badge-featured {
    background: #DBEAFE;
    color: var(--blue);
}

.badge-ended {
    background: #F3F4F6;
    color: var(--text-muted);
}

/* Timer Pill */
.timer-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--muted-bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.timer-pill.urgent {
    background: var(--yellow);
    color: var(--text);
    animation: pulse 1s infinite;
}

/* Price Display */
.price-display {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    line-height: 1;
    color: var(--text);
}

.price-lg {
    font-size: 3rem;
}

.price-xl {
    font-size: 4rem;
}

.price-retail {
    text-decoration: line-through;
    color: var(--text-muted);
    font-weight: 600;
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-blue {
    color: var(--blue);
}

.text-yellow {
    color: var(--yellow);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.font-bold {
    font-weight: 700;
}

.font-black {
    font-weight: 900;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

/* Spacing Utilities */
.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mt-12 {
    margin-top: 3rem;
}

.mt-16 {
    margin-top: 4rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-12 {
    margin-bottom: 3rem;
}

.mb-16 {
    margin-bottom: 4rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.py-16 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.py-24 {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

/* Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }
}

/* ==========================================================================
   APP SHELL & MOBILE OPTIMIZATION - FORCE OVERRIDE
   ========================================================================== */

.bv-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.bv-header {
    height: 80px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    /* Increased Z-Index */
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.header-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    /* Ensure logo and actions are spaced */
}

/* Desktop Nav Group Container */
.desktop-nav-group {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    z-index: 2001;
    /* Ensure logo is always clickable */
}

.logo-icon {
    background: var(--accent-blue);
    color: #fff;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: -0.5px;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--accent-blue);
}

/* Nav Links */
.nav-links {
    display: flex;
    gap: 2.5rem;
    margin-left: 3rem;
    margin-right: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-blue);
}

.header-actions {
    display: flex;
    align-items: center;
}

.mobile-header-actions {
    display: none;
    /* Hidden by default */
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-deep);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: var(--border-color);
    transform: rotate(15deg);
}

/* User Controls */
.user-control {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--bg-deep);
    padding: 0.35rem;
    padding-left: 1rem;
    border-radius: 100px;
}

.credits-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    background: var(--bg-surface);
    border-radius: 100px;
    box-shadow: var(--shadow-sm);
}

.credits-pill .count {
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.credits-pill .unit {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.avatar {
    width: 34px;
    height: 34px;
    background: var(--accent-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.icon-only {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 1rem !important;
}

/* Main Content */
.bv-main {
    flex: 1;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
}

/* Footer Redesign */
.bv-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 5rem 0 3rem 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 5rem;
    margin-bottom: 4rem;
}

.brand-desc {
    color: var(--text-secondary);
    margin: 1.5rem 0;
    max-width: 350px;
    font-size: 0.95rem;
}

.trust-badges {
    display: flex;
    gap: 1.5rem;
    color: var(--success);
    font-weight: 700;
    font-size: 0.85rem;
}

.footer-nav-groups {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-group h5 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-blue);
}

.footer-bottom {
    border-top: 1px solid var(--border-soft);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dropdowns */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: var(--bg-surface);
    min-width: 200px;
    box-shadow: var(--shadow-xl);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 0.6rem 0;
    top: 100%;
    left: 0;
    z-index: 1001;
}

.dropdown-content a {
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
}

.dropdown-content a:hover {
    background: var(--border-soft);
    color: var(--accent-blue);
}

.nav-dropdown:hover .dropdown-content {
    display: block;
    animation: slideUp 0.2s ease-out;
}

/* Mobile Drawer Customization */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background: var(--bg-surface);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2rem;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.1);
}

.mobile-drawer.open {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.close-btn {
    background: var(--bg-deep);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.mobile-nav a.active {
    background: var(--accent-glow);
    color: var(--accent-blue);
}

.mobile-sub-nav {
    padding-left: 2.5rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-sub-nav a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.5rem;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1999;
    display: none;
}

.drawer-overlay.open {
    display: block;
}

/* Bottom Navigation - The Critical Part */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0;
    z-index: 9999;
    /* Max Z-Index */
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    gap: 0.35rem;
    padding: 0.5rem;
}

.bottom-nav-item i {
    font-size: 1.35rem;
}

.bottom-nav-item.active {
    color: var(--accent-blue);
}

/* ==========================================================================
   MOBILE MEDIA QUERY
   ========================================================================== */
@media (max-width: 1024px) {
    .bv-header {
        padding: 0 1rem;
    }

    .desktop-nav-group {
        display: none !important;
    }

    /* Hide entire desktop block */
    .mobile-header-actions {
        display: flex !important;
        margin-left: auto;
    }

    .bv-main {
        padding-bottom: 90px;
    }

    /* Force Bottom Nav Visibility */
    .bottom-nav {
        display: flex !important;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-top: 1px solid var(--border-color);
        padding: 0.5rem 0;
        z-index: 1000;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer-nav-groups {
        grid-template-columns: 1fr 1fr;
    }
}