:root {
    --bg-main: #050505;
    --bg-secondary: #0a0a0a;
    --card: #111111;
    --white: #ffffff;
    --text-muted: #a3a3a3;
    --purple: #8b5cf6;
    --purple-neon: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.45);
    --danger: #ef4444;
    --success: #22c55e;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.12), transparent 40%), var(--bg-main);
    color: var(--white);
    font-family: "Segoe UI", "Montserrat", sans-serif;
    min-height: 100%;
}

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

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

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

.site-loader {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(168, 85, 247, 0.2), transparent 34%),
        linear-gradient(180deg, #030303 0%, #0b0610 52%, #030303 100%);
    z-index: 9999;
    transition: opacity .55s ease, visibility .55s ease;
    pointer-events: none;
    animation: loaderFallback .55s ease 3.1s forwards;
}

.site-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.welcome-seen .site-loader {
    display: none;
}

@keyframes loaderFallback {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.intro-grid {
    position: absolute;
    inset: -20%;
    background:
        linear-gradient(rgba(168, 85, 247, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.08) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 68%);
    mask-image: radial-gradient(circle, #000 0%, transparent 68%);
    opacity: .42;
    transform: perspective(700px) rotateX(58deg) translateY(18%);
    animation: introGrid 1.9s ease-out both;
}

.intro-glow {
    position: absolute;
    width: 38vw;
    max-width: 560px;
    aspect-ratio: 1;
    border-radius: 999px;
    filter: blur(46px);
    opacity: .38;
    mix-blend-mode: screen;
}

.intro-glow-one {
    top: 10%;
    left: 12%;
    background: rgba(168, 85, 247, .45);
    animation: introFloat 1.8s ease-in-out both;
}

.intro-glow-two {
    right: 10%;
    bottom: 6%;
    background: rgba(79, 70, 229, .32);
    animation: introFloat 1.8s .1s ease-in-out both reverse;
}

.intro-panel {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 16px;
    justify-items: center;
    padding: 26px 28px;
    text-align: center;
}

.intro-logo {
    font-weight: 900;
    font-size: clamp(1.25rem, 3vw, 1.9rem);
    letter-spacing: .04em;
    opacity: 0;
    transform: translateY(12px);
    animation: introRise .55s .15s ease forwards;
}

.intro-logo span {
    color: var(--purple-neon);
    text-shadow: 0 0 22px var(--purple-glow);
}

.intro-welcome {
    display: flex;
    gap: clamp(6px, 1.2vw, 14px);
    font-weight: 900;
    font-size: clamp(2.6rem, 9vw, 7.4rem);
    line-height: .9;
    letter-spacing: 0;
    text-transform: uppercase;
}

.intro-welcome span {
    display: inline-block;
    opacity: 0;
    transform: translateY(28px) scale(.92);
    color: #fff;
    text-shadow:
        0 0 10px rgba(255,255,255,.26),
        0 0 34px rgba(168,85,247,.55);
    animation: introLetter .62s cubic-bezier(.2,.85,.2,1.2) forwards;
}

.intro-welcome span:nth-child(1) { animation-delay: .28s; }
.intro-welcome span:nth-child(2) { animation-delay: .36s; }
.intro-welcome span:nth-child(3) { animation-delay: .44s; }
.intro-welcome span:nth-child(4) { animation-delay: .52s; }
.intro-welcome span:nth-child(5) { animation-delay: .60s; }
.intro-welcome span:nth-child(6) { animation-delay: .68s; }
.intro-welcome span:nth-child(7) { animation-delay: .76s; }

.intro-line {
    width: min(360px, 70vw);
    height: 2px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
}

.intro-line span {
    display: block;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, var(--purple-neon), #fff, transparent);
    box-shadow: 0 0 18px var(--purple-glow);
    animation: introLine 1.15s .72s ease forwards;
}

@keyframes introRise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes introLetter {
    60% {
        opacity: 1;
        transform: translateY(-4px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes introLine {
    to {
        transform: translateX(100%);
    }
}

@keyframes introGrid {
    from {
        opacity: 0;
        transform: perspective(700px) rotateX(64deg) translateY(26%) scale(1.08);
    }
}

@keyframes introFloat {
    from {
        transform: translate3d(0, 20px, 0) scale(.9);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-loader {
        animation-duration: .01ms;
        animation-delay: .7s;
    }

    .intro-grid,
    .intro-glow,
    .intro-logo,
    .intro-welcome span,
    .intro-line span {
        animation-duration: .01ms;
        animation-delay: 0s;
    }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    background: rgba(5, 5, 5, 0.72);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 86px;
}

.logo {
    display: flex;
    align-items: center;
    width: 178px;
    min-width: 178px;
    height: 68px;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(168, 85, 247, 0.28));
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.main-nav a {
    color: var(--text-muted);
    font-weight: 600;
    transition: color .25s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--white);
}

.cart-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cart-badge {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 100px;
    background: var(--purple-neon);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
}

.mobile-menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    border-radius: 99px;
    background: #fff;
    margin: 5px 0;
}

.site-main {
    padding: 36px 0 70px;
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 66px 34px;
    border: 1px solid rgba(255,255,255,0.1);
    background:
        linear-gradient(145deg, rgba(168, 85, 247, 0.16), rgba(0,0,0,0.75)),
        repeating-linear-gradient(120deg, rgba(255,255,255,0.03), rgba(255,255,255,0.03) 1px, transparent 1px, transparent 18px);
}

.hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 6vw, 3.5rem);
    line-height: 1.04;
}

.hero p {
    color: #d2d2d2;
    width: min(620px, 100%);
    font-size: 1.08rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    border: 1px solid transparent;
    padding: 12px 20px;
    border-radius: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

.btn-primary {
    background: linear-gradient(120deg, var(--purple), var(--purple-neon));
    color: #fff;
    box-shadow: 0 0 26px var(--purple-glow);
}

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

.btn-outline {
    border-color: rgba(255,255,255,0.25);
    color: #fff;
    background: rgba(255,255,255,0.02);
}

.btn-outline:hover {
    border-color: var(--purple-neon);
    box-shadow: 0 0 16px var(--purple-glow);
}

.section {
    margin-top: 56px;
}

.section h2 {
    margin: 0 0 10px;
    font-size: clamp(1.4rem, 4vw, 2rem);
}

.section p.lead {
    margin: 0 0 18px;
    color: var(--text-muted);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.card {
    border: 1px solid rgba(255,255,255,0.08);
    background:
        linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0)),
        var(--card);
    border-radius: 16px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}

.card:hover {
    transform: translateY(-4px) rotateX(1.5deg) rotateY(-1.5deg);
    box-shadow: 0 12px 32px rgba(0,0,0,.45), 0 0 22px rgba(168,85,247,.15);
}

.card-body {
    padding: 16px;
}

.card h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

@media (min-width: 761px) {
    .section {
        width: min(1180px, 92%);
        margin: 56px auto 0;
    }
}

@media (min-width: 961px) {
    .grid-3 > .card > a:first-child {
        display: block;
        aspect-ratio: 4 / 3;
        overflow: hidden;
        background: #080808;
    }

    .grid-3 > .card > a:first-child img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .product-layout > .card:first-child > img {
        width: 100%;
        max-height: 560px;
        object-fit: cover;
        object-position: center;
    }
}

.muted {
    color: var(--text-muted);
}

.price {
    font-weight: 800;
    margin: 10px 0;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.filters select, .filters input, .form-group select, .form-group input, .form-group textarea {
    width: 100%;
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.14);
    color: #fff;
    border-radius: 10px;
    padding: 12px;
}

.filter-chip {
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: .9rem;
}

.filter-chip.active {
    border-color: var(--purple-neon);
    box-shadow: 0 0 16px var(--purple-glow);
}

.product-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.gallery-thumbs button {
    border: 1px solid rgba(255,255,255,0.14);
    background: #0f0f0f;
    border-radius: 8px;
    width: 64px;
    height: 64px;
    overflow: hidden;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #0c0c0c;
    border: 1px solid rgba(255,255,255,0.08);
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    vertical-align: top;
}

th {
    color: #ddd;
    font-weight: 700;
    background: #101010;
}

.empty-state {
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: .8rem;
    font-weight: 700;
}

.badge.pending { background: #eab30822; color: #facc15; }
.badge.paid { background: #22c55e22; color: #22c55e; }
.badge.processing { background: #3b82f622; color: #60a5fa; }
.badge.shipped { background: #06b6d422; color: #22d3ee; }
.badge.completed { background: #16a34a22; color: #4ade80; }
.badge.cancelled { background: #ef444422; color: #f87171; }

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}

.alert-error {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.45);
}

.alert-success {
    background: rgba(34,197,94,0.12);
    border-color: rgba(34,197,94,0.42);
}

.site-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: 70px;
    padding: 42px 0 0;
    background: #070707;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 20px;
}

.footer-grid h3,
.footer-grid h4 {
    margin-top: 0;
}

.footer-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-grid li {
    margin-bottom: 8px;
    color: var(--text-muted);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: 22px;
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #131313;
    border: 1px solid rgba(168,85,247,.35);
    box-shadow: 0 0 18px rgba(168,85,247,.2);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all .28s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.admin-shell {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 18px;
}

.admin-sidebar {
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px;
}

.admin-sidebar a {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    color: #ddd;
}

.admin-sidebar a:hover {
    background: rgba(255,255,255,.05);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--purple-neon);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.admin-login-section {
    display: grid;
    place-items: center;
    min-height: min(620px, 72vh);
}

.admin-login-card {
    width: min(440px, 100%);
    box-shadow: 0 22px 70px rgba(0,0,0,.45), 0 0 34px rgba(168,85,247,.14);
}

.admin-login-card h1,
.admin-topbar h1 {
    margin: 0 0 8px;
}

.admin-login-form {
    margin-top: 20px;
}

.admin-topbar,
.admin-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.admin-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0;
}

.admin-metric-card {
    min-height: 126px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
    background:
        linear-gradient(145deg, rgba(168,85,247,.12), rgba(255,255,255,.03) 45%, rgba(0,0,0,.1)),
        #0d0d0d;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.admin-metric-card span,
.admin-metric-card small {
    display: block;
    color: var(--text-muted);
}

.admin-metric-card strong {
    display: block;
    margin: 10px 0 8px;
    font-size: clamp(1.55rem, 3vw, 2.3rem);
    line-height: 1;
}

.admin-metric-card small {
    font-size: .82rem;
}

.admin-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.admin-panel h2 {
    margin-top: 0;
}

.admin-bars {
    display: grid;
    gap: 14px;
}

.admin-bar-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 6px;
    font-weight: 700;
}

.admin-bar-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
}

.admin-bar-track span {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--purple-neon), #fff);
    box-shadow: 0 0 16px rgba(168,85,247,.35);
}

.admin-bar-row small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
}

@media (max-width: 960px) {
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .product-layout {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .admin-shell {
        grid-template-columns: 1fr;
    }
    .admin-metric-grid,
    .admin-analytics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .main-nav {
        position: absolute;
        top: 86px;
        right: 4%;
        left: 4%;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
        border-radius: 12px;
        background: rgba(7,7,7,.95);
        border: 1px solid rgba(255,255,255,.12);
        transform-origin: top;
        transform: scaleY(0);
        opacity: 0;
        pointer-events: none;
        transition: .25s ease;
    }
    .main-nav.open {
        transform: scaleY(1);
        opacity: 1;
        pointer-events: all;
    }
    .mobile-menu-toggle {
        display: block;
    }
    .grid-3, .grid-2, .form-grid {
        grid-template-columns: 1fr;
    }
    .hero {
        padding: 54px 22px;
    }
    .logo {
        width: 138px;
        min-width: 138px;
        height: 52px;
    }
    .admin-topbar,
    .admin-section-head {
        flex-direction: column;
    }
    .admin-metric-grid,
    .admin-analytics-grid {
        grid-template-columns: 1fr;
    }
}
