* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Pure pitch-black background, vibrant neon-red accents */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #0d0d0d;
    --accent-red: #ee1d23;
    --accent-red-hover: #ff0000;
    --accent-red-soft: rgba(238, 29, 35, 0.18);
    --accent-red-glow: rgba(238, 29, 35, 0.55);
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #6e6e6e;
    --border-color: #1f1f1f;
    --border-strong: #2a2a2a;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

h1, h2, h3 {
    font-family: 'Russo One', sans-serif;
}

#app {
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin: 0 auto;
}

header {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    padding: 0.9rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 8px 24px -10px var(--accent-red-soft);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Russo One', sans-serif;
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-red);
}

.logo i {
    font-size: 2rem;
    animation: flicker 2s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.cart-icon {
    position: relative;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.55rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    transition: transform 0.18s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    line-height: 1;
}

.cart-icon:hover {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 1px var(--accent-red), 0 0 22px -4px var(--accent-red-glow);
    transform: translateY(-1px) scale(1.04);
}

.cart-icon:active { transform: scale(0.96); }

.cart-badge {
    background: var(--accent-red);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 0 12px var(--accent-red-glow);
}

main {
    padding: 1.5rem;
}

.filter-section {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-red) var(--bg-primary);
}

.filter-section::-webkit-scrollbar {
    height: 6px;
}

.filter-section::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 3px;
}

.filter-section::-webkit-scrollbar-thumb {
    background: var(--accent-red);
    border-radius: 3px;
}

.filter-btn {
    padding: 0.55rem 1.15rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.25s ease;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn:hover {
    border-color: var(--accent-red);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.filter-btn:active { transform: scale(0.96); }

.filter-btn.active {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
    box-shadow: 0 0 18px -2px var(--accent-red-glow);
}

.filter-btn.sale-btn {
    background: linear-gradient(135deg, var(--accent-red), #ff4444);
    border-color: var(--accent-red);
    color: white;
    animation: pulse-sale 2s infinite;
}

@keyframes pulse-sale {
    0%, 100% { box-shadow: 0 0 10px rgba(238, 29, 35, 0.45); }
    50% { box-shadow: 0 0 22px rgba(238, 29, 35, 0.9); }
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, #060606 100%);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    /* Auto-height so the "Add to Cart" button is always visible regardless
       of name length / status text. Min-height keeps a consistent rhythm. */
    min-height: 360px;
    animation: fadeIn 0.45s ease-out both;
}

/* Subtle premium glow ring on every card */
.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(120% 60% at 50% -10%, rgba(238,29,35,0.10), transparent 60%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}
.product-card:hover::before { opacity: 1; }

.product-card:hover {
    border-color: var(--accent-red);
    transform: translateY(-4px);
    box-shadow:
        0 10px 30px -10px rgba(0, 0, 0, 0.9),
        0 0 0 1px var(--accent-red),
        0 0 28px -2px var(--accent-red-glow);
}

.product-card:active { transform: translateY(-2px) scale(0.99); }

/* Skeleton loaders */
.product-card.skeleton {
    pointer-events: none;
    border-color: var(--border-color);
}
.skeleton-shimmer {
    background: linear-gradient(90deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}
.skeleton-line {
    height: 12px;
    border-radius: 6px;
    margin: 0.4rem 0;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-red);
    color: white;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 0 14px var(--accent-red-glow);
    animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.product-image {
    width: 100%;
    height: 150px;
    background: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

.product-card:hover .product-image img { transform: scale(1.06); }

.product-image img { transition: transform 0.4s ease; }

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-image img[src=""],
.product-image img:not([src]),
.product-image img[src*="undefined"] {
    display: none;
}

.product-image i {
    font-size: 3rem;
    color: var(--border-color);
}

.product-info {
    padding: 0.85rem 0.9rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.4em;
}

.product-price {
    font-size: 1.35rem;
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: 0.3px;
}
.product-price::after {
    content: '';
    display: block;
    width: 28px;
    height: 2px;
    background: var(--accent-red);
    border-radius: 2px;
    margin-top: 4px;
    box-shadow: 0 0 8px var(--accent-red-glow);
}

.product-status {
    display: inline-block;
    padding: 0.22rem 0.55rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    align-self: flex-start;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

/* ── Stock pills (Available / Reserved / Out / Unlimited) ─────────────── */
.product-stock {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.15rem 0 0.35rem;
}
.stock-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.1;
    border: 1px solid transparent;
    transition: background 0.25s ease, border-color 0.25s ease;
    /* Keep the label and the number on a single line. The parent
       `.product-stock` is `flex-wrap: wrap`, so the pill as a whole can
       still drop to the next row on very narrow screens — but it never
       splits its own text. */
    white-space: nowrap;
    max-width: 100%;
}

@media (max-width: 380px) {
    .stock-pill { font-size: 0.65rem; padding: 0.2rem 0.45rem; }
}
.stock-pill.stock-available {
    background: rgba(0, 200, 83, 0.12);
    color: #4ade80;
    border-color: rgba(0, 200, 83, 0.4);
}
.stock-pill.stock-reserved {
    background: rgba(255, 170, 0, 0.12);
    color: #ffb84d;
    border-color: rgba(255, 170, 0, 0.45);
    animation: reserved-pulse 1.8s ease-in-out infinite;
}
.stock-pill.stock-out {
    background: rgba(238, 29, 35, 0.14);
    color: #ff6b6b;
    border-color: rgba(238, 29, 35, 0.45);
}
.stock-pill.stock-unlimited {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border-color: var(--border-strong);
}
@keyframes reserved-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0); }
    50%      { box-shadow: 0 0 10px 0 rgba(255, 170, 0, 0.35); }
}

.status-available {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
    border: 1px solid #00ff00;
}

.add-to-cart-btn {
    width: 100%;
    padding: 0.7rem;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: auto;
    box-shadow: 0 6px 18px -8px var(--accent-red-glow);
}

.add-to-cart-btn:hover:not(:disabled) {
    background: var(--accent-red-hover);
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 10px 26px -6px var(--accent-red-glow);
}

.add-to-cart-btn:active:not(:disabled) { transform: scale(0.97); }

.add-to-cart-btn:disabled {
    background: #1a1a1a;
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 90%;
    max-width: 450px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--accent-red);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7), -1px 0 0 var(--accent-red-soft);
    will-change: transform;
}

