:root {
    --black: #020617;
    --dark: #07111f;
    --panel: rgba(15, 23, 42, 0.84);
    --panel-solid: #0f172a;
    --blue: #2563eb;
    --blue-light: #60a5fa;
    --blue-soft: rgba(37, 99, 235, 0.16);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --white: #ffffff;
    --border: rgba(148, 163, 184, 0.18);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.22), transparent 25%),
        radial-gradient(circle at 85% 20%, rgba(96, 165, 250, 0.12), transparent 28%),
        linear-gradient(135deg, #020617 0%, #07111f 52%, #0b1324 100%);
    line-height: 1.6;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(2, 6, 23, 0.86);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.header-content {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--white);
    background: linear-gradient(145deg, #000000 0%, #0f172a 45%, #2563eb 100%);
    border: 1px solid rgba(96, 165, 250, 0.35);
    box-shadow: 0 0 22px rgba(37, 99, 235, 0.28);
}

.brand-name {
    color: var(--white);
    font-weight: 900;
    font-size: 1.45rem;
    letter-spacing: -0.7px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.94rem;
}

.main-nav a:hover {
    color: var(--blue-light);
}

.header-actions,
.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: var(--white);
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 55%, #60a5fa 100%);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.btn-ghost {
    color: var(--text);
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.btn-outline {
    color: var(--white);
    border-color: rgba(96, 165, 250, 0.42);
    background: rgba(37, 99, 235, 0.08);
}

.btn-large {
    min-height: 50px;
    padding-inline: 24px;
}

.hero {
    position: relative;
    min-height: 680px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(96, 165, 250, 0.12);
}

.hero-slider,
.hero-slide,
.hero-overlay {
    position: absolute;
    inset: 0;
}

.hero-slide {
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.04);
    animation: heroFade 18s infinite;
}

.slide-one {
    background-image: url("https://images.unsplash.com/photo-1517836357463-d25dfeac3438?auto=format&fit=crop&w=1800&q=80");
}

.slide-two {
    background-image: url("https://images.unsplash.com/photo-1502224562085-639556652f33?auto=format&fit=crop&w=1800&q=80");
    animation-delay: 6s;
}

.slide-three {
    background-image: url("https://images.unsplash.com/photo-1541625602330-2277a4c46182?auto=format&fit=crop&w=1800&q=80");
    animation-delay: 12s;
}

.hero-overlay {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.72) 48%, rgba(2, 6, 23, 0.36) 100%),
        repeating-linear-gradient(0deg, rgba(96, 165, 250, 0.06) 0 1px, transparent 1px 34px),
        repeating-linear-gradient(90deg, rgba(96, 165, 250, 0.05) 0 1px, transparent 1px 34px);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    padding: 80px 0;
}

.eyebrow,
.section-heading span,
.product-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.hero h1 {
    margin-top: 18px;
    max-width: 760px;
    color: var(--white);
    font-size: clamp(2.6rem, 7vw, 5.5rem);
    line-height: 0.94;
    letter-spacing: -3px;
}

.hero p {
    max-width: 620px;
    margin: 22px 0 30px;
    color: #cbd5e1;
    font-size: 1.12rem;
}

.search-section {
    margin-top: -46px;
    position: relative;
    z-index: 5;
}

.search-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(96, 165, 250, 0.18);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.search-panel h2 {
    color: var(--white);
    font-size: 1.25rem;
}

.search-panel p {
    color: var(--muted);
    font-size: 0.95rem;
}

.search-form {
    display: flex;
    gap: 12px;
    width: min(520px, 100%);
}

.search-form input {
    flex: 1;
    min-width: 160px;
    padding: 13px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    outline: none;
}

