﻿/* =========================================================
   PRODUCTS.CSS (UPDATED + CLEANED)
   - Fixes button colors (qty + info) to match theme
   - Fixes LIGHT MODE visibility issues (was too white)
   - Removes duplicate/conflicting rules + broken braces
   - Keeps ONLY products page styling (no drawer shell here)
   ========================================================= */

/* ================= PRODUCTS PAGE LAYOUT ================= */

.products-header {
    padding: 12px 22px;
}

    .products-header .header-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

.header-title-block {
    display: flex;
    flex-direction: column;
}

/* Center search zone */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 24px;
}

/* Right block tweaks */
.products-header-right {
    gap: 14px;
}

/* main content */
.products-main {
    padding-top: 80px; /* space for fixed header */
    padding-bottom: 64px; /* space for footer */
    max-width: 1480px;
    margin: 0 auto;
}

/* =========================================================
   THEME ACCENT (fallback-safe)
   ========================================================= */
:root {
    --accent: var(--primary, #f07a2b);
    --accentGlow: color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ================= SEARCH PILL ================= */

.products-search-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 12px 28px rgba(15,23,42,0.85);
}

/* dark / light backgrounds */
body.dark .products-search-pill {
    background: radial-gradient(circle at top left, rgba(15,23,42,0.88), rgba(15,23,42,0.98));
    color: #e5e7eb;
}

body:not(.dark) .products-search-pill {
    background: rgba(255,255,255,0.98);
    color: #0f172a;
}

.products-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    opacity: 0.7;
}

.products-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
    font-size: 14px;
}

    .products-search-input::placeholder {
        color: #6b7280;
    }

.products-search-btn,
.products-filter-btn {
    border-radius: 999px;
    border: none;
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .18s ease, background .12s ease, opacity .18s ease;
}

/* Search button = glass secondary */
.products-search-btn {
    background: transparent;
    color: inherit;
}

/* Filter button = primary pill */
.products-filter-btn {
    background: radial-gradient(circle at top left, var(--primary), var(--primary-soft));
    color: #f9fafb;
    box-shadow: 0 12px 26px color-mix(in srgb, var(--primary) 60%, transparent);
}

    .products-filter-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 18px 40px color-mix(in srgb, var(--primary) 75%, transparent);
    }

/* ================= SUMMARY STRIP ================= */

.products-summary-strip {
    display: flex;
    gap: 10px;
    padding: 18px 24px 8px 24px;
    flex-wrap: wrap;
}

.products-summary-pill {
    min-width: 120px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.55);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* dark */
body.dark .products-summary-pill {
    background: radial-gradient(circle at top, rgba(15,23,42,0.85), rgba(15,23,42,0.98));
    color: #e5e7eb;
    box-shadow: 0 12px 26px rgba(15,23,42,0.9);
}

/* light */
body:not(.dark) .products-summary-pill {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    box-shadow: 0 10px 20px rgba(148,163,184,0.4);
}

.pill-accent {
    border-color: color-mix(in srgb, var(--primary) 70%, rgba(148,163,184,0.7));
}

.pill-label {
    opacity: 0.75;
}

.pill-value {
    font-weight: 700;
    font-size: 13px;
}

/* ================= PRODUCT GROUPS ================= */

.products-shell {
    padding: 8px 24px 24px 24px;
}

.product-group {
    margin-bottom: 26px;
}

.product-group-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

.group-title {
    font-size: 18px;
    font-weight: 700;
}

body.dark .group-title {
    color: #f9fafb;
}

body:not(.dark) .group-title {
    color: #0f172a;
}

.group-count {
    font-size: 12px;
    opacity: 0.7;
}

/* responsive grid of cards */
.product-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

/* ================= PRODUCT CARD ================= */

.product-card {
    position: relative;
}

.product-card-inner {
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform .18s ease, box-shadow .22s ease, border-color .18s ease;
}

/* dark card */
body.dark .product-card-inner {
    background: #ffffff15;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.65);
}

