:root {
    --diagnostic-check: "active";
    /* Premium Color Palette - Refined for High-End Feel */
    --primary-blue: #2563eb;
    --primary-green: #10b981;
    --primary-orange: #ea580c;
    --primary-purple: #8b5cf6;
    --primary-rose: #f43f5e;

    /* Default Primary (Blue) */
    --primary: var(--primary-blue);
    --primary-dark: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);

    --secondary: #64748b;
    --accent: #f59e0b;
    --bg: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text: #0f172a;
    --text-muted: #64748b;
    --border: rgba(226, 232, 240, 0.8);
    --input-bg: #ffffff;
    --success-bg: #f0fdf4;
    --success-text: #166534;
    --error-bg: #fef2f2;
    --error-text: #991b1b;
    --warning-bg: #fffbeb;
    --warning-text: #92400e;

    /* Premium Geometry */
    --radius: 20px;
    --radius-sm: 10px;
    --radius-pill: 500px;
    --radius-lg: 32px;

    /* Multi-layered Shadows for Sophisticated Depth */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.04),
        0 4px 6px -4px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    --shadow-lg:
        0 20px 25px -5px rgba(37, 99, 235, 0.05),
        0 8px 10px -6px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    --shadow-premium:
        0 25px 50px -12px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --blur: blur(12px);

    /* Grid & Glow - Enhanced for Dynamic Interaction */
    --grid-color: rgba(0, 0, 0, 0.03);
    --grid-size: 40px;
    --glow-opacity: 0.4;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* Dynamic Accent Overrides */
[data-accent="green"] {
    --primary: var(--primary-green);
    --primary-dark: #059669;
    --primary-light: rgba(16, 185, 129, 0.1);
}

[data-accent="orange"] {
    --primary: var(--primary-orange);
    --primary-dark: #c2410c;
    --primary-light: rgba(234, 88, 12, 0.1);
}

[data-accent="purple"] {
    --primary: var(--primary-purple);
    --primary-dark: #7c3aed;
    --primary-light: rgba(139, 92, 246, 0.1);
}

[data-accent="rose"] {
    --primary: var(--primary-rose);
    --primary-dark: #e11d48;
    --primary-light: rgba(244, 63, 94, 0.1);
}

[data-theme="dark"] {
    --bg: #05070a;
    --card-bg: rgba(15, 23, 42, 0.6);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(255, 255, 255, 0.03);
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --grid-color: rgba(255, 255, 255, 0.03);
    --glow-opacity: 0.25;
    --success-bg: rgba(22, 101, 52, 0.2);
    --success-text: #4ade80;
    --error-bg: rgba(153, 27, 27, 0.2);
    --error-text: #f87171;
    --warning-bg: rgba(146, 64, 14, 0.2);
    --warning-text: #fbbf24;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 37, 99, 235), 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(var(--primary-rgb, 37, 99, 235), 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 37, 99, 235), 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    /* Mouse-following Radial Glow */
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), var(--primary-light) 0%, transparent 40%);
    opacity: var(--glow-opacity);
    pointer-events: none;
    z-index: -1;
    filter: blur(80px);
    transition: background 0.15s ease-out;
    /* Smooth follow */
}

h1,
h2,
h3,
h4,
.logo {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Glass Header */
/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
    border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

header {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
    /* Fixed height for consistency */
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

#logo-light {
    height: 45px !important;
    width: auto;
    display: block;
    mix-blend-mode: multiply;
    transition: transform 0.3s ease;
}

#logo-dark {
    height: 45px !important;
    width: auto;
    display: block;
    mix-blend-mode: screen;
    transition: transform 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.02);
}

@media (max-width: 768px) {

    #logo-light,
    #logo-dark {
        height: 38px;
    }
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 0.5rem;
}

/* Hero Section - Refined for High-End Feel */
.hero {
    padding: 8rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius-pill);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero h1 {
    font-size: clamp(3.5rem, 8vw, 5.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: var(--text);
    letter-spacing: -0.04em;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 3rem;
    font-weight: 400;
}

/* Products Grid */
.section-title {
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.product-card {
    background: var(--card-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow);
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-premium);
    border-color: var(--primary);
}

.dark-toggle {
    background: var(--primary-light);
    border: none;
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-toggle:hover {
    background: var(--primary);
    color: white;
    transform: rotate(15deg);
}

[data-theme="dark"] .sun-icon {
    display: block !important;
}

[data-theme="dark"] .moon-icon {
    display: none !important;
}

[data-theme="light"] .sun-icon {
    display: none !important;
}

[data-theme="light"] .moon-icon {
    display: block !important;
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f1f5f9;
    border-radius: calc(var(--radius) - 4px);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.product-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.product-info p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price {
    font-weight: 700;
    font-size: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow:
        0 4px 14px 0 rgba(var(--primary-rgb, 37, 99, 235), 0.39),
        0 0 20px 2px var(--primary-light);
    /* Premium Outer Glow */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb, 37, 99, 235), 0.23);
}

.btn-primary i {
    transition: transform 0.2s ease;
}

.btn-primary:hover i {
    transform: translateX(4px);
}

.btn-outline {
    border: 1.5px solid var(--border);
    color: var(--text);
    background: var(--card-bg);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Cart Badge */
.cart-icon {
    position: relative;
    font-size: 1.25rem;
}

.cart-icon .badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
    animation: pulse 2s infinite ease-in-out;
}

/* Footer */
footer {
    background: #1e293b;
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
}

.footer-col ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #334155;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
}

/* Utility */
.text-center {
    text-align: center;
}

/* Checkout & Cart Layout */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: start;
}

.checkout-grid {
    grid-template-columns: 1fr 400px;
}

.card-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cart-table th,
.cart-table td {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cart-table thead {
    background: var(--bg);
}

@media (max-width: 1024px) {

    .layout-grid,
    .checkout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }

    .hero {
        padding: 5rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Accent Selector */
.accent-picker {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-right: 1.5rem;
}

.accent-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    position: relative;
    box-shadow: 0 0 0 1px var(--border);
}

.accent-btn:hover {
    transform: scale(1.15);
}

.accent-btn.active {
    border-color: var(--text);
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

.accent-btn[data-color="blue"] {
    background: var(--primary-blue);
}

.accent-btn[data-color="green"] {
    background: var(--primary-green);
}

.accent-btn[data-color="orange"] {
    background: var(--primary-orange);
}

.accent-btn[data-color="purple"] {
    background: var(--primary-purple);
}

.accent-btn[data-color="rose"] {
    background: var(--primary-rose);
}

@media (max-width: 1024px) {
    .accent-picker {
        margin-right: 0;
        margin-bottom: 1rem;
        justify-content: center;
    }
}

/* Admin Specific Utilities */
.admin-page {
    padding-top: 2rem;
    padding-bottom: 5rem;
}

.admin-header {
    background: var(--card-bg);
    border: 1px solid var(--border);
    margin-bottom: 3rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem;
}

.admin-nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0 2.5rem 1.5rem;
    scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar {
    display: none;
}

.admin-nav a {
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    transition: all 0.2s;
    font-size: 0.9375rem;
}

.admin-nav a:hover {
    color: var(--text);
    background: var(--bg);
}

.admin-nav a.active {
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
}

.admin-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.admin-table-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 2rem;
    box-shadow: var(--shadow-sm);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: rgba(0, 0, 0, 0.02);
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.stat-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.badge-status {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef9c3;
    color: #854d0e;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}