/* ============================================================
   Dark Theme — matching landing page aesthetic
   ============================================================ */

/* Base dark theme */
body { background: #0a0a1a; color: #e0e0e0; }

/* Desktop: fixed viewport, nested scroll */
@media (min-width: 992px) {
    html.shop-locked, html.shop-locked body { overflow: hidden; height: 100%; }
    .shop-outer { height: calc(100vh - 56px); display: flex; flex-direction: column; }
    .shop-content { flex: 1; position: relative; min-height: 0; }
    .shop-content-inner { position: absolute; inset: 0; display: flex; }
    .shop-sidebar { width: 280px; flex-shrink: 0; overflow-y: auto; }
    .shop-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
    .shop-filters { flex-shrink: 0; }
    .shop-scroll { flex: 1; overflow-y: auto; min-height: 0; }
}

/* Mobile: natural page scroll */
@media (max-width: 991px) {
    .shop-outer { padding-bottom: 1rem; }
    .shop-content-inner { display: block; }
    .shop-sidebar { display: none; }
    .shop-scroll { overflow: visible; }
}

/* Navbar override */
.navbar { background: #0d0d20 !important; border-bottom: 1px solid rgba(168,192,255,0.1); }
.navbar-brand {
    background: linear-gradient(135deg, #fff, #a8c0ff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    font-weight: 700;
}

/* Banner */
.bg-warning { background: linear-gradient(90deg, #1a1a3e, #2a1a4e) !important; color: rgba(255,255,255,0.7) !important; border-bottom: 1px solid rgba(168,192,255,0.1); }
.bg-warning a { color: #a8c0ff !important; }

/* Product grid */
#productGrid {
    transition: opacity .15s ease;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
@media (max-width: 575px) {
    #productGrid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: .5rem;
    }
    .card-product .card-body { padding: .4rem; }
    .card-product .card-title { font-size: .7rem; }
    .variant-pill { font-size: .5rem; padding: .05rem .25rem; }
}
#productGrid > .col {
    width: auto !important; max-width: none !important; flex: none !important;
}

/* Product cards */
.card-product {
    background: #12122a;
    border: 1px solid rgba(168,192,255,0.1);
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    border-radius: .5rem;
}
.card-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.2), 0 0 30px rgba(102,126,234,0.05);
    border-color: rgba(168,192,255,0.25);
}
.card-product .card-img-wrap {
    position: relative; overflow: hidden;
    border-radius: .5rem .5rem 0 0;
    background: #1a1a2e;
}
.card-product .card-img-top {
    aspect-ratio: 488/680; object-fit: cover; width: 100%; display: block;
}
.card-product .foil-overlay {
    position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
    background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(200,230,255,.18) 15%, rgba(255,200,255,.15) 30%, rgba(200,255,200,.18) 45%, rgba(255,255,200,.15) 60%, rgba(200,220,255,.18) 75%, rgba(255,200,255,.15) 90%, rgba(255,255,255,0) 100%);
    mix-blend-mode: screen;
}
.card-product .foil-shimmer {
    position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
    background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,.35) 45%, rgba(255,255,255,.5) 50%, rgba(255,255,255,.35) 55%, transparent 80%);
    background-size: 200% 100%; mix-blend-mode: overlay;
}
.card-product.is-foil .foil-overlay { opacity: 1; }
.card-product.is-foil .foil-shimmer { opacity: 1; animation: foilShimmer 8s ease-in-out infinite; }

@keyframes foilShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.card-product .card-body {
    padding: .5rem; display: flex; flex-direction: column;
}
.card-product .card-title {
    flex: 1; font-size: .8rem; line-height: 1.2; height: 2.4em;
    overflow: hidden; margin-bottom: .25rem; color: #e0e0e0;
}
.card-product .card-bottom { margin-top: auto; }
.card-product .price { font-weight: 700; color: #6ee7b7; }
.card-product .qty-badge { font-size: .65rem; }
.card-product .condition-badge { font-size: .6rem; }

/* Detail modal foil */
.is-foil .card-img-wrap { position: relative; overflow: hidden; border-radius: .375rem; }
.is-foil .foil-overlay {
    position: absolute; inset: 0; pointer-events: none; opacity: 1;
    background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(200,230,255,.18) 15%, rgba(255,200,255,.15) 30%, rgba(200,255,200,.18) 45%, rgba(255,255,200,.15) 60%, rgba(200,220,255,.18) 75%, rgba(255,200,255,.15) 90%, rgba(255,255,255,0) 100%);
    mix-blend-mode: screen;
}
.is-foil .foil-shimmer {
    position: absolute; inset: 0; pointer-events: none; opacity: 1;
    background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,.35) 45%, rgba(255,255,255,.5) 50%, rgba(255,255,255,.35) 55%, transparent 80%);
    background-size: 200% 100%; mix-blend-mode: overlay;
    animation: foilShimmer 8s ease-in-out infinite;
}