/* light card */
body:not(.dark) .product-card-inner {
    background: radial-gradient(circle at top left, color-mix(in srgb, var(--primary-soft2) 10%, rgba(255,255,255,0.96)), rgba(248,250,252,0.98));
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 10px 24px rgba(15,23,42,0.08);
}

    /* Hover glow (theme-based) */
    body.dark .product-card-inner:hover,
    body:not(.dark) .product-card-inner:hover {
        border-color: var(--primary);
        transform: translateY(-3px);
    }

body.dark .product-card-inner:hover {
    box-shadow: 0 0 18px color-mix(in srgb, var(--primary) 65%, transparent), 0 22px 50px rgba(0,0,0,0.55);
}

body:not(.dark) .product-card-inner:hover {
    box-shadow: 0 0 16px color-mix(in srgb, var(--primary) 55%, transparent), 0 18px 40px rgba(15,23,42,0.14);
}

.product-image-wrap {
    width: 100%;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

    .product-image-wrap img {
        max-height: 160px;
        max-width: 90%;
        object-fit: contain;
        transition: transform .2s ease;
    }

.product-card:hover .product-image-wrap img {
    transform: scale(1.02);
}

.product-card-body {
    padding: 10px 12px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.product-brand {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    opacity: 0.75;
    display: none !important;
}

.product-name {
    font-size: 15px;
    font-weight: 700;
    margin-top: 0;
}

.product-meta-row {
    font-size: 11px;
    opacity: .75;
    display: flex;
    gap: 6px;
    align-items: center;
}

.product-dot {
    font-weight: 900;
    opacity: .4;
}

.product-size,
.product-sku {
    font-size: 11px;
    opacity: 0.75;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 6px;
}

.product-price {
    font-size: 15px;
    font-weight: 700;
}

body.dark .product-price {
    color: #ffffff;
}

body:not(.dark) .product-price {
    color: #0f172a;
}

.product-ppu {
    font-size: 11px;
    opacity: 0.8;
}

body.dark .product-ppu {
    color: #cbd5e1;
}

body:not(.dark) .product-ppu {
    color: #475569;
}

.product-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 6px;
}

/* =========================
   QTY CONTROL (FIXED COLORS)
   ========================= */

.qty-control {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    overflow: hidden;
}

/* Base shell (theme split) */
body.dark .qty-control {
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
}

body:not(.dark) .qty-control {
    border: 1px solid rgba(148,163,184,.55);
    background: rgba(15,23,42,.02);
}

.qty-btn {
    width: 36px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease, transform .1s ease, color .12s ease, opacity .12s ease;
}

    /* Hover */
    .qty-btn:hover:not(:disabled) {
        background: rgba(148,163,184,0.16);
        transform: translateY(-1px);
    }

/* Text colors per theme */
body.dark .qty-btn {
    color: rgba(255,255,255,.88);
}

body:not(.dark) .qty-btn {
    color: #0f172a;
}

/* Accent +/- (match theme) */
.card-qty-control .card-plus,
.card-qty-control .card-minus {
    color: var(--accent);
    font-weight: 900;
}

/* Input */
.card-qty {
    width: 36px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 13px;
}

body.dark .card-qty {
    color: rgba(255,255,255,.92);
}

body:not(.dark) .card-qty {
    color: #0f172a;
}

/* Disabled */
.qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

/* Highlight shell when qty > 0 */
.product-card.has-qty .qty-control {
    border-color: color-mix(in srgb, var(--accent) 55%, rgba(148,163,184,.35));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 10%, transparent), 0 10px 30px rgba(0,0,0,.14);
}

/* ================= INFO BUTTON (FIXED COLORS) ================= */

.product-card .card-info {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .16s ease;
}

/* Theme split */
body.dark .product-card .card-info {
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: var(--accent);
}

body:not(.dark) .product-card .card-info {
    border: 1px solid rgba(148,163,184,.55);
    background: rgba(15,23,42,.02);
    color: var(--accent);
}

.product-card .card-info:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, rgba(148,163,184,.35));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 10%, transparent);
    transform: translateY(-1px);
}

/* ================= PROMO / NEW ================= */

.promo-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 999px;
    z-index: 3;
}