.cart-panel.active { transform: translateX(0); }

.cart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-primary);
}

.cart-panel-header h2 {
    font-size: 1.5rem;
    color: var(--accent-red);
}

.cart-close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cart-close-btn:hover {
    color: var(--accent-red);
    background: rgba(227, 0, 0, 0.1);
}

.cart-items {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.cart-item:hover {
    border-color: var(--accent-red);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-image i {
    font-size: 2rem;
    color: var(--border-color);
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-name {
    font-weight: bold;
}

.cart-item-price {
    color: var(--accent-red);
    font-size: 1.1rem;
    font-weight: bold;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--text-primary);
}

.quantity-btn:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.quantity-value {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.remove-btn {
    background: none;
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin-top: 0.5rem;
}

.remove-btn:hover {
    background: var(--accent-red);
    color: white;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--border-color);
    background: var(--bg-primary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.cart-total span:last-child {
    color: var(--accent-red);
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 24px -8px var(--accent-red-glow);
}

.checkout-btn:hover:not(:disabled) {
    background: var(--accent-red-hover);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 14px 32px -8px var(--accent-red-glow);
}

.checkout-btn:active:not(:disabled) { transform: scale(0.98); }

.checkout-btn:disabled {
    background: #1a1a1a;
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-cart {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.7rem;
    }
    .product-card { min-height: 340px; }
    .product-image { height: 140px; }
    .product-name { font-size: 0.9rem; min-height: 2.3em; }
    .product-price { font-size: 1.2rem; }
    .add-to-cart-btn { padding: 0.65rem; font-size: 0.8rem; }
    .logo { font-size: 1.4rem; }
    .logo i { font-size: 1.6rem; }
    header { padding: 0.8rem 1rem; }
    .filter-section { padding: 0.6rem; }
    main { padding: 1rem; }
}

@media (min-width: 769px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ════════════════════════════════════════════════════════════════════════
   PREMIUM UPGRADE LAYER (overrides the base theme above; keeps black/red
   identity but adds glassmorphism, motion polish and demon iconography).
   ════════════════════════════════════════════════════════════════════════ */

:root {
    --demon-red: #ff2a2a;
    --demon-deep: #8b0000;
    --demon-glow: 0 0 22px rgba(255, 42, 42, 0.55);
    --glass-bg: rgba(15, 0, 0, 0.55);
    --glass-border: rgba(255, 42, 42, 0.35);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Typography ─────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', 'Montserrat', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.logo span,
header h1,
.cart-panel-header h2 {
    font-family: 'Montserrat', 'Russo One', sans-serif;
    font-weight: 900;
    letter-spacing: 1.5px;
}
.product-name { font-weight: 600; letter-spacing: 0.2px; }
.product-price { font-family: 'Montserrat', sans-serif; font-weight: 800; }

/* ── Demon mark in the header ───────────────────────────────────────── */
.demon-mark {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 6px rgba(255, 42, 42, 0.6));
    animation: demon-breath 3.4s ease-in-out infinite;
}
.demon-emoji {
    display: inline-block;
    filter: drop-shadow(0 0 4px rgba(255, 42, 42, 0.7));
    animation: demon-breath 3s ease-in-out infinite;
}
@keyframes demon-breath {
    0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 4px rgba(255, 42, 42, 0.5)); }
    50%      { transform: scale(1.08); filter: drop-shadow(0 0 10px rgba(255, 60, 60, 0.9)); }
}

/* ── Premium loader: pulsing demon silhouette + blur-out exit ───────── */
.loading {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.7);
    transition: opacity 0.45s var(--ease-smooth), backdrop-filter 0.45s ease;
}
.loading.fade-out {
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}
.demon-loader {
    position: relative;
    width: 96px;
    height: 96px;
    color: var(--demon-red);
    display: flex;
    align-items: center;
    justify-content: center;
}
.demon-loader > svg:first-child {
    width: 100%;
    height: 100%;
    animation: demon-pulse 1.4s var(--ease-smooth) infinite;
    filter: drop-shadow(0 0 14px rgba(255, 42, 42, 0.85));
}
.demon-loader-pulse {
    position: absolute;
    inset: -10%;
    border: 2px solid var(--demon-red);
    border-radius: 50%;
    opacity: 0.5;
    animation: demon-ring 1.4s ease-out infinite;
}
.loading .spinner { display: none; } /* hide legacy spinner */
@keyframes demon-pulse {
    0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 8px rgba(255, 42, 42, 0.6)); }
    50%      { transform: scale(1.12); filter: drop-shadow(0 0 22px rgba(255, 42, 42, 1));  }
}
@keyframes demon-ring {
    0%   { transform: scale(0.8); opacity: 0.55; }
    100% { transform: scale(1.4); opacity: 0;    }
}

