/* KINGMODE Store — extends style.css (vars, nav, footer, glows, fade-in). */

.store-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 140px 5% 80px;
    position: relative;
    z-index: 10;
}

.nav-active { color: var(--accent-1) !important; }
.logo-link { text-decoration: none; color: var(--text-main); }

/* Cart button in navbar */
.cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: background 0.3s;
}
.cart-btn:hover { background: rgba(255, 255, 255, 0.1); }
.cart-btn svg { width: 18px; height: 18px; }
.cart-count[hidden] { display: none; }
.cart-count {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Heading + filters */
.store-heading { margin-bottom: 40px; }
.store-heading h1 { font-size: clamp(2.4rem, 4.5vw, 3.6rem); margin-bottom: 16px; }
.store-heading p { max-width: 560px; font-size: 1.05rem; }

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
}
.filter-chip {
    padding: 9px 18px;
    border-radius: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}
.filter-chip:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.07); }
.filter-chip.active {
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(255, 42, 95, 0.18), rgba(138, 43, 226, 0.18));
    border-color: rgba(255, 42, 95, 0.4);
}

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

.product-card {
    background: rgba(20, 20, 20, 0.4);
    border-radius: 24px;
    position: relative;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    text-decoration: none;
    display: block;
}
.product-card::before, .product-card::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 500ms ease;
    pointer-events: none;
}
.product-card::before {
    background: radial-gradient(700px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
    z-index: 3;
}
.product-card::after {
    background: radial-gradient(500px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.4), transparent 40%);
    z-index: 1;
}
.product-card:hover::before, .product-card:hover::after { opacity: 1; }
.product-card .card-border {
    position: absolute;
    inset: 1px;
    background: rgba(15, 15, 15, 0.85);
    border-radius: 23px;
    z-index: 2;
}
.product-card .card-content {
    position: relative;
    z-index: 4;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

/* Product image / gradient placeholder */
.product-media {
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
}
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}
.media-placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    opacity: 1;
}
.media-placeholder .ph-emoji {
    position: relative;
    font-size: 3rem;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}
.media-placeholder .ph-mark {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.75);
}
.product-media .sold-out-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 3, 3, 0.65);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.sold-out-overlay span {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-main);
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    color: var(--text-muted);
}
.type-chip {
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}
.low-stock {
    color: #ffb020;
    font-weight: 600;
}

.product-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-main);
    line-height: 1.3;
    transition: color 0.3s;
}
.product-card:hover h3 { color: var(--accent-1); }

.price-row { display: flex; align-items: baseline; gap: 10px; margin-top: auto; }
.price { font-size: 1.15rem; font-weight: 800; color: var(--text-main); }
.compare-at { font-size: 0.9rem; color: var(--text-muted); text-decoration: line-through; }
.price-row .sale-chip {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255, 42, 95, 0.15);
    border: 1px solid rgba(255, 42, 95, 0.4);
    color: var(--accent-1);
}