.promo-ends-today {
    position: absolute;
    top: 36px;
    left: 10px;
    background: #f59e0b;
    color: #000;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    animation: pulseGlow 1.5s infinite;
    z-index: 3;
}

.promo-ends-soon {
    position: absolute;
    top: 36px;
    left: 10px;
    background: #fde68a;
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 3;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 rgba(245,158,11,0.35);
    }

    50% {
        box-shadow: 0 0 12px rgba(245,158,11,0.7);
    }

    100% {
        box-shadow: 0 0 0 rgba(245,158,11,0.35);
    }
}

/* PRICES */
.product-old-price {
    text-decoration: line-through;
    color: #9ca3af;
    margin-right: 6px;
    font-size: 13px;
}

.product-price.promo {
    color: #dc2626;
    font-weight: 800;
    font-size: 16px;
}

/* New star (single definition only) */
.new-star {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    z-index: 3;
    background: #22c55e;
    color: #fff;
    box-shadow: 0 6px 18px rgba(34,197,94,.45);
}

body.dark .new-star {
    background: #fde047; /* optional: gold in dark */
    color: #020617;
    box-shadow: 0 6px 18px rgba(253,224,71,.35);
}

/* ================= EMPTY ================= */

.products-empty {
    padding: 40px 0;
    text-align: center;
    opacity: 0.7;
}

/* ================= PRODUCTS TOOLBAR ================= */

.products-toolbar {
    position: sticky;
    top: 72px; /* height of Site.Master header */
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    margin-bottom: 18px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Left side (search) */
.products-toolbar-left {
    flex: 1;
}

/* Right side (summary pills) */
.products-toolbar-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ================= LOGIN LOCK PRICE ================= */

.product-price-locked {
    font-size: 0.85rem;
    color: #9ca3af;
    background: rgba(0,0,0,0.04);
    padding: 6px 10px;
    border-radius: 8px;
    width: 100%;
    text-align: center;
}

/* ================= FILTER LIST FIXES ================= */

/* Base text color for filter items */
.categories-item,
.categories-item label,
.categories-item span {
    color: inherit;
}

/* LIGHT MODE */
body:not(.dark) .categories-item,
body:not(.dark) .categories-item label,
body:not(.dark) .categories-item span {
    color: #0f172a;
}

/* DARK MODE */
body.dark .categories-item,
body.dark .categories-item label,
body.dark .categories-item span {
    color: #e5e7eb;
}

    /* Hover feedback (dark mode) */
    body.dark .categories-item:hover,
    body.dark .categories-item label:hover {
        background: rgba(255,255,255,0.08);
    }

/* Checkbox */
.categories-item input[type="checkbox"] {
    accent-color: var(--primary);
}

/* FILTER LIST ROW (name left, count right) */
.categories-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.categories-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* Count pill (fixed for LIGHT MODE too) */
.cat-count {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2px;
}

body.dark .cat-count {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.88);
}

body:not(.dark) .cat-count {
    background: rgba(15,23,42,0.04);
    border: 1px solid rgba(148,163,184,0.45);
    color: #0f172a;
}

.categories-item.is-zero {
    opacity: 0.45;
    pointer-events: none;
}

/* ================= CARD ANIMATIONS ================= */

.product-card {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    animation: cardFadeUp 0.45s ease forwards;
}

    .product-card:nth-child(1) {
        animation-delay: 0.03s;
    }

    .product-card:nth-child(2) {
        animation-delay: 0.06s;
    }

    .product-card:nth-child(3) {
        animation-delay: 0.09s;
    }

    .product-card:nth-child(4) {
        animation-delay: 0.12s;
    }

    .product-card:nth-child(5) {
        animation-delay: 0.15s;
    }

    .product-card:nth-child(6) {
        animation-delay: 0.18s;
    }

@keyframes cardFadeUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Disable heavy hover on touch devices */
@media (hover: none) {
    .product-card-inner:hover {
        transform: none;
        box-shadow: inherit;
    }

    .product-card-inner:active {
        transform: scale(0.97);
    }
}

/* ================= SCROLL MOVE ANIMATION ================= */

.product-group-grid {
    transform: translateY(5px);
    transition: transform 0.6s ease-out;
    will-change: transform;
}

    .product-group-grid.in-view {
        transform: translateY(0);
    }