/* ── Buttons: scale-down on press, red glow on hover ────────────────── */
button,
.add-to-cart-btn,
.filter-btn,
.checkout-btn,
.cart-icon {
    transition:
        transform 0.18s var(--ease-spring),
        box-shadow 0.25s var(--ease-smooth),
        background 0.25s var(--ease-smooth),
        border-color 0.25s var(--ease-smooth);
}
button:active,
.add-to-cart-btn:active,
.filter-btn:active,
.checkout-btn:active,
.cart-icon:active { transform: scale(0.95); }

.add-to-cart-btn:not(:disabled):hover,
.checkout-btn:hover,
.filter-btn.active {
    box-shadow: 0 0 0 1px var(--demon-red), var(--demon-glow);
}

/* ── Product card entrance (used by .reveal class added in JS) ──────── */
.product-card {
    will-change: transform, opacity;
}
.product-card.reveal {
    animation: card-rise 0.55s var(--ease-smooth) both;
}
@keyframes card-rise {
    0%   { opacity: 0; transform: translateY(28px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Empty state fade-in */
.empty-cart {
    animation: fade-in-soft 0.6s var(--ease-smooth) both;
}
@keyframes fade-in-soft {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* ── Cart icon "pop" when an item is added ──────────────────────────── */
.cart-icon.cart-pop { animation: cart-pop 0.5s var(--ease-spring); }
.cart-badge.badge-pop { animation: badge-pop 0.45s var(--ease-spring); }
@keyframes cart-pop {
    0%   { transform: scale(1);    box-shadow: 0 0 0 0    rgba(255, 42, 42, 0); }
    40%  { transform: scale(1.18); box-shadow: 0 0 0 10px rgba(255, 42, 42, 0.18); }
    100% { transform: scale(1);    box-shadow: 0 0 0 0    rgba(255, 42, 42, 0); }
}
@keyframes badge-pop {
    0%   { transform: scale(1);  }
    50%  { transform: scale(1.6); }
    100% { transform: scale(1);  }
}

/* ── Cart panel: glassmorphism + spring slide-in ────────────────────── */
.cart-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-left: 1px solid var(--glass-border);
    box-shadow: -20px 0 60px -10px rgba(255, 0, 0, 0.25);
    transition: transform 0.45s var(--ease-spring);
}
.cart-panel.active { transform: translateX(0); }

.cart-item {
    animation: cart-item-in 0.4s var(--ease-spring) both;
    border: 1px solid rgba(255, 42, 42, 0.18);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
@keyframes cart-item-in {
    0%   { opacity: 0; transform: translateX(40px); }
    100% { opacity: 1; transform: translateX(0);    }
}

/* Floating glowing checkout footer */
.cart-footer {
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(15, 0, 0, 0.85) 35%,
        rgba(15, 0, 0, 0.95) 100%);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.checkout-btn {
    background: linear-gradient(180deg, var(--demon-red), var(--demon-deep));
    box-shadow: 0 0 0 1px rgba(255, 42, 42, 0.6), 0 12px 30px -8px rgba(255, 42, 42, 0.6);
    border: none;
    position: relative;
    overflow: hidden;
}
.checkout-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
        transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s var(--ease-smooth);
}
.checkout-btn:hover::after { transform: translateX(100%); }

/* ── Glass stock pills (override base styling) ──────────────────────── */
.stock-pill {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 42, 42, 0.35);
    color: #ffd9d9;
}
.stock-pill.stock-available {
    background: rgba(0, 200, 83, 0.10);
    border-color: rgba(0, 200, 83, 0.45);
    color: #b6f5c8;
}
.stock-pill.stock-reserved {
    background: rgba(255, 170, 0, 0.10);
    border-color: rgba(255, 170, 0, 0.55);
    color: #ffe0a8;
}
.stock-pill.stock-out {
    background: rgba(238, 29, 35, 0.12);
    border-color: rgba(238, 29, 35, 0.55);
    color: #ffb0b0;
}

/* ── Filter buttons: red glow on active ─────────────────────────────── */
.filter-btn.active {
    background: linear-gradient(180deg, var(--demon-red), var(--demon-deep));
    border-color: var(--demon-red);
    color: #fff;
}
.filter-btn.sale-btn { font-weight: 800; }

/* ── Cart icon micro-glow on hover ──────────────────────────────────── */
.cart-icon:hover {
    border-color: var(--demon-red);
    box-shadow: var(--demon-glow);
}

/* ── Animated emoji assets (Noto Animated GIFs from Google) ─────────── */
.fire-anim {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.18em;
    margin-right: 0.25em;
    filter: drop-shadow(0 0 6px rgba(255, 80, 30, 0.7));
}
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2.2rem 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
}
.empty-cart-anim {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(255, 42, 42, 0.35));
    animation: empty-float 3.2s ease-in-out infinite;
}
@keyframes empty-float {
    0%, 100% { transform: translateY(0)    rotate(-2deg); }
    50%      { transform: translateY(-8px) rotate(2deg);  }
}
/* Hide the legacy emoji icon if it ever sneaks back into markup */
.empty-cart-icon { display: none; }