.search-form input:focus {
    border-color: rgba(96, 165, 250, 0.72);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.section {
    padding: 84px 0 0;
}

.section-heading {
    margin-bottom: 28px;
}

.section-heading h2 {
    margin-top: 12px;
    color: var(--white);
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1;
    letter-spacing: -1.5px;
}

.category-grid,
.product-grid,
.stats-grid {
    display: grid;
    gap: 22px;
}

.category-grid {
    grid-template-columns: repeat(3, 1fr);
}

.product-grid {
    grid-template-columns: repeat(4, 1fr);
}

.category-card,
.product-card,
.stat-card {
    overflow: hidden;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.category-card:hover,
.product-card:hover,
.stat-card:hover {
    transform: translateY(-6px);
    border-color: rgba(96, 165, 250, 0.36);
    box-shadow: 0 22px 48px rgba(37, 99, 235, 0.16);
}

.category-card img,
.product-card img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.05);
}

.category-card-content,
.product-info {
    padding: 22px;
}

.category-card h3,
.product-card h3 {
    color: var(--white);
    font-size: 1.18rem;
    margin-bottom: 8px;
}

.category-card p,
.product-card p {
    color: var(--muted);
    font-size: 0.94rem;
}

.product-info {
    display: flex;
    flex-direction: column;
    min-height: 260px;
}

.product-tag {
    margin-bottom: 14px;
    padding: 6px 10px;
    font-size: 0.68rem;
}

.product-price {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
}

.product-price strong {
    color: var(--blue-light);
    font-size: 1.35rem;
}

.product-price span {
    color: #86efac;
    font-size: 0.88rem;
    font-weight: 700;
}

.stats-dashboard {
    padding-bottom: 84px;
}

.stats-grid {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    padding: 26px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.84)),
        rgba(15, 23, 42, 0.78);
}

.stat-card strong {
    display: block;
    color: var(--white);
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-card span {
    color: var(--muted);
    font-weight: 700;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.92);
    padding: 42px 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
}

.footer-brand {
    margin-bottom: 16px;
}

.site-footer p,
.site-footer a {
    color: var(--muted);
    font-size: 0.94rem;
}

.site-footer h3 {
    color: var(--white);
    margin-bottom: 12px;
}

.site-footer a {
    display: block;
    margin-bottom: 8px;
}

.site-footer a:hover {
    color: var(--blue-light);
}

@keyframes heroFade {
    0% {
        opacity: 0;
        transform: scale(1.06);
    }

    8% {
        opacity: 1;
    }

    33% {
        opacity: 1;
        transform: scale(1);
    }

    41% {
        opacity: 0;
    }

    100% {
        opacity: 0;
        transform: scale(1.06);
    }
}

@media (max-width: 980px) {
    .header-content {
        flex-wrap: wrap;
        justify-content: center;
        padding: 14px 0;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero {
        min-height: 620px;
    }

    .search-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form {
        width: 100%;
    }

    .category-grid,
    .product-grid,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .container {
        width: min(100% - 28px, 1180px);
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .hero {
        min-height: 620px;
    }

    .hero h1 {
        letter-spacing: -1.8px;
    }

    .hero-actions,
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .category-grid,
    .product-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Scroll restore and item highlight effects */

.page-transition {
    opacity: 0.9;
    transition: opacity 0.18s ease;
}

.page-restoring-scroll {
    scroll-behavior: smooth;
}

.product-card.item-highlight,
.cart-item.item-highlight {
    animation: itemHighlight 0.9s ease;
}

@keyframes itemHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }

    35% {
        transform: scale(1.015);
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
}

/* Authenticated header buttons */

.header-actions .user-pill,
.header-actions .logout-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.header-actions .user-pill:hover,
.header-actions .logout-pill:hover {
    transform: translateY(-2px);
}

.header-actions .user-pill {
    color: #ffffff;
    border-color: rgba(96, 165, 250, 0.38);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(37, 99, 235, 0.34));
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.header-actions .user-pill:hover {
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.32);
}

.header-actions .logout-pill {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.28);
}

.header-actions .logout-pill:hover {
    color: #ffffff;
    background: rgba(185, 28, 28, 0.42);
    border-color: rgba(248, 113, 113, 0.55);
}