/* ================= CART BOUNCE ================= */

#CartButton.cart-bounce {
    animation: cartBounce 0.65s ease;
}

@keyframes cartBounce {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.08);
    }

    50% {
        transform: scale(0.96);
    }

    75% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1024px) {
    .categories-columns {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .item-info-body {
        grid-template-columns: minmax(0,1fr);
    }
}

@media (max-width: 900px) {
    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .products-toolbar-right {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .header-center {
        display: none;
    }

    .products-main {
        padding-top: 72px;
    }

    .products-summary-strip {
        padding-inline: 14px;
    }

    .products-shell {
        padding-inline: 14px;
    }

    .products-modal-window {
        width: 94vw !important;
    }
}

/* MOBILE: FORCE 2 COLUMNS */
@media (max-width: 640px) {
    .product-group-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-image-wrap {
        height: 140px;
    }

        .product-image-wrap img {
            max-height: 120px;
        }

    .product-name {
        font-size: 13px;
        line-height: 1.2;
    }

    .product-price {
        font-size: 14px;
    }

    .product-ppu {
        font-size: 10px;
    }

    .card-info,
    .qty-btn {
        width: 30px;
        height: 28px;
        font-size: 14px;
    }

    .card-qty {
        width: 30px;
        font-size: 12px;
    }
}

/* ================= SMOOTH THEME TRANSITION ================= */

html, body, .product-card-inner, .products-search-pill, .products-summary-pill,
.header, .wizard-top-bar, .wizard-body,
.qty-control, .qty-btn, .card-info, .cat-count {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

    /* The fade overlay class added from VB */
    body.theme-fade {
        filter: brightness(0.98);
    }
/* =====================================================
   ITEM INFO (DRAWER CONTENT ONLY)
   - NO drawer shell styling here (that stays in drawer.css)
   ===================================================== */

/* If your drawer has a “body/content” container, this fixes the common
   issue where flex children get pushed down due to missing min-height:0 */
.drawer-body,
.drawer-content,
.drawer-panel-body,
.drawer-panel-content,
.drawer__body,
.drawer__content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start; /* ✅ top aligned */
    min-height: 0; /* ✅ critical for proper scrolling */
}

/* Item info wrapper inside the drawer */
.item-info-drawer,
.products-item-info,
.products-modal-info,
.item-info-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* ✅ top aligned */
    align-items: stretch;
    min-height: 0;
}

/* Optional: title block area inside drawer */
.item-info-header {
    flex: 0 0 auto;
    padding: 14px 16px 10px 16px;
    border-bottom: 1px solid rgba(148,163,184,0.25);
}

/* Main content area: scrolls inside drawer instead of pushing down */
.item-info-body {
    flex: 1 1 auto;
    min-height: 0; /* ✅ critical */
    overflow-y: auto; /* ✅ drawer content scroll */
    padding: 14px 16px 16px 16px;
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 16px;
    align-content: start; /* ✅ prevents content settling at bottom */
}

/* Left column */
.item-info-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: start;
}

/* Image block inside drawer */
.item-info-main-image {
    border-radius: 20px;
    border: 1px solid rgba(148,163,184,0.6);
    background: radial-gradient(circle at top, rgba(15,23,42,1), rgba(15,23,42,0.9));
    height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .item-info-main-image img {
        max-height: 210px;
        max-width: 94%;
        object-fit: contain;
    }

/* Right column */
.item-info-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: start;
}

/* History panel: independent scroll (optional) */
.item-info-history-panel {
    margin-top: 6px;
    max-height: 170px;
    overflow-y: auto;
    font-size: 12px;
}

/* Responsive: drawer gets single column */
@media (max-width: 1024px) {
    .item-info-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =====================================================
   ITEM INFO DRAWER (Products page only)
   Force SIDE drawer (right) instead of bottom-sheet
   ===================================================== */

/* Backdrop: full screen overlay */
#ItemDrawerBackdrop.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none; /* hidden by default */
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* If your drawer.css uses flex bottom-align, kill it */
    align-items: flex-start !important;
    justify-content: flex-end !important;
}