/* ── Cart "bubble" geometry — aggressive rounded corners ────────────── */
.cart-panel {
    border-top-left-radius: 28px;
    border-bottom-left-radius: 28px;
    overflow: hidden;
}
.cart-panel-header {
    border-top-left-radius: 28px;
}
.cart-footer {
    border-bottom-left-radius: 28px;
}
.cart-item {
    border-radius: 18px;
}
.checkout-btn {
    border-radius: 16px;
}
@media (max-width: 480px) {
    /* On phones the panel is full-width — round all four corners. */
    .cart-panel {
        border-radius: 24px 24px 0 0;
    }
    .cart-panel-header { border-radius: 24px 24px 0 0; }
    .cart-footer       { border-radius: 0; }
}

/* ── Cart badge polish ──────────────────────────────────────────────── */
.cart-badge {
    min-width: 22px;
    padding: 0 6px;
    font-variant-numeric: tabular-nums;
    transition: background 0.2s ease, transform 0.2s ease;
}
.cart-badge--empty {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.6);
}

/* ════════════════════════════════════════════════════════════════════════
   "Пусто" — empty product list state.
   Centered demon + label, fills the remaining viewport so it's the focal
   point of the page when the catalog is empty.
   ════════════════════════════════════════════════════════════════════════ */
.empty-state {
    /* Span all grid columns regardless of breakpoint. */
    grid-column: 1 / -1;
    /* Fill remaining viewport (header is ~72px, filter row ~56px). */
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    padding: 2rem 1rem;
    text-align: center;
    animation: fade-in-soft 0.55s var(--ease-smooth) both;
}

.empty-state__demon-wrap {
    position: relative;
    width: 168px;
    height: 168px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.empty-state__demon {
    position: relative;
    z-index: 1;
    width: 144px;
    height: 144px;
    object-fit: contain;
    /* Subtle desaturation + red glow → "sad streetwear" mood. */
    filter:
        drop-shadow(0 8px 24px rgba(255, 42, 42, 0.45))
        drop-shadow(0 0 14px rgba(255, 42, 42, 0.35))
        saturate(0.85);
    animation: empty-demon-float 4s ease-in-out infinite;
}
@keyframes empty-demon-float {
    0%, 100% { transform: translateY(0)    rotate(-3deg); }
    50%      { transform: translateY(-10px) rotate(3deg); }
}

/* Flickering red halo behind the demon */
.empty-state__halo {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background:
        radial-gradient(circle at center,
            rgba(255, 42, 42, 0.35) 0%,
            rgba(255, 42, 42, 0.15) 40%,
            transparent 70%);
    filter: blur(6px);
    animation: empty-halo-pulse 2.4s ease-in-out infinite;
}
@keyframes empty-halo-pulse {
    0%, 100% { opacity: 0.55; transform: scale(0.95); }
    45%      { opacity: 0.95; transform: scale(1.08); }
    55%      { opacity: 0.45; transform: scale(1.02); } /* flicker */
}

.empty-state__label {
    margin: 0;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #cccccc;
    text-shadow: 0 0 18px rgba(255, 42, 42, 0.35);
}

@media (max-width: 480px) {
    .empty-state__demon-wrap { width: 140px; height: 140px; }
    .empty-state__demon      { width: 120px; height: 120px; }
}


/* ════════════════════════════════════════════════════════════════════════
   BAZA PREMIUM REFACTORING — final visual layer.
   This block overrides the legacy header / filter / product-card / cart
   styles to match the reference designs (BAZA shop + cart screen).
   ════════════════════════════════════════════════════════════════════════ */

/* ── Top header ──────────────────────────────────────────────────────── */
header.top-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: rgba(0, 0, 0, 0.92);
    border-bottom: 1px solid rgba(255, 42, 42, 0.18);
    box-shadow: 0 8px 28px -16px rgba(255, 42, 42, 0.45);
}

.top-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.top-header .logo-fire {
    width: 1.55rem;
    height: 1.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-red);
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 0 14px rgba(255, 42, 42, 0.55);
    animation: fire-flicker 1.8s ease-in-out infinite;
}
.top-header .logo-fire svg { width: 100%; height: 100%; }
.top-header .logo-text { color: #fff; }

@keyframes fire-flicker {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(255, 80, 30, 0.7)); }
    35%      { transform: scale(1.08) rotate(-2deg); filter: drop-shadow(0 0 14px rgba(255, 110, 30, 0.95)); }
    65%      { transform: scale(0.97) rotate(2deg); filter: drop-shadow(0 0 8px rgba(255, 60, 30, 0.6)); }
}

