:root {
    --bg: #14101f;
    --bg-card: #1e1830;
    --bg-card-hover: #251d3d;
    --purple: #6d28d9;
    --purple-light: #8b5cf6;
    --gold: #d4af37;
    --gold-light: #f0d878;
    --text: #f2eefa;
    --text-muted: #a89ec2;
    --border: #322850;
    --danger: #e15b5b;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', Roboto, -apple-system, sans-serif;
    line-height: 1.5;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: linear-gradient(180deg, #1a1430, #14101f);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(90deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main-nav a {
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 12px;
}

.cart-link {
    position: relative;
    font-weight: 600;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.cart-badge {
    background: var(--gold);
    color: #14101f;
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    padding: 1px 7px;
    margin-left: 6px;
}

/* Layout */
.catalog-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    padding: 32px 0 60px;
}

.catalog-filters h3 {
    color: var(--gold-light);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.category-list { list-style: none; padding: 0; margin: 0; }
.category-list li { margin-bottom: 6px; }
.category-list a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-muted);
}
.category-list li.active a,
.category-list a:hover {
    background: var(--bg-card);
    color: var(--gold-light);
}

.catalog-grid h1 { margin-top: 0; }

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .15s ease, background .15s ease;
    display: block;
}
.product-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px);
}

.product-image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #241c3a;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }

.no-image {
    color: var(--gold);
    font-weight: 800;
    letter-spacing: 2px;
    opacity: .35;
    font-size: 14px;
}
.no-image.large { font-size: 22px; }
.no-image.small { font-size: 10px; }

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}
.badge-hit { background: var(--gold); color: #14101f; }
.badge-out { background: var(--danger); color: #fff; }

.product-info { padding: 14px; }
.product-cat { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.product-name { font-weight: 600; margin: 4px 0 8px; }
.product-price { color: var(--gold-light); font-weight: 700; }
.product-price.large { font-size: 26px; margin: 12px 0; }
.old-price { color: var(--text-muted); text-decoration: line-through; font-weight: 400; margin-left: 8px; font-size: .85em; }

.empty-state { text-align: center; padding: 60px 0; color: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-block;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
}
.btn-primary {
    background: linear-gradient(90deg, var(--purple), var(--purple-light));
    color: #fff;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-lg { padding: 14px 30px; font-size: 16px; }

/* Product detail */
.breadcrumbs { color: var(--text-muted); font-size: 13px; margin: 20px 0; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--gold-light); }

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding-bottom: 60px;
}
.product-detail-image {
    background: var(--bg-card);
    border-radius: var(--radius);
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-detail-image img { width: 100%; height: 100%; object-fit: cover; }

.attributes-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.attributes-table td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.attributes-table td:first-child { color: var(--text-muted); width: 40%; }

.product-description { color: var(--text-muted); margin: 16px 0; }

.add-to-cart-form { display: flex; align-items: flex-end; gap: 12px; margin: 20px 0 10px; flex-wrap: wrap; }
.add-to-cart-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }
.add-to-cart-form input[type=number] {
    width: 70px; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text);
}
.variant-select {
    padding: 10px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); min-width: 220px;
}
.stock-info { color: var(--text-muted); font-size: 13px; }

/* Cart */
.cart-table { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.cart-row {
    display: grid;
    grid-template-columns: 70px 1fr 100px 120px 40px;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}
.cart-row-image { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; background: #241c3a; display: flex; align-items: center; justify-content: center; }
.cart-row-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-row-name a { font-weight: 600; }
.cart-row-flavor { font-size: 12px; color: var(--gold-light); margin-top: 2px; }
.cart-row-price { color: var(--text-muted); font-size: 13px; }
.cart-qty-input { width: 60px; padding: 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.cart-row-subtotal { font-weight: 700; color: var(--gold-light); text-align: right; }
.cart-row-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; }
.cart-row-remove:hover { color: var(--danger); }

.cart-summary { display: flex; justify-content: space-between; align-items: center; padding: 20px 0 60px; }
.cart-total { font-size: 20px; }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; padding-bottom: 60px; }
.checkout-form { display: flex; flex-direction: column; gap: 16px; }
.checkout-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-muted); }
.checkout-form input[type=text],
.checkout-form input[type=tel],
.checkout-form textarea {
    padding: 12px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); font-size: 14px;
}
.delivery-fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.delivery-fieldset legend { color: var(--text-muted); padding: 0 6px; }
.radio-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; color: var(--text); }

.checkout-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    height: fit-content;
}
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.summary-total { border-bottom: none; font-weight: 700; font-size: 16px; color: var(--gold-light); }

.success-box { background: var(--bg-card); border: 1px solid var(--gold); border-radius: var(--radius); padding: 30px; text-align: center; margin: 30px 0; }
.error-box { background: rgba(225,91,91,.12); border: 1px solid var(--danger); border-radius: var(--radius); padding: 16px 20px; margin: 20px 0; }
.error-box ul { margin: 0; padding-left: 20px; color: var(--danger); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 20px 0; color: var(--text-muted); font-size: 12px; text-align: center; }

/* Age gate 18+ */
.age-gate-overlay {
    position: fixed; inset: 0; background: rgba(10, 8, 18, 0.55);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.age-gate-box {
    background: var(--bg-card); border: 1px solid var(--gold); border-radius: var(--radius);
    padding: 40px; max-width: 420px; text-align: center;
}
.age-gate-box h2 {
    font-size: 42px; margin: 0 0 16px;
    background: linear-gradient(90deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.age-gate-box p { color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.age-gate-question { color: var(--text) !important; font-weight: 600; font-size: 16px !important; margin-top: 16px; }
.age-gate-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.age-gate-buttons .btn { width: 100%; }

@media (max-width: 800px) {
    .catalog-layout, .product-detail, .checkout-layout { grid-template-columns: 1fr; }
    .cart-row { grid-template-columns: 50px 1fr 70px; grid-template-areas: "img name remove" "img qty subtotal"; }
}