/* Show backdrop when drawer opens (supports multiple open styles) */
#ItemDrawerBackdrop.open,
#ItemDrawerBackdrop.show,
#ItemDrawerBackdrop[aria-hidden="false"] {
    display: block;
}

/* The drawer panel itself: right side, full height */
#ItemDrawer.drawer-panel {
    position: fixed;
    top: 72px; /* match your header height */
    right: 12px;
    width: min(460px, calc(100vw - 24px));
    height: calc(100vh - 84px); /* header + small bottom spacing */
    z-index: 9999;
    border-radius: 18px;
    overflow: hidden;
    /* Start hidden off-canvas */
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .2s ease;
}

/* Open state (works if you toggle aria-hidden OR add open/show) */
#ItemDrawer.open,
#ItemDrawer.show,
#ItemDrawer[aria-hidden="false"] {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Ensure drawer content starts at TOP and scrolls inside */
#ItemDrawer .drawer-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    height: 100%;
    overflow: auto; /* scroll INSIDE drawer */
    padding-bottom: 18px;
}

/* Optional: if you want it FULLSCREEN on mobile */
@media (max-width: 640px) {
    #ItemDrawer.drawer-panel {
        top: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

/* =====================================================
   ITEM DRAWER (CONTENT ONLY) - shell is in drawer.css
   ===================================================== */


    #ItemDrawer .drawer-hero img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 14px;
        display: block;
    }

/* Mobile */
@media (max-width: 520px) {
    #ItemDrawer .drawer-hero {
        height: 240px;
    }
}

#ItemDrawer .drawer-name {
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
    margin-top: 4px;
}

#ItemDrawer .drawer-sub {
    font-size: 12px;
    color: var(--drawer-muted);
    font-weight: 800;
    margin-bottom: 10px;
}

#ItemDrawer .drawer-meta {
    border: 1px solid var(--drawer-border);
    background: var(--drawer-surface2);
    border-radius: 16px;
    padding: 12px;
    margin: 10px 0 12px;
}

    #ItemDrawer .drawer-meta .meta-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 8px;
        border-radius: 12px;
    }

        #ItemDrawer .drawer-meta .meta-row + .meta-row {
            border-top: 1px solid var(--drawer-border);
        }

#ItemDrawer .drawer-price {
    font-size: 22px;
    font-weight: 900;
    margin: 10px 0 12px;
}

#ItemDrawer .drawer-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

#ItemDrawer #DrawerQty {
    width: 52px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 900;
    color: var(--drawer-text);
}
/* =====================================================
   ITEM DRAWER (CONTENT ONLY) - shell is in drawer.css
   ===================================================== */

#ItemDrawer .drawer-hero {
    width: 100%;
    height: 280px;
    border-radius: 18px;
    border: 1px solid var(--drawer-border);
    background: var(--drawer-surface);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

    #ItemDrawer .drawer-hero img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 14px;
        display: block;
    }


#ItemDrawer .drawer-name {
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
    margin-top: 4px;
}

#ItemDrawer .drawer-sub {
    font-size: 12px;
    color: var(--drawer-muted);
    font-weight: 800;
    margin-bottom: 10px;
}

/* ==============================
   ITEM DRAWER: Bigger qty + Apply under
   ============================== */

#ItemDrawer .drawer-qty {
    display: flex;
    flex-direction: column; /* Apply under qty */
    align-items: stretch;
    gap: 12px;
    margin-top: 12px;
}

#ItemDrawer .drawer-qty-control {
    width: 100%;
    justify-content: space-between;
    border-radius: 18px;
}

    #ItemDrawer .drawer-qty-control .qty-btn {
        width: 54px; /* bigger buttons */
        height: 46px;
        font-size: 22px;
        font-weight: 900;
    }

#ItemDrawer #DrawerQty {
    width: 80px;
    height: 46px;
    font-size: 18px;
    font-weight: 900;
}

#ItemDrawer .drawer-apply {
    width: 100%;
    height: 52px;
    font-size: 16px;
    border-radius: 16px;
}