/* Category sidebar */
#categorySidebar {
    border-right: 1px solid rgba(168,192,255,0.1);
    padding-right: .75rem; padding-bottom: 2rem;
}
#productScrollArea { padding-bottom: 2rem; }
.cat-node {
    cursor: pointer; padding: .25rem .5rem; border-radius: .25rem;
    transition: background .1s; color: #c0c0d0;
}
.cat-node:hover { background: rgba(168,192,255,0.1); }
.cat-node.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}
.cat-node .cat-count { color: #6c6c8a; font-size: .75rem; }
.cat-node.active .cat-count { color: rgba(255,255,255,.7); }
.cat-children {
    padding-left: .75rem; border-left: 2px solid rgba(168,192,255,0.1); margin-left: .5rem;
}

/* Form controls dark */
.form-control, .form-select {
    background: #15152e !important; border-color: rgba(168,192,255,0.15) !important;
    color: #e0e0e0 !important;
}
.form-control::placeholder { color: #6c6c8a !important; }
.form-control:focus, .form-select:focus {
    border-color: rgba(102,126,234,0.5) !important;
    box-shadow: 0 0 0 .2rem rgba(102,126,234,0.15) !important;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border: none !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #7a8ff0, #8a5db8) !important;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}
.btn-outline-light { border-color: rgba(255,255,255,0.2) !important; }
.btn-outline-light:hover { background: rgba(255,255,255,0.1) !important; }
.btn-outline-dark {
    border-color: rgba(168,192,255,0.2) !important; color: #a8c0ff !important;
}
.btn-outline-dark:hover, .btn-outline-dark.active {
    background: rgba(102,126,234,0.2) !important;
    border-color: rgba(102,126,234,0.4) !important; color: #fff !important;
}
.btn-outline-secondary { border-color: rgba(168,192,255,0.15) !important; color: #a0a0b0 !important; }

/* Badges */
.badge.bg-dark { background: rgba(168,192,255,0.15) !important; color: #a8c0ff !important; }
.badge.bg-secondary { background: rgba(255,255,255,0.1) !important; }
.badge.bg-success { background: rgba(16,185,129,0.2) !important; color: #6ee7b7 !important; }

/* Variant selector pills */
.variant-pill {
    font-size: .6rem; padding: .1rem .35rem;
    border-radius: .25rem; line-height: 1.3;
}
.variant-pill.active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #fff !important; border-color: transparent !important;
}

/* Cart drawer */
.offcanvas { background: #0d0d20 !important; color: #e0e0e0; border-left: 1px solid rgba(168,192,255,0.1) !important; }
.offcanvas-header { border-bottom: 1px solid rgba(168,192,255,0.1); }
.cart-item {
    display: flex; align-items: center; gap: .5rem; padding: .5rem 0;
    border-bottom: 1px solid rgba(168,192,255,0.08);
}
.cart-item img { width: 40px; height: 56px; object-fit: cover; border-radius: 3px; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e0e0e0; }
.cart-item-price { font-size: .75rem; color: #6c6c8a; }

/* Modals */
.modal-content { background: #12122a !important; border: 1px solid rgba(168,192,255,0.1); color: #e0e0e0; }
.modal-header { border-bottom: 1px solid rgba(168,192,255,0.1); }
.modal-footer { border-top: 1px solid rgba(168,192,255,0.1); }
.btn-close { filter: invert(1); }

/* Text utilities */
.text-muted { color: #6c6c8a !important; }
.text-success { color: #6ee7b7 !important; }
a { color: #a8c0ff; }
a:hover { color: #c0d0ff; }
hr { border-color: rgba(168,192,255,0.1); }

/* Breadcrumbs */
.breadcrumb-item a { color: #a8c0ff; }
.breadcrumb-item.active { color: #8080a0; }
.breadcrumb-item + .breadcrumb-item::before { color: #4a4a6a; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a1a; }
::-webkit-scrollbar-thumb { background: rgba(168,192,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168,192,255,0.35); }

/* Toast overlay */
.shop-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    z-index: 9999; padding: .5rem 1.5rem; border-radius: .5rem;
    color: #fff; font-size: .85rem; pointer-events: none;
    transition: opacity .3s; box-shadow: 0 4px 12px rgba(0,0,0,.4);
    background: #1a1a3e;
}

/* Mobile sidebar */
.offcanvas-start { background: #0d0d20 !important; border-right: 1px solid rgba(168,192,255,0.1) !important; }

/* Account section */
#accountSection { background: #0a0a1a; }
.list-group-item { background: #12122a; border-color: rgba(168,192,255,0.08); color: #e0e0e0; }
.list-group-item:hover, .list-group-item-action:hover { background: rgba(102,126,234,0.1); color: #fff; }
.card { background: #12122a; border-color: rgba(168,192,255,0.1); color: #e0e0e0; }
.card-body { background: #12122a; color: #e0e0e0; }
.card-header { background: rgba(168,192,255,0.05); border-bottom: 1px solid rgba(168,192,255,0.1); color: #e0e0e0; }
strong { color: #e0e0e0; }

/* Tables */
.table { --bs-table-bg: transparent; --bs-table-color: #e0e0e0; color: #e0e0e0; }
.table-bordered { border-color: rgba(168,192,255,0.08); }
.table thead th { border-color: rgba(168,192,255,0.1); color: #a0a0b0; }
.table td, .table th { border-color: rgba(168,192,255,0.06); }
.table-sm { --bs-table-bg: transparent; }

/* Dropdown */
.dropdown-menu { background: #12122a; border-color: rgba(168,192,255,0.1); }
.dropdown-item { color: #e0e0e0; }
.dropdown-item:hover { background: rgba(102,126,234,0.15); color: #fff; }
.dropdown-divider { border-color: rgba(168,192,255,0.1); }

/* Pagination */
.page-link { background: #12122a; border-color: rgba(168,192,255,0.1); color: #a8c0ff; }
.page-link:hover { background: rgba(102,126,234,0.15); color: #fff; }
.page-item.active .page-link { background: linear-gradient(135deg, #667eea, #764ba2); border-color: transparent; }
.page-item.disabled .page-link { background: #0d0d20; color: #4a4a6a; }

/* Variant card (SSR detail) */
.variant-card { border-color: rgba(168,192,255,0.1) !important; background: #15152e; }
.variant-card:hover { box-shadow: 0 2px 8px rgba(102,126,234,0.15); }

/* Alert */
.alert-warning { background: rgba(255,193,7,0.1); border-color: rgba(255,193,7,0.2); color: #ffc107; }
.alert-danger { background: rgba(220,53,69,0.1); border-color: rgba(220,53,69,0.2); color: #f87171; }

/* Bootstrap overrides for dark */
.border-top, .border-bottom, .border { border-color: rgba(168,192,255,0.1) !important; }
.bg-light { background: #15152e !important; }
.text-dark { color: #e0e0e0 !important; }
.border.rounded { border-color: rgba(168,192,255,0.1) !important; }
.container { color: #e0e0e0; }
#successView h2 { color: #6ee7b7 !important; }
#cancelView h2 { color: #fbbf24 !important; }

/* Sealed product notes (storefront product detail) */
.sealed-notes { font-size: 0.95em; line-height: 1.6; color: #e0e0e0; }
.sealed-notes h1, .sealed-notes h2, .sealed-notes h3 { font-size: 1.1em; font-weight: 600; margin-top: 1em; margin-bottom: .35em; color: #f1f1f1; }
.sealed-notes p { margin-bottom: .75em; }
.sealed-notes ul, .sealed-notes ol { padding-left: 1.4em; margin-bottom: .75em; }
.sealed-notes a { color: #8ab4f8; text-decoration: underline; }
.sealed-notes code { background: rgba(255,255,255,.08); padding: .1em .3em; border-radius: 3px; font-size: .9em; }