/* Search bar */
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #0d0d0d;
    border: 1px solid #1f1f1f;
    border-radius: 999px;
    padding: 0.45rem 0.55rem 0.45rem 1.1rem;
    transition: border-color 0.2s ease, box-shadow 0.25s ease;
    min-width: 0;
}
.search-wrap:focus-within {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(238, 29, 35, 0.18);
}
.search-wrap input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    padding: 0.25rem 0.4rem 0.25rem 0;
}
.search-wrap input::placeholder { color: #6e6e6e; }
.search-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #b8b8b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}
.search-btn:hover { color: #fff; background: rgba(255,255,255,0.06); }

/* Cart icon button — round, with floating red badge */
.top-header .cart-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    background: #0d0d0d;
    border: 1px solid #1f1f1f;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.top-header .cart-icon i { font-size: 1.05rem; }
.top-header .cart-icon:hover {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 1px var(--accent-red), 0 0 22px -4px var(--accent-red-glow);
}
.top-header .cart-icon .cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(238, 29, 35, 0.7), 0 0 0 2px #000;
}
.cart-badge--empty {
    background: rgba(255, 255, 255, 0.18) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 0 0 2px #000 !important;
}

/* ── Category bar ────────────────────────────────────────────────────── */
.category-bar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 1.1rem 0 0.9rem;
    padding: 0;
    background: transparent;
    border: none;
    overflow: visible;
}
.cat-btn {
    --cat-pad: 0.85rem 0.5rem;
    padding: var(--cat-pad);
    background: #0a0a0a;
    border: 1px solid #1f1f1f;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #fff;
    transition: transform 0.18s var(--ease-spring), border-color 0.2s, box-shadow 0.25s, background 0.2s;
    min-height: 84px;
    text-align: center;
}
.cat-btn:hover {
    border-color: var(--accent-red);
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px var(--accent-red), 0 0 22px -6px var(--accent-red-glow);
}
.cat-btn:active { transform: scale(0.96); }
.cat-btn .cat-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-red);
    font-size: 1.15rem;
}
.cat-btn .cat-icon svg { width: 100%; height: 100%; }
.cat-btn .cat-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #d8d8d8;
    line-height: 1.15;
    white-space: nowrap;
}
.cat-btn.active {
    background: linear-gradient(180deg, rgba(238,29,35,0.22), rgba(238,29,35,0.06));
    border-color: var(--accent-red);
    box-shadow: 0 0 0 1px var(--accent-red), 0 0 24px -4px var(--accent-red-glow), inset 0 0 22px rgba(238, 29, 35, 0.18);
}
.cat-btn.active .cat-label { color: #fff; }

/* ── Trust row ───────────────────────────────────────────────────────── */
.trust-row {
    list-style: none;
    margin: 0.2rem 0 1.4rem;
    padding: 0.85rem 1rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    background: #0a0a0a;
    border: 1px solid #1f1f1f;
    border-radius: 18px;
}
.trust-row li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.trust-row li i {
    color: var(--accent-red);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.trust-row li span {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    line-height: 1.2;
    color: #b8b8b8;
}
.trust-row li b { color: #fff; }

/* ── Section title with fire ─────────────────────────────────────────── */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #fff;
    margin: 0.4rem 0 1rem;
}
.section-fire {
    width: 1.6rem;
    height: 1.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: fire-flicker 1.8s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 80, 30, 0.7));
}
.section-fire svg { width: 100%; height: 100%; }