/* Item Drawer footer: fixed bottom controls */
#ItemDrawer .drawer-body {
    padding-bottom: 160px; /* space so content doesn't hide behind footer */
}

/* footer content layout */
#ItemDrawer .drawer-qty-fixed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* keep your bigger buttons */
#ItemDrawer .drawer-qty-control {
    width: 100%;
    justify-content: space-between;
    border-radius: 18px;
}

    #ItemDrawer .drawer-qty-control .qty-btn {
        width: 54px;
        height: 46px;
        font-size: 22px;
        font-weight: 900;
    }

#ItemDrawer #DrawerQty {
    width: 80px;
    height: 46px;
    font-size: 18px;
    font-weight: 900;
}

/* Apply full width in footer */
#ItemDrawer #DrawerApply {
    width: 100%;
    height: 52px;
    font-size: 16px;
    border-radius: 16px;
}
/* =====================================================
   ITEM DRAWER CONTENT (Shell is in drawer.css)
   ===================================================== */

#ItemDrawer.app-drawer {
    top: 72px; /* match header height */
    right: 10px;
    bottom: 10px;
    width: 460px;
    max-width: calc(100vw - 20px);
}

@media (max-width: 520px) {
    #ItemDrawer.app-drawer {
        top: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }
}

/* Big image */
#ItemDrawer .drawer-hero {
    width: 100%;
    height: 280px;
    border-radius: 18px;
    border: 1px solid var(--drawer-border);
    background: var(--drawer-surface);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

@media (max-width: 520px) {
    #ItemDrawer .drawer-hero {
        height: 240px;
    }
}

#ItemDrawer .drawer-hero img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 14px;
    display: block;
}

#ItemDrawer .drawer-name {
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
    margin-top: 2px;
}

#ItemDrawer .drawer-sub {
    font-size: 12px;
    color: var(--drawer-muted);
    font-weight: 800;
    margin-bottom: 10px;
}

/* Footer fixed bottom (drawer.css already sticky, we enhance layout) */
#ItemDrawer .itemdrawer-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Big qty bar */
#ItemDrawer .itemdrawer-qtybar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 16px;
    border: 1px solid var(--drawer-border);
    background: color-mix(in srgb, var(--drawer-bg) 70%, transparent);
    padding: 10px;
}

#ItemDrawer #DrawerQty {
    width: 110px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--drawer-border);
    background: var(--drawer-surface2);
    text-align: center;
    font-weight: 900;
    font-size: 16px;
    color: var(--drawer-text);
    outline: none;
}

#ItemDrawer .itemdrawer-qtybtn {
    width: 64px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--drawer-border-strong);
    background: var(--drawer-surface);
    color: var(--drawer-text);
    font-weight: 1000;
    font-size: 22px;
    cursor: pointer;
    transition: .15s ease;
}

    #ItemDrawer .itemdrawer-qtybtn:hover {
        transform: translateY(-1px);
        border-color: color-mix(in srgb, var(--accent-color) 35%, var(--drawer-border));
        box-shadow: 0 10px 20px rgba(0,0,0,.18);
    }

/* ================= GROUP TITLE (PILL HEADER) ================= */

/* theme-safe accent for this component */
:root {
    --groupAccent: var(--primary, var(--accent, #f07a2b));
}

/* the whole header becomes the pill */
.product-group-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px 10px 18px; /* extra left padding because stripe */
    border-radius: 999px;
    overflow: hidden;
    /* keep it “sitting” like the screenshot */
    margin: 6px 0 14px 0;
}

    /* ✅ LEFT THEME STRIPE */
    .product-group-header::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 10px;
        background: linear-gradient( to bottom, color-mix(in srgb, var(--groupAccent) 92%, #ffffff 8%), color-mix(in srgb, var(--groupAccent) 78%, #000000 22%) );
        border-top-left-radius: 999px;
        border-bottom-left-radius: 999px;
    }

/* background like the image (light + dark) */
body:not(.dark) .product-group-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98));
    border: 1px solid rgba(148,163,184,0.55);
    box-shadow: 0 10px 22px rgba(15,23,42,0.08);
}