/* ---------- Product detail ---------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 36px;
    transition: color 0.3s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
}
.back-link:hover { color: var(--text-main); }
.back-link::before { content: "←"; transition: transform 0.3s; }
.back-link:hover::before { transform: translateX(-4px); }

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}
.detail-media .product-media { aspect-ratio: 1 / 1; border-radius: 24px; }
.detail-media .media-placeholder .ph-emoji { font-size: 5.5rem; }
.detail-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.detail-thumbs img {
    width: 72px; height: 72px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.25s, border-color 0.25s;
}
.detail-thumbs img.active, .detail-thumbs img:hover { opacity: 1; border-color: rgba(255, 42, 95, 0.5); }

.detail-info h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -1px; margin: 14px 0 18px; }
.detail-info .price-row { margin: 0 0 6px; }
.detail-info .price { font-size: 1.7rem; }
.stock-line { font-size: 0.86rem; margin-bottom: 24px; }
.stock-line.ok { color: #4ade80; }
.stock-line.low { color: #ffb020; }
.stock-line.out { color: var(--accent-1); }

.buy-row { display: flex; gap: 14px; align-items: stretch; margin: 24px 0; }
.qty-picker {
    display: inline-flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    overflow: hidden;
}
.qty-picker button {
    width: 42px;
    height: 48px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.qty-picker button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.qty-picker button:disabled { opacity: 0.3; cursor: default; }
.qty-picker .qty-value {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}
.btn-add {
    flex: 1;
    max-width: 280px;
    background: var(--text-main);
    color: var(--bg-color);
    border: none;
    padding: 0 32px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}
.btn-add:hover:not(:disabled) { transform: scale(1.03); box-shadow: 0 0 30px rgba(255, 255, 255, 0.3); }
.btn-add:disabled {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.fulfil-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
}

.detail-desc {
    border-top: 1px solid var(--glass-border);
    padding-top: 24px;
}
.detail-desc p { font-size: 0.98rem; line-height: 1.75; color: #c8c8ce; margin-bottom: 16px; }
.detail-desc em { color: #e4e4e9; }
.detail-desc strong { color: var(--text-main); }
.sku-line { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; }

/* ---------- Cart ---------- */
.cart-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    padding: 8px 28px;
    margin: 28px 0;
}
.cart-line {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto auto auto;
    gap: 18px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cart-line:last-child { border-bottom: none; }
.cart-thumb {
    width: 64px; height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-name { font-weight: 600; font-size: 0.95rem; }
.cart-line-name a { color: var(--text-main); text-decoration: none; }
.cart-line-name a:hover { color: var(--accent-1); }
.cart-line-unit { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.cart-line .qty-picker { transform: scale(0.85); transform-origin: left center; }
.cart-line-total { font-weight: 700; font-size: 0.95rem; min-width: 76px; text-align: right; }
.remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    font-family: inherit;
}
.remove-btn:hover { color: var(--accent-1); background: rgba(255, 42, 95, 0.1); }

.cart-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-top: 28px;
}
.subtotal-row { display: flex; align-items: baseline; gap: 16px; }
.subtotal-row .label { color: var(--text-muted); font-size: 0.95rem; }
.subtotal-row .amount { font-size: 1.5rem; font-weight: 800; }
.shipping-note { font-size: 0.8rem; color: var(--text-muted); }
.btn-checkout {
    margin-top: 8px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    border: none;
    padding: 16px 44px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(255, 42, 95, 0.3);
}
.btn-checkout:hover:not(:disabled) { transform: scale(1.03); box-shadow: 0 8px 40px rgba(255, 42, 95, 0.45); }
.btn-checkout:disabled { opacity: 0.6; cursor: wait; }

.cart-empty {
    text-align: center;
    padding: 80px 20px;
    border: 1px dashed var(--glass-border);
    border-radius: 24px;
    margin-top: 28px;
}
.cart-empty .empty-icon { font-size: 2.4rem; margin-bottom: 16px; }
.cart-empty h3 { margin-bottom: 8px; }
.cart-empty p { font-size: 0.95rem; margin-bottom: 24px; }
.cart-empty a { color: var(--text-main); }

/* ---------- Order confirmation ---------- */
.order-panel {
    max-width: 560px;
    margin: 40px auto;
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 28px;
    padding: 56px 40px;
    backdrop-filter: blur(20px);
}
.order-panel .order-icon {
    width: 72px; height: 72px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(0, 210, 255, 0.2));
    border: 1px solid rgba(74, 222, 128, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.order-panel h2 { margin-bottom: 10px; }
.order-panel .order-number { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 20px; }
.order-panel .order-number strong { color: var(--text-main); }
.order-panel .order-total { font-size: 1.6rem; font-weight: 800; margin-bottom: 28px; }

/* ---------- Toasts ---------- */
.toast-stack {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
    width: min(92vw, 480px);
}
.toast {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px 20px;
    font-size: 0.9rem;
    color: var(--text-main);
    backdrop-filter: blur(20px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.info { border-color: rgba(138, 43, 226, 0.5); }
.toast.error { border-color: rgba(255, 42, 95, 0.5); }
.toast.success { border-color: rgba(74, 222, 128, 0.5); }
.toast .toast-icon { flex-shrink: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .detail-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 768px) {
    /* Keep Store nav + cart usable on mobile (style.css hides .nav-links) */
    .nav-links { display: flex; gap: 16px; }
    .nav-links li a:not(.cart-btn) { display: none; }
    .cart-line { grid-template-columns: 48px minmax(0, 1fr) auto; row-gap: 10px; }
    .cart-thumb { width: 48px; height: 48px; font-size: 1.2rem; }
    .cart-line .qty-picker { grid-column: 2; }
    .cart-line-total { grid-column: 3; }
    .cart-panel { padding: 8px 18px; }
    .buy-row { flex-direction: column; }
    .btn-add { max-width: none; padding: 16px 32px; }
}