/* ── Product card overhaul ───────────────────────────────────────────── */
.products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
}
@media (min-width: 769px) {
    .products-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (min-width: 1100px) {
    .products-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

.product-card {
    background: linear-gradient(180deg, #0d0d0d 0%, #060606 100%);
    border: 1px solid #1f1f1f;
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.product-card .product-image {
    /* Fixed-ratio square frame so every card is the same size regardless
       of the source photo's dimensions. */
    width: auto;
    aspect-ratio: 1 / 1;
    height: auto;
    /* Transparent so the letterbox area produced by `object-fit: contain`
       inherits the card's dark gradient instead of showing a hard black box.
       Override the legacy `.product-image { background: #050505 }` rule. */
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 16px;
    margin: 0.55rem 0.55rem 0;
    overflow: hidden;
    position: relative;
    /* Center any inline fallback (icon) and the <img> child via flex. */
    display: flex;
    align-items: center;
    justify-content: center;
}
/* The product photograph: always contained + perfectly centered, never
   stretched, never offset to a corner. Higher specificity than the legacy
   `object-fit: cover` rule defined earlier in this file. */
.product-card .product-image > img,
.product-card .product-image img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: 0 auto;
    padding: 0.55rem;
    box-sizing: border-box;
    /* Soft hover zoom \u2014 still contained inside the frame. */
    transition: transform 0.4s ease;
}
.product-card:hover .product-image > img {
    transform: scale(1.04);
}
.product-card .product-image > i {
    /* Box-icon fallback when no photo is available. */
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.18);
}
.product-card .product-image::after { display: none; }

/* Mobile tuning \u2014 make sure the legacy fixed-height rule from line ~750
   doesn't shrink the new aspect-ratio frame. */
@media (max-width: 720px) {
    .product-card .product-image {
        height: auto !important;
        aspect-ratio: 1 / 1;
    }
}

/* SALE badge — top-left red pill with fire icon */
.product-card .sale-badge {
    top: 10px;
    left: 10px;
    right: auto;
    background: linear-gradient(180deg, #ff2a2a, #b40000);
    box-shadow: 0 6px 18px -4px rgba(255, 42, 42, 0.7), 0 0 0 1px rgba(255,255,255,0.08) inset;
    padding: 0.32rem 0.7rem 0.32rem 0.55rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.72rem;
    letter-spacing: 0.8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    z-index: 3;
}
.sale-badge .sale-fire {
    width: 0.95rem;
    height: 0.95rem;
    display: inline-flex;
    animation: fire-flicker 1.8s ease-in-out infinite;
}
.sale-badge .sale-fire svg { width: 100%; height: 100%; }

/* Legacy overlay layer — fully neutralized. Stock info now lives in
   `.product-stock-info` inside `.product-info` and never touches the
   product image area. */
.product-stock.product-stock--overlay,
.product-card .product-image .product-stock,
.product-card .product-image .stock-pill {
    display: none !important;
}

/* ── Informational stock row (sits above the product name) ───────────── */
.product-stock-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    width: 100%;
    margin: 0 0 0.25rem;
    padding: 0.3rem 0.5rem;
    font-family: 'Inter', 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.2px;
    line-height: 1.1;
    color: #b8b8b8;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.product-stock-info:empty { display: none; }

.product-stock-info .stock-entry {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    /* Critical: each entry stays on a single line, no mid-word wraps. */
    white-space: nowrap;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.product-stock-info .stock-entry i {
    font-size: 0.78rem;
    line-height: 1;
    flex-shrink: 0;
}
.product-stock-info .stock-text {
    font-weight: 700;
    letter-spacing: 0.2px;
}
.product-stock-info .stock-sep {
    color: #3a3a3a;
    font-weight: 900;
    line-height: 1;
    user-select: none;
}

.product-stock-info .stock-available { color: #2ecc71; }
.product-stock-info .stock-available i { color: #2ecc71; }
.product-stock-info .stock-reserved  { color: #f39c12; }
.product-stock-info .stock-reserved i { color: #f39c12; }
.product-stock-info .stock-unlimited { color: #b8b8b8; }
.product-stock-info .stock-unlimited i { color: #b8b8b8; }
.product-stock-info .stock-out       { color: #6e6e6e; }
.product-stock-info .stock-out i     { color: #6e6e6e; }

/* When the product is sold out, gray-out the entire row to mirror the
   disabled CTA below. */
.product-stock-info:has(.stock-out) {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.04);
    color: #6e6e6e;
}

/* Narrow phones — keep the row legible on a single line whenever the
   text fits, otherwise let it wrap to two centered lines (never overlap). */
@media (max-width: 380px) {
    .product-stock-info { font-size: 0.66rem; gap: 0.3rem 0.45rem; }
    .product-stock-info .stock-entry i { font-size: 0.7rem; }
}

.product-info {
    padding: 0.85rem 0.95rem 0.9rem;
    gap: 0.35rem;
}
.product-cat {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1.1px;
    color: #6e6e6e;
    text-transform: uppercase;
}
.product-card .product-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #fff;
    min-height: 0;
    -webkit-line-clamp: 2;
}
.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    margin: 0.1rem 0 0.65rem;
}
.product-card .product-price {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--accent-red);
    letter-spacing: 0.5px;
}
.product-card .product-price::after { display: none; }
/* Synthetic old-price was removed per design fine-tuning — keep a no-op
   rule so any legacy markup stays hidden. */
.product-old-price { display: none !important; }

.product-card .add-to-cart-btn {
    background: linear-gradient(180deg, #ee1d23, #8b0000);
    border-radius: 12px;
    padding: 0.85rem 0.7rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.8px;
    box-shadow: 0 8px 22px -8px rgba(255, 42, 42, 0.7), inset 0 0 0 1px rgba(255,255,255,0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.product-card .add-to-cart-btn:hover:not(:disabled) {
    box-shadow: 0 12px 28px -6px rgba(255, 42, 42, 0.9), 0 0 0 1px var(--accent-red);
}

/* ── Mobile tuning ───────────────────────────────────────────────────── */
@media (max-width: 720px) {
    header.top-header {
        grid-template-columns: auto 1fr auto;
        gap: 0.55rem;
        padding: 0.85rem 0.85rem;
    }
    .top-header .logo { font-size: 1.25rem; }
    .top-header .logo-fire { width: 1.35rem; height: 1.35rem; }
    .top-header .cart-icon { width: 44px; height: 44px; }
    .search-wrap { padding: 0.35rem 0.4rem 0.35rem 0.85rem; }
    .search-wrap input { font-size: 0.85rem; }
    .category-bar { grid-template-columns: repeat(3, 1fr); }
    .cat-btn { min-height: 76px; }
    .cat-btn .cat-label { font-size: 0.62rem; letter-spacing: 0.4px; }
    .trust-row { grid-template-columns: repeat(2, 1fr); padding: 0.75rem; }
    .section-title { font-size: 1.15rem; }
    .product-card .product-name { font-size: 0.95rem; }
    .product-card .product-price { font-size: 1.2rem; }
}

@media (max-width: 380px) {
    .category-bar { grid-template-columns: repeat(3, 1fr); }
    .product-stock--overlay .stock-pill { font-size: 0.58rem; padding: 0.18rem 0.45rem; }
}

/* ════════════════════════════════════════════════════════════════════════
   CART PANEL OVERHAUL — bubble shape, top-bar with username, modern rows.
   ════════════════════════════════════════════════════════════════════════ */

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    z-index: 998;
    transition: opacity 0.32s var(--ease-smooth);
}
.cart-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.cart-panel {
    width: 100%;
    max-width: 460px;
    background: #000;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-left: none;
    border-radius: 32px 0 0 32px;
    padding: 0;
    overflow: hidden;
    box-shadow: -24px 0 80px -10px rgba(0, 0, 0, 0.9);
}
@media (max-width: 520px) {
    .cart-panel {
        max-width: 100%;
        border-radius: 0;
    }
}

/* Top bar (Закрыть | username | menu) */
.cart-topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem 1.1rem 0.65rem;
    background: #000;
    border-bottom: none;
}
.cart-close-link {
    background: none !important;
    border: none !important;
    color: var(--accent-red) !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    padding: 0.35rem 0.4rem !important;
    text-align: left;
}
.cart-close-link:hover { color: #ff5050 !important; background: transparent !important; }
.cart-app-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
    min-width: 0;
}
.cart-username {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.6px;
    color: #fff;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-app-sub {
    font-size: 0.7rem;
    color: #6e6e6e;
    letter-spacing: 0.2px;
}
/* Legacy 3-dot menu button — fully removed from markup; keep this rule
   as a safety net so any stale instance never renders. */
.cart-menu-btn { display: none !important; }

/* Right-side "Закрыть" label (replaces the old ⋯ menu icon).
   Visually mirrors the left close link but right-aligned. */
.cart-close-link--right {
    text-align: right !important;
    justify-self: end;
}

/* Cart header (🔥 КОРЗИНА + trash) */
.cart-panel .cart-panel-header {
    background: transparent;
    padding: 0.5rem 1.1rem 1rem;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}
.cart-panel .cart-panel-header h2 {
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.35rem;
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.cart-title-fire {
    width: 1.55rem;
    height: 1.55rem;
    background: var(--accent-red);
    border-radius: 50%;
    padding: 4px;
    display: inline-flex;
    box-shadow: 0 0 14px rgba(255, 42, 42, 0.55);
    animation: fire-flicker 1.8s ease-in-out infinite;
}
.cart-title-fire svg { width: 100%; height: 100%; }
.cart-trash-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    color: #b8b8b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.cart-trash-btn:hover:not(:disabled) {
    color: var(--accent-red);
    border-color: var(--accent-red);
}
.cart-trash-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Cart items area */
.cart-panel .cart-items {
    padding: 0.5rem 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.cart-panel .cart-item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 0.9rem;
    padding: 0.85rem;
    background: #0c0c0c;
    border: 1px solid #1c1c1c;
    border-radius: 22px;
    margin: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.cart-panel .cart-item-image {
    width: 96px;
    height: 96px;
    border-radius: 16px;
    background: #050505;
    border: 1px solid #1a1a1a;
    overflow: hidden;
}
.cart-item-main {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}
.cart-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.cart-panel .cart-item-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.cart-item-close {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #b8b8b8;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.cart-item-close:hover { color: #fff; background: rgba(255,255,255,0.06); }
.cart-panel .cart-item-price {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.15rem;
    color: var(--accent-red);
    text-decoration: none;
    letter-spacing: 0.3px;
}
.cart-panel .quantity-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.15rem;
}
.cart-panel .quantity-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #161616;
    border: 1px solid #262626;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.cart-panel .quantity-btn:hover {
    background: #1f1f1f;
    border-color: var(--accent-red);
    color: #fff;
}
.cart-panel .quantity-btn:active { transform: scale(0.92); }
.cart-panel .quantity-value {
    min-width: 24px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
}

/* Cart footer */
.cart-panel .cart-footer {
    background: #000;
    border-top: none;
    padding: 0.5rem 1.1rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
}
.clear-all-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #1f1f1f;
    color: var(--accent-red);
    border-radius: 22px;
    padding: 0.85rem 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    transition: background 0.2s, border-color 0.2s;
}
.clear-all-btn:hover {
    background: rgba(238, 29, 35, 0.06);
    border-color: rgba(238, 29, 35, 0.45);
}
.cart-panel .cart-total {
    background: #0c0c0c;
    border: 1px solid #1c1c1c;
    border-radius: 22px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}
.cart-panel .cart-total span:first-child {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    color: #fff;
}
.cart-panel .cart-total span:last-child {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--accent-red);
    text-decoration: none;
    letter-spacing: 0.4px;
    /* Disable any inherited underline / strike artifacts */
    text-decoration-line: none;
    -webkit-text-decoration-line: none;
    border: none;
    background: none;
}
.cart-panel .checkout-btn {
    width: 100%;
    background: linear-gradient(180deg, #ee1d23, #b40000);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 1.15rem 1rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    box-shadow: 0 18px 38px -10px rgba(255, 42, 42, 0.75), inset 0 0 0 1px rgba(255,255,255,0.07);
}
.cart-panel .checkout-btn i { font-size: 1rem; }
.cart-panel .checkout-btn:hover:not(:disabled) {
    box-shadow: 0 22px 44px -8px rgba(255, 42, 42, 0.95), inset 0 0 0 1px rgba(255,255,255,0.12);
}
.cart-panel .checkout-btn:disabled {
    background: #1a1a1a;
    color: #6e6e6e;
    box-shadow: none;
}

/* Empty cart — sad demon + "Пусто" */
.cart-panel .empty-cart {
    flex: 1;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    padding: 2.5rem 1rem;
}
.empty-cart-demon-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.empty-cart-demon {
    position: relative;
    z-index: 1;
    width: 132px;
    height: 132px;
    object-fit: contain;
    filter:
        drop-shadow(0 8px 24px rgba(255, 42, 42, 0.55))
        drop-shadow(0 0 14px rgba(255, 42, 42, 0.35))
        saturate(0.9);
    animation: empty-demon-float 4s ease-in-out infinite;
}
.empty-cart-halo {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background:
        radial-gradient(circle at center,
            rgba(255, 42, 42, 0.38) 0%,
            rgba(255, 42, 42, 0.15) 40%,
            transparent 70%);
    filter: blur(8px);
    animation: empty-halo-pulse 2.4s ease-in-out infinite;
}
.empty-cart-label {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: clamp(1.5rem, 5vw, 2rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #e0e0e0;
    text-shadow: 0 0 18px rgba(255, 42, 42, 0.4);
}
/* Hide the legacy floating ghost gif if it ever re-mounts. */
.empty-cart .empty-cart-anim { display: none; }


/* ════════════════════════════════════════════════════════════════════════
   MINIMALIST NEON FRAME — anchored directly to the product photograph.
   No decorative outer container, no HUD corner cutouts, no inner gloss
   layer. Just a thin, rounded, glowing red border that *is* the image
   boundary. The frame and the image share the same physical edge.
   ════════════════════════════════════════════════════════════════════════ */

.product-img-frame {
    --frame-radius: 22px;
    --frame-glow: rgba(238, 29, 35, 0.55);
    --frame-color: #ff4b4b;

    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--frame-radius);
    /* Single thin border drawn with box-shadow (won't shift layout when
       it grows on hover). Plus an outer soft red glow. */
    box-shadow:
        0 0 0 1.5px var(--frame-color),
        0 0 14px -2px var(--frame-glow),
        0 0 28px -10px rgba(255, 110, 30, 0.35);
    overflow: hidden;
    background: transparent;
    isolation: isolate;
    transition:
        box-shadow 0.35s ease,
        transform 0.35s cubic-bezier(.2,.8,.2,1);
    animation: frame-breathe 3.4s ease-in-out infinite;
}

/* Soft animated halo beneath the frame \u2014 gives life without adding any
   visible decoration on top of the image. */
.product-img-frame::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(255, 75, 75, 0.18) inset;
    z-index: 3;
}

/* Inner holder \u2014 simply hosts the <img> with the same rounded edge. */
.product-img-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}
.product-img-inner img,
.product-img-inner > img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: 0 auto;
    padding: 0.5rem;
    box-sizing: border-box;
    border-radius: inherit;
    transition: transform 0.45s cubic-bezier(.2,.8,.2,1), filter 0.35s ease;
}
.product-img-inner > i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.18);
}

/* ── Hover / focus / tap: intensify the glow, scale the image ───────── */
.product-card:hover .product-img-frame,
.product-card:focus-within .product-img-frame,
.product-card:active .product-img-frame {
    box-shadow:
        0 0 0 1.5px var(--frame-color),
        0 0 22px rgba(238, 29, 35, 0.85),
        0 0 44px -6px rgba(255, 110, 30, 0.55);
    transform: translateY(-2px);
    animation-duration: 1.8s;
}
.product-card:hover .product-img-inner img,
.product-card:active .product-img-inner img {
    transform: scale(1.06);
    filter: drop-shadow(0 6px 14px rgba(238, 29, 35, 0.4)) saturate(115%);
}

/* ── Keyframes ──────────────────────────────────────────────────────── */
@keyframes frame-breathe {
    0%, 100% {
        box-shadow:
            0 0 0 1.5px var(--frame-color),
            0 0 14px -2px var(--frame-glow),
            0 0 28px -10px rgba(255, 110, 30, 0.35);
    }
    50% {
        box-shadow:
            0 0 0 1.5px var(--frame-color),
            0 0 22px -2px rgba(238, 29, 35, 0.75),
            0 0 40px -8px rgba(255, 110, 30, 0.5);
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-img-frame { animation: none !important; }
    .product-img-inner img { transition: none !important; }
}

/* The legacy `.product-card .product-image > img` rule targets a direct
   child <img>; now the <img> lives inside `.product-img-inner`, so we
   hide any stray direct-child to avoid duplication. */
.product-card .product-image > img { display: none !important; }