body.dark .product-group-header {
    background: radial-gradient(circle at top left, rgba(15,23,42,0.75), rgba(2,6,23,0.92));
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 14px 34px rgba(0,0,0,0.55);
}

/* make the title look like a “left segment” */
.product-group-header .group-title {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .2px;
    background: color-mix(in srgb, var(--groupAccent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--groupAccent) 30%, transparent);
}

/* title text color per theme */
body:not(.dark) .product-group-header .group-title {
    color: #0f172a;
}

body.dark .product-group-header .group-title {
    color: #f8fafc;
}

/* count becomes a small pill on the right */
.product-group-header .group-count {
    position: relative;
    z-index: 1;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    opacity: 0.9;
    border: 1px solid rgba(148,163,184,0.45);
    background: rgba(15,23,42,0.03);
}

body.dark .product-group-header .group-count {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.88);
}

body:not(.dark) .product-group-header .group-count {
    color: #334155;
}

/* optional: hover polish */
.product-group-header:hover {
    border-color: color-mix(in srgb, var(--groupAccent) 35%, rgba(148,163,184,0.55));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--groupAccent) 10%, transparent), 0 14px 30px rgba(15,23,42,0.10);
}

/* ===============================
   FIX: ItemDrawer height (match other drawers)
   =============================== */
#ItemDrawer.app-drawer {
    top: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    height: auto !important;
}

/* =====================================================
   ITEM DRAWER THUMB GALLERY
   ===================================================== */

#ItemDrawer .drawer-thumbwrap {
    margin-top: 10px;
}

#ItemDrawer .drawer-thumbtitle {
    font-size: 12px;
    font-weight: 950;
    color: var(--drawer-muted);
    margin: 0 0 8px 2px;
    letter-spacing: .2px;
}

/* horizontal scroll gallery */
#ItemDrawer .drawer-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scroll-snap-type: x mandatory;
}

    /* scrollbar */
    #ItemDrawer .drawer-thumbs::-webkit-scrollbar {
        height: 10px;
    }

    #ItemDrawer .drawer-thumbs::-webkit-scrollbar-thumb {
        background: color-mix(in srgb, var(--drawer-muted) 20%, transparent);
        border-radius: 10px;
    }

    #ItemDrawer .drawer-thumbs::-webkit-scrollbar-track {
        background: transparent;
    }

/* thumbnail button */
#ItemDrawer .drawer-thumbbtn {
    flex: 0 0 auto;
    width: 84px;
    height: 64px;
    border-radius: 14px;
    border: 1px solid var(--drawer-border);
    background: var(--drawer-surface);
    box-shadow: 0 10px 22px rgba(0,0,0,.08);
    cursor: pointer;
    padding: 6px;
    scroll-snap-align: start;
    transition: .15s ease;
    position: relative;
    overflow: hidden;
}

    #ItemDrawer .drawer-thumbbtn:hover {
        transform: translateY(-1px);
        border-color: color-mix(in srgb, var(--accent-color) 30%, var(--drawer-border));
        box-shadow: 0 14px 28px rgba(0,0,0,.12);
    }

    /* active thumb */
    #ItemDrawer .drawer-thumbbtn.is-active {
        border-color: color-mix(in srgb, var(--accent-color) 45%, var(--drawer-border));
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-color) 18%, transparent), 0 14px 30px rgba(0,0,0,.14);
    }

    #ItemDrawer .drawer-thumbbtn img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 10px;
        background: color-mix(in srgb, var(--drawer-bg) 70%, transparent);
        border: 1px solid var(--drawer-border);
    }

/* =====================================================
   ITEM INFO DRAWER — BIGGER FIXED HERO IMAGE
   (keeps same size even when browser gets smaller)
   ===================================================== */

/* Make the image container always the same height */
#ItemDrawer .drawer-hero {
    width: 100%;
    height: clamp(300px, 36vh, 420px);
    border-radius: 18px;
    border: 1px solid var(--drawer-border);
    background: var(--drawer-surface2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* optional: adds premium depth */
    box-shadow: 0 14px 30px rgba(0,0,0,.12);
}


/* Keep it fixed even when browser shrinks (desktop/tablet) */
@media (max-width: 1100px) {
    #ItemDrawer .drawer-hero {
        height: 340px; /* keep same fixed height */
    }
}


/* Only on very small phones we reduce height (otherwise it may overflow) */
@media (max-width: 520px) {
    #ItemDrawer .drawer-hero {
        height: 240px;
    }
}
/* =====================================================
   ITEM INFO DRAWER — FORCE BIG FIXED HERO (NO SHRINK)
   Put this at the VERY END of products.css
   ===================================================== */

#ItemDrawer .drawer-hero {
    width: 100%;
    height: 360px !important; /* ✅ fixed height */
    min-height: 360px !important; /* ✅ prevents shrink */
    flex: 0 0 auto !important; /* ✅ do not flex-shrink */
    border-radius: 18px;
    border: 1px solid var(--drawer-border);
    background: var(--drawer-surface2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(0,0,0,.12);
}

    #ItemDrawer .drawer-hero img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 14px;
        display: block;
    }

/* ✅ Keep the hero big even on small width (mobile) */
@media (max-width: 520px) {
    #ItemDrawer .drawer-hero {
        height: 360px !important;
        min-height: 360px !important;
        border-radius: 16px;
    }
}

/* =====================================================
   ITEM DRAWER — HERO IMAGE (ONE SOURCE OF TRUTH)
   Put this at the VERY END of products.css
   ===================================================== */

/* Make the hero card always big (fixed) */
#ItemDrawer .drawer-hero {
    width: 100%;
    height: 360px !important;
    min-height: 360px !important;
    flex: 0 0 360px !important; /* ✅ never shrink */
    border-radius: 18px;
    border: 1px solid var(--drawer-border);
    background: var(--drawer-surface);
    box-shadow: 0 10px 26px rgba(0,0,0,.10);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    /* Keep image filling the hero */
    #ItemDrawer .drawer-hero img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        border-radius: 14px;
        background: color-mix(in srgb, var(--drawer-bg) 70%, transparent);
        border: 1px solid var(--drawer-border);
        padding: 10px;
        display: block;
    }

/* ✅ IMPORTANT: do NOT reduce hero size on mobile */
@media (max-width: 520px) {
    #ItemDrawer .drawer-hero {
        height: 360px !important;
        min-height: 360px !important;
        flex: 0 0 360px !important;
    }
}
/* ==============================
   CARD IMAGE CAROUSEL (per card)
   ============================== */
.card-img-stage {
    position: relative;
    width: 100%;
    height: 190px; /* match your current card image height */
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .card-img-stage .card-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 10px;
        display: block;
    }

/* arrows */
.card-img-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,.55);
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: .15s ease;
}

.card-img-prev {
    left: 10px;
}

.card-img-next {
    right: 10px;
}

.product-card-inner:hover .card-img-nav {
    opacity: 1;
    pointer-events: auto;
}

body.dark .card-img-nav {
    background: rgba(15,23,42,.55);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.92);
}

body.dark .product-card-inner:hover .card-img-nav {
    opacity: 1;
}

/* Multi-image badge (hidden by default) */
.card-img-badge {
    display: none;
    position: absolute;
    right: 10px;
    bottom: 10px;
    min-width: 28px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.45);
    background: rgba(255,255,255,.75);
    font-weight: 900;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    z-index: 6;
    user-select: none;
}

body.dark .card-img-badge {
    background: rgba(15,23,42,.55);
    border-color: rgba(255,255,255,.12);
    color: rgba(255,255,255,.95);
}

/* show badge only when JS marks it multi */
.card-img-stage.has-multi .card-img-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-img-stage {
    position: relative;
}

/* image count badge */
.card-img-count {
    position: absolute;
    right: 10px;
    bottom: 10px; /* ✅ moved to bottom-right */
    z-index: 10;
    min-width: 26px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
    font-size: 12px;
    border: 1px solid rgba(148,163,184,.45);
    background: rgba(255,255,255,.82);
    color: rgba(15,23,42,.92);
}

body.dark .card-img-count {
    background: rgba(15,23,42,.55);
    border-color: rgba(255,255,255,.14);
    color: rgba(255,255,255,.92);
}