/**
 * Shop Page Styles — Midway Wholesale
 * Redesigned: mobile-first, CSS variables, unified brand palette
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   CSS VARIABLES — single source of truth for all colours
   ============================================================ */
:root {
    /* Brand palette */
    --navy:           #122b46;
    --navy-dark:      #0c1e31;
    --navy-light:     #1a3a5c;
    --blue:           #19427f;
    --blue-mid:       #2756a8;
    --accent:         #4a7fd4;
    --accent-hover:   #3568b8;

    /* Surfaces */
    --bg:             #eef1f6;
    --bg-card:        #ffffff;
    --bg-header:      #122b46;

    /* Text */
    --text-primary:   #0c1e31;
    --text-secondary: #4a5568;
    --text-muted:     #8a97a8;
    --text-on-dark:   #ffffff;

    /* Borders & shadows */
    --border:         #dde2ea;
    --border-focus:   #4a7fd4;
    --shadow-sm:      0 1px 3px rgba(12, 30, 49, 0.08);
    --shadow-md:      0 4px 14px rgba(12, 30, 49, 0.11);
    --shadow-lg:      0 8px 28px rgba(12, 30, 49, 0.16);

    /* States */
    --danger:         #e53e3e;
    --danger-light:   rgba(229, 62, 62, 0.1);
    --success:        #38a169;

    /* Geometry */
    --radius-sm:      6px;
    --radius:         10px;
    --radius-lg:      14px;

    /* Motion */
    --ease:           cubic-bezier(0.4, 0, 0.2, 1);
    --speed:          0.22s;
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ============================================================
   SHOP HEADER — dark navy bar
   ============================================================ */
.shop-main {
    margin: 0;
    padding: 0;
    width: 100%;
}

.shop-header {
    background: var(--bg-header);
    padding: 0.7rem 1rem;
    position: sticky;
    top: 152px; /* mobile: 2-row navTop ~110px + categories-bar 42px */
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

@media (min-width: 768px) {
    .shop-header { top: 102px; } /* desktop: navTop ~60px + categories-bar 42px */
}

.title-view-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-on-dark);
    margin: 0;
    letter-spacing: -0.01em;
}

/* View toggle */
.view-toggle {
    display: flex;
    gap: 0.4rem;
    background: rgba(255,255,255,0.08);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.view-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background var(--speed) var(--ease);
}

.view-btn i {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.55);
}

.view-btn:hover { background: rgba(255,255,255,0.12); }
.view-btn:hover i { color: rgba(255,255,255,0.85); }

.view-btn.active {
    background: var(--accent);
}

.view-btn.active i { color: #fff; }

/* Search + controls row — appended by JS inside .shop-header */
.shop-controls {
    margin-top: 0.6rem;
}

.search-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    background: rgba(255,255,255,0.10);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: #fff;
    font-family: inherit;
    transition: border-color var(--speed) var(--ease),
                background var(--speed) var(--ease);
}

.search-box input::placeholder { color: rgba(255,255,255,0.45); }

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.14);
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 1.2rem;
    pointer-events: none;
}

/* Items-per-page */
.items-per-page {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.items-per-page span {
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    font-weight: 500;
}

.ipp-btn {
    padding: 5px 9px;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.16);
    color: rgba(255,255,255,0.75);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--speed) var(--ease);
}

.ipp-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.ipp-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Filter toggle button (appended by JS) */
.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.85);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 0.5rem;
    transition: all var(--speed) var(--ease);
}

.filter-toggle:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.filter-toggle i { font-size: 1rem; }

/* ============================================================
   SHOP CONTAINER & PRODUCT GRID — MOBILE FIRST
   ============================================================ */
.shop-container {
    padding: 0.75rem;
    margin: 0 auto;
}

/* 2-column grid on mobile */
.listProduct {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

/* ============================================================
   PRODUCT CARD — GRID VIEW
   ============================================================ */
.listProduct .item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 0.65rem;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform var(--speed) var(--ease),
                box-shadow var(--speed) var(--ease),
                border-color var(--speed) var(--ease);
}

.listProduct .item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.image-container {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f7f9fc;
    margin-bottom: 0.6rem;
}

.listProduct .item img,
.listProduct .item .product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--speed) var(--ease);
}

.listProduct .item:hover img { transform: scale(1.04); }

.listProduct .item h2 {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    line-height: 1.4;
    min-height: 2.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listProduct .item .price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 0.65rem;
}

.listProduct .item button.addCart {
    margin-top: auto;
    width: 100%;
    padding: 0.6rem;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background var(--speed) var(--ease);
}

.listProduct .item button.addCart:hover {
    background: var(--blue-mid);
}

/* ── Per-card quantity selector ── */
.item-qty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border, #dde1ea);
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 32px;
}

.item-qty-btn {
    width: 30px;
    height: 100%;
    background: var(--bg-secondary, #f5f6fa);
    border: none;
    color: var(--text-secondary, #555);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

.item-qty-btn:hover {
    background: var(--navy, #1a2340);
    color: #fff;
}

.item-qty-input {
    width: 100%;
    min-width: 0;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border, #dde1ea);
    border-right: 1px solid var(--border, #dde1ea);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #111);
    background: #fff;
    outline: none;
    height: 100%;
    padding: 0;
    -moz-appearance: textfield;
}

.item-qty-input::-webkit-outer-spin-button,
.item-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* List view qty row */
.list-item-action .item-qty-row {
    width: 100%;
    margin-bottom: 0.5rem;
}



/* Image placeholder */
.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    border-radius: var(--radius-sm);
    background: #f0f2f6;
}

/* ============================================================
   LIST VIEW
   ============================================================ */
.listProduct.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.listProduct.list-view .item {
    width: 100%;
    padding: 0.85rem 1rem;
    flex-direction: column;
}

.list-item-content {
    display: flex;
    flex-direction: row;   /* horizontal even on mobile */
    align-items: center;
    gap: 0.85rem;
    width: 100%;
}

.list-item-image .image-container {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.list-item-details {
    flex: 1;
    min-width: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-item-details h2 {
    font-size: 0.9rem;
    min-height: unset;
    -webkit-line-clamp: 2;
    white-space: normal;
}

.list-item-details .price { font-size: 1rem; font-weight: 700; }

.list-item-details .list-item-description {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-item-action {
    flex-shrink: 0;
    width: auto;
}

.list-item-action .addCart {
    width: auto;
    min-width: 110px;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-controls {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
}

.page-btn,
.page-num-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--speed) var(--ease);
}

.page-btn:hover:not(:disabled),
.page-num-btn:hover:not(.active) {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-num-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    font-weight: 700;
}

.page-btn i { font-size: 1rem; }

/* ============================================================
   SHOPPING CART SIDEBAR — MOBILE FIRST
   ============================================================ */
.cartBar {
    background: var(--navy);
    color: var(--text-on-dark);
    width: 100vw;
    max-width: 100%;
    position: fixed;
    top: 0;
    right: -100vw;
    bottom: 0;
    display: grid;
    grid-template-rows: 68px 1fr 70px;
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
    transition: right 0.38s var(--ease);
    z-index: 10000;
}

/* Header row */
.cartBar h1 {
    margin: 0;
    padding: 0 50px 0 20px;
    font-size: 1rem;
    font-weight: 400;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    position: relative;
}

.cartBar h1::before {
    content: 'Shopping Cart';
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* Close icon */
.cart-close-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    transition: background var(--speed) var(--ease),
                transform var(--speed) var(--ease);
}

.cart-close-icon:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) rotate(90deg);
}

/* Buttons row */
.cartBar .btn {
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.cartBar .btn button {
    border: none;
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    padding: 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: background var(--speed) var(--ease);
}

.cartBar .btn button.checkOut {
    background: var(--accent);
}

.cartBar .btn button.checkOut:hover {
    background: var(--accent-hover);
}

.cartBar .btn button.close {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
}

.cartBar .btn button.close:hover {
    background: rgba(255,255,255,0.2);
}

/* Cart list scrollable area */
.cartBar .listCart {
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 80px;
}

.cartBar .listCart::-webkit-scrollbar { width: 4px; }
.cartBar .listCart::-webkit-scrollbar-track { background: transparent; }
.cartBar .listCart::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* Open state */
body.activeBarcart .cartBar { right: 0; }

/* Overlay — dims page content only, stops at left edge of cart */
body.activeBarcart::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 100vw; /* mobile: cart is full width so overlay hidden */
    background: rgba(0,0,0,0.55);
    z-index: 9999;
}

@media (min-width: 640px) {
    body.activeBarcart::after {
        right: 360px; /* tablet: stop at cart left edge */
    }
}

@media (min-width: 1024px) {
    body.activeBarcart::after {
        right: 400px; /* desktop: stop at cart left edge */
    }
}

/* ============================================================
   CART ITEM STYLES
   ============================================================ */
.listCart .item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.listCart .cart-item-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.listCart .item .image {
    width: 66px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255,255,255,0.08);
}

.listCart .item .image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.listCart .product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.listCart .product-details .name {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    line-height: 1.35;
    cursor: pointer;
}

.listCart .product-details .name:hover {
    text-decoration: underline;
    color: #fff;
}

/* Price details */
.listCart .price-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
}

.listCart .price-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
}

.listCart .price-line .label { color: rgba(255,255,255,0.5); }
.listCart .price-line .value { color: rgba(255,255,255,0.85); font-weight: 600; }

.listCart .price-line.total {
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 2px;
}

.listCart .price-line.total .label,
.listCart .price-line.total .value {
    color: #6fb3ff;
    font-weight: 700;
}

/* Quantity row */
.listCart .quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.listCart .item .quantity {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    flex: 1;
}

.listCart .item .quantity .minus,
.listCart .item .quantity .plus {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 127, 212, 0.3);
    border-radius: 5px;
    cursor: pointer;
    color: #6fb3ff;
    font-weight: 700;
    font-size: 15px;
    transition: background var(--speed) var(--ease);
}

.listCart .item .quantity .minus:hover,
.listCart .item .quantity .plus:hover {
    background: var(--accent);
    color: #fff;
}

.listCart .item .quantity input {
    width: 40px;
    text-align: center;
    padding: 4px;
    border: 1.5px solid rgba(74,127,212,0.3);
    border-radius: 5px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.92);
    font-weight: 600;
    font-size: 0.82rem;
}

.listCart .item .quantity input:focus {
    outline: none;
    border-color: var(--accent);
}

.listCart .quantity-row .delete-icon {
    font-size: 1.2rem;
    color: #fc8181;
    cursor: pointer;
    padding: 7px;
    background: rgba(229,62,62,0.1);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: all var(--speed) var(--ease);
}

.listCart .quantity-row .delete-icon:hover {
    background: rgba(229,62,62,0.22);
    color: #feb2b2;
    transform: scale(1.08);
}

/* ============================================================
   CART STICKY SUBTOTAL
   ============================================================ */
.cart-sticky-summary {
    position: absolute;
    bottom: 70px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--blue-mid) 100%);
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
    z-index: 5;
    animation: slideUpFade 0.28s var(--ease);
}

@keyframes slideUpFade {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cart-sticky-summary .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-sticky-summary .summary-label {
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cart-sticky-summary .summary-value {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
}

/* ============================================================
   FILTER PANEL
   ============================================================ */
.filter-panel {
    background: #fff;
    width: 100vw;
    max-width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: -100vw;
    z-index: 1100;
    overflow-y: auto;
    transition: left 0.35s var(--ease);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.filter-panel.active { left: 0; }

/* Filter header */
.filter-header {
    background: var(--navy);
    padding: 0 18px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.filter-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.close-filter {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--speed) var(--ease),
                transform var(--speed) var(--ease);
}

.close-filter:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.close-filter i { font-size: 1.4rem; }

/* Filter content */
.filter-content {
    padding: 1.5rem 1.25rem;
    flex: 1;
}

.filter-section {
    margin-bottom: 1.75rem;
}

.filter-section h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 0.85rem;
}

.filter-section h5 {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 1rem 0 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Price inputs */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.price-inputs input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color var(--speed) var(--ease);
}

.price-inputs input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.price-inputs span {
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.apply-filter-btn {
    width: 100%;
    padding: 10px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    transition: background var(--speed) var(--ease);
}

.apply-filter-btn:hover { background: var(--blue-mid); }

/* Price presets */
.price-presets {
    margin-top: 0.75rem;
}

.price-presets label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: background var(--speed) var(--ease);
}

.price-presets label:hover { background: var(--bg); }

.price-presets input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--navy);
    cursor: pointer;
    flex-shrink: 0;
}

/* Clear filters */
.clear-filters-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--speed) var(--ease);
}

.clear-filters-btn:hover {
    background: var(--danger-light);
    border-color: var(--danger);
}

/* Filter overlay */
.filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1099;
}

.filter-overlay.active { display: block; }

/* OLD filter tab (keep for compatibility, hide it) */
.filter-tab { display: none; }

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.add-confirmation {
    position: fixed;
    /* sit below the sticky nav (approx 102px: 60px navTop + 42px categories bar) */
    top: 110px;
    right: 1rem;
    background: var(--navy);
    color: #fff;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 2000;
    font-size: 0.88rem;
    font-weight: 500;
    animation: slideInRight 0.28s var(--ease);
    border-left: 4px solid var(--accent);
    max-width: calc(100vw - 2rem);
}

.add-confirmation.fadeOut { opacity: 0; transition: opacity 0.28s; }

@keyframes slideInRight {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.loading-overlay p {
    color: rgba(255,255,255,0.8);
    margin-top: 1rem;
    font-size: 0.9rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   TABLET — min-width: 640px
   ============================================================ */
@media (min-width: 640px) {
    .shop-header { padding: 0.85rem 1.5rem; }
    .title { font-size: 1.4rem; }

    .search-box { flex: 1; max-width: 420px; }

    /* 3 columns */
    .listProduct {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .image-container { height: 160px; }

    .listProduct .item h2 { font-size: 0.88rem; }

    /* Cart sidebar: fixed width */
    .cartBar {
        width: 360px;
        right: -360px;
    }

    .cartBar h1 {
        font-size: 1.15rem;
        padding: 0 55px 0 24px;
    }

    .cartBar h1::before { font-size: 1.15rem; }

    /* Filter panel: sidebar */
    .filter-panel {
        width: 320px;
        left: -320px;
    }

    /* List view: horizontal layout */
    .list-item-content {
        flex-direction: row;
        align-items: center;
        gap: 1.25rem;
    }

    .list-item-details { text-align: left; }

    .list-item-action { flex-shrink: 0; }
    .list-item-action .addCart { width: auto; min-width: 120px; }
}

/* ============================================================
   DESKTOP — min-width: 1024px
   ============================================================ */
@media (min-width: 1024px) {
    .shop-header { padding: 1rem 2rem; }

    .title { font-size: 1.6rem; }

    .search-controls { gap: 1rem; }
    .search-box { max-width: 500px; }

    .shop-container {
        max-width: 1440px;
        margin: 0 auto;
        padding: 1.5rem 2rem;
    }

    /* 4 columns */
    .listProduct {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }

    .image-container { height: 180px; }

    .listProduct .item { padding: 1rem; }
    .listProduct .item h2 { font-size: 0.9rem; }

    .cartBar {
        width: 400px;
        right: -400px;
    }

    .filter-panel { width: 340px; left: -340px; }

    .list-item-image .image-container {
        width: 150px;
        height: 150px;
    }

    .list-item-details h2 { font-size: 1.05rem; }
    .list-item-details .price { font-size: 1.1rem; }
}

/* ============================================================
   LARGE DESKTOP — min-width: 1440px
   ============================================================ */
@media (min-width: 1440px) {
    /* 5 columns on very large screens */
    .listProduct {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============================================================
   SMALL MOBILE — max-width: 380px
   ============================================================ */
@media (max-width: 380px) {
    .title { font-size: 1.1rem; }

    .listProduct {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .image-container { height: 120px; }

    .listProduct .item { padding: 0.65rem; }
    .listProduct .item h2 { font-size: 0.75rem; }
    .listProduct .item button.addCart { font-size: 0.72rem; padding: 0.5rem; }
}/**
 * ═══════════════════════════════════════════════════════════════
 * SHOP MOBILE FIXES — append to shop.css
 * Covers: mobile navbar, category dropdown/filter panel,
 *         shop header layout tweaks for small screens.
 * ═══════════════════════════════════════════════════════════════
 */

/* ============================================================
   FILTER PANEL — mobile-first slide-in drawer
   (replaces any partial rules that may already exist)
   ============================================================ */
.filter-panel {
    position: fixed;
    top: 0;
    left: -100%;       /* slide in from left */
    width: min(320px, 90vw);
    height: 100%;
    background: var(--bg-card, #fff);
    z-index: 1100;
    overflow-y: auto;
    transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
}

.filter-panel.active {
    left: 0;
}

/* Filter panel header */
.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--navy, #122b46);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.filter-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.close-filter {
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 6px;
    color: #fff;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    transition: background 0.18s;
}
.close-filter:hover { background: rgba(255,255,255,0.2); }

/* Filter content body */
.filter-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.filter-section {
    margin-bottom: 1.25rem;
}

.filter-section h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #4a5568);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1.5px solid var(--border, #dde2ea);
}

/* Category buttons in filter panel */
.cat-all-btn,
.cat-filter-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 0.86rem;
    font-family: inherit;
    color: var(--text-primary, #0c1e31);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-weight: 500;
}

.cat-all-btn:hover,
.cat-filter-btn:hover {
    background: var(--bg, #eef1f6);
}

.cat-all-btn.active,
.cat-filter-btn.active {
    background: var(--navy, #122b46);
    color: #fff;
    font-weight: 600;
}

/* Category list scroll container */
#category-list {
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}

#category-list::-webkit-scrollbar { width: 3px; }
#category-list::-webkit-scrollbar-thumb { background: var(--border, #dde2ea); border-radius: 2px; }

/* Department headings inside category list */
.dept-heading {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #8a97a8);
    padding: 0.75rem 12px 0.35rem;
    margin-top: 0.35rem;
}

/* Apply / clear filter buttons */
.apply-filter-btn,
.clear-filters-btn {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.18s;
}

.apply-filter-btn {
    background: var(--navy, #122b46);
    color: #fff;
    border: none;
}
.apply-filter-btn:hover { background: var(--blue-mid, #2756a8); }

.clear-filters-btn {
    background: transparent;
    border: 1.5px solid var(--border, #dde2ea);
    color: var(--danger, #e53e3e);
}
.clear-filters-btn:hover {
    background: rgba(229,62,62,0.07);
    border-color: var(--danger, #e53e3e);
}

/* Filter overlay backdrop */
.filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1099;
    -webkit-tap-highlight-color: transparent;
}
.filter-overlay.active { display: block; }

/* Prevent body scroll when filter open */
body.filter-open { overflow: hidden; }

/* ============================================================
   FILTER TOGGLE BUTTON — in shop header
   ============================================================ */
.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: rgba(255,255,255,0.9);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}
.filter-toggle i { font-size: 1rem; }
.filter-toggle:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.35);
    color: #fff;
}

/* ============================================================
   SHOP HEADER — mobile adjustments
   ============================================================ */
@media (max-width: 480px) {
    .shop-header {
        padding: 0.6rem 0.75rem;
    }

    .title {
        font-size: 1.1rem;
    }

    /* Tighten search + controls row */
    .shop-controls { margin-top: 0.5rem; }

    .search-controls {
        flex-wrap: nowrap; /* keep search + filter on one line */
        gap: 0.4rem;
    }

    .search-box input {
        padding: 9px 38px 9px 12px;
        font-size: 0.85rem;
    }

    /* Smaller items-per-page select */
    .items-per-page select {
        padding: 7px 8px;
        font-size: 0.78rem;
    }

    .filter-toggle {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    /* 2-column grid on very small screens */
    .listProduct {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        padding: 0.6rem;
    }

    .image-container { height: 130px; }
    .listProduct .item { padding: 0.65rem; }
    .listProduct .item h2 { font-size: 0.76rem; }
    .listProduct .item button.addCart { font-size: 0.73rem; padding: 0.45rem 0.5rem; }
}

/* ============================================================
   CART SIDEBAR — mobile improvements
   ============================================================ */
@media (max-width: 480px) {
    .cartBar {
        width: 100% !important;
        right: -100% !important;
        border-radius: 0;
    }

    .cartBar.active {
        right: 0 !important;
    }
}

/* ============================================================
   ITEMS-PER-PAGE SELECT — consistent styling
   ============================================================ */
.items-per-page select {
    padding: 8px 10px;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.items-per-page select:focus { border-color: var(--accent, #4a7fd4); }

/* ============================================================
   PAGINATION — mobile friendly
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 1rem 0.75rem 2rem;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border, #dde2ea);
    border-radius: 6px;
    background: #fff;
    color: var(--navy, #122b46);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 0 8px;
    transition: all 0.18s;
}
.page-btn:hover { background: var(--bg, #eef1f6); border-color: var(--accent, #4a7fd4); }
.page-btn.active {
    background: var(--navy, #122b46);
    color: #fff;
    border-color: var(--navy, #122b46);
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .page-btn { min-width: 32px; height: 32px; font-size: 0.78rem; }
}
/**
 * ═══════════════════════════════════════════════════════════════
 * shop_and_savedlater_fixes.css
 * APPEND to: checkout.css  (saved-for-later fixes)
 *            shop.css      (product card polish)
 *
 * FIXES:
 *  1. Saved-for-later image blowing up on mobile
 *  2. Shop product cards — cleaner Amazon-style mobile layout
 * ═══════════════════════════════════════════════════════════════
 */

/* ============================================================
   SAVED FOR LATER — image sizing fix
   The image was unsized so it stretched to fill the card.
   Lock it to a fixed square on all screen sizes.
   ============================================================ */
.saved-item {
    display: flex;
    flex-direction: row;        /* always horizontal */
    align-items: flex-start;
    gap: 0.85rem;
}

.saved-item img {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px;            /* prevent flex from squishing it */
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border, #dde2ea);
    flex-shrink: 0;             /* never shrink */
    align-self: flex-start;
}

.saved-item-details {
    flex: 1;
    min-width: 0;               /* allow text to truncate */
}

.saved-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}

/* Tighter on phones */
@media (max-width: 480px) {
    .saved-item {
        gap: 0.65rem;
        padding: 0.75rem;
    }
    .saved-item img {
        width: 64px !important;
        height: 64px !important;
        min-width: 64px;
    }
    .saved-item-name { font-size: 0.82rem; }
    .saved-item-price { font-size: 0.78rem; }
    .saved-item-meta  { font-size: 0.7rem; }
}

/* ============================================================
   SHOP PRODUCT CARDS — cleaner mobile layout
   Amazon-style: image top, name, price, add-to-cart button
   Clean white cards with a shadow — no clutter
   ============================================================ */

/* Better image area — consistent height, centred */
.image-container {
    width: 100%;
    height: 140px;
    background: #f8f9fb;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0;           /* remove gap — let card padding handle it */
}

@media (max-width: 480px) {
    .image-container { height: 120px; }
}

/* Tighten card body padding on mobile */
@media (max-width: 640px) {
    .listProduct .item {
        padding: 0;             /* image goes edge-to-edge at top */
        border-radius: 10px;
        overflow: hidden;
    }

    /* Everything below image gets its own padding */
    .listProduct .item h2,
    .listProduct .item .price,
    .listProduct .item .item-qty-row,
    .listProduct .item button.addCart {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    .listProduct .item h2 {
        margin-top: 0.55rem;
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }

    .listProduct .item .price {
        font-size: 1rem;
        font-weight: 700;
        color: var(--navy, #122b46);
        margin-bottom: 0.45rem;
    }

    .listProduct .item button.addCart {
        border-radius: 0 0 8px 8px; /* bottom corners match card */
        padding: 0.65rem;
        font-size: 0.82rem;
        margin-top: auto;
    }

    /* Qty row sits between price and button */
    .item-qty-row {
        margin: 0 0.6rem 0.45rem;
        border-radius: 6px;
        height: 34px;
    }
}

/* Desktop: restore normal padding */
@media (min-width: 641px) {
    .listProduct .item { padding: 1rem; }
    .image-container { border-radius: 8px; margin-bottom: 0.6rem; }
}

/* ── No-image placeholder ── */
.listProduct .item .placeholder-img,
.listProduct .item img[src=""],
.listProduct .item img:not([src]) {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.4;
}

/* ── Product name — 2-line clamp on all sizes ── */
.listProduct .item h2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

/* ── Add to cart button — prevent text wrapping ── */
.listProduct .item button.addCart {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Shop container — full bleed on small mobile ── */
@media (max-width: 480px) {
    .shop-container {
        padding: 0.5rem 0.5rem;
    }

    .listProduct {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   STOCK STATUS — shop cards, cart panel, OOS removal popup
   ═══════════════════════════════════════════════════════════════ */

/* ── Low-stock badge on product cards ── */
.low-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    letter-spacing: 0.03em;
    line-height: 1.4;
}

.low-stock-badge i { font-size: 0.8rem; }

/* In list view the badge sits inside .list-item-details */
.list-item-details .low-stock-badge { margin-bottom: 4px; }

/* ── Cart panel — OOS badge ── */
.cart-oos-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent, #ef4444);     /* falls back to red if --accent isn't red */
    background: #ef4444;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    letter-spacing: 0.03em;
    line-height: 1.4;
}

/* ── Cart panel — low-stock badge ── */
.cart-low-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    letter-spacing: 0.03em;
    line-height: 1.4;
}

/* ── OOS item row in cart — slightly dimmed ── */
.listCart .item:has(.cart-oos-badge) {
    opacity: 0.75;
}

/* ── OOS removal popup ── */
#mw-oos-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, 0.55);
    animation: mwFadeIn 0.15s ease;
}

#mw-oos-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    background: var(--bg-card, #fff);
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    font-family: inherit;
    animation: mwSlideUp 0.2s ease;
}

#mw-oos-popup h3 {
    margin: 0;
    color: var(--text-primary, #0c1e31);
    font-size: 1rem;
}

#mw-oos-popup p {
    margin: 0 0 12px;
    color: var(--text-secondary, #4a5568);
    font-size: 0.9rem;
}

#mw-oos-popup ul {
    margin: 0 0 18px;
    padding-left: 18px;
    color: #ef4444;
    font-size: 0.88rem;
    line-height: 1.7;
}

#mw-oos-popup-close {
    display: block;
    width: 100%;
    padding: 10px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s;
}

#mw-oos-popup-close:hover { background: #dc2626; }

@keyframes mwFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes mwSlideUp {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ── Responsive: smaller popup on very small screens ── */
@media (max-width: 480px) {
    #mw-oos-popup {
        padding: 18px 16px;
        max-width: 95vw;
    }
}

/* ── OOS popup inner layout ── */
.mw-oos-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.mw-oos-popup-header i {
    font-size: 1.6rem;
    color: #ef4444;
    flex-shrink: 0;
}

.mw-oos-popup-header h3 {
    margin: 0;
    color: var(--text-primary, #0c1e31);
    font-size: 1rem;
}

/* ── "In Stock: X" / "Only X left" / "Out of Stock" (Amazon style) ──
   Always rendered on every product card; the modifier class picks the
   icon color to match the item's stock state. ── */
.shop-stock-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    margin: 2px 0 4px;
    line-height: 1.3;
}

.shop-stock-inline i { font-size: 0.9rem; }

.shop-stock-inline.in-stock     { color: var(--success); }
.shop-stock-inline.low          { color: #c05621; }   /* warm amber-red — matches low stock feel */
.shop-stock-inline.out-of-stock { color: var(--danger); }

/* In list view the stock line sits inside .list-item-details */
.list-item-details .shop-stock-inline { margin-bottom: 4px; }

/* Committed line — qty reserved/on order. Muted, sits just under the stock line. */
.shop-committed-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.3;
    color: var(--text-muted, #6b7280);
}
.shop-committed-inline i { font-size: 0.9rem; }
.list-item-details .shop-committed-inline { margin-bottom: 4px; }

/* Package unit / pack size (e.g. 12/Cs) — small accented pill */
.shop-pack-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0 0 6px;
    padding: 2px 8px;
    line-height: 1.3;
    border-radius: 99px;
    color: var(--navy, #1f2a44);
    background: var(--bg-section, #eef1f6);
    border: 1px solid var(--border, #e2e6ee);
}
.shop-pack-inline i { font-size: 0.85rem; }
.list-item-details .shop-pack-inline { margin-bottom: 6px; }

/* ── Qty input flash when user hits the stock cap ── */
.item-qty-input.qty-at-max,
.quantity-input.qty-at-max {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
    transition: border-color 0.15s, background 0.15s;
}
/* ── Mobile card polish: compact meta row + EA as a pill (not a full-width box) ── */
.shop-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 0 0 0.55rem;
}
.shop-meta > * { margin: 0 !important; }
/* Keep the stock text / EA pill / committed tag from stretching full-width
   inside the flex-column card. */
.listProduct .item .shop-stock-inline,
.listProduct .item .shop-pack-inline,
.listProduct .item .shop-committed-inline { align-self: flex-start; }
.listProduct .item h2 { margin-bottom: 0.35rem; min-height: 2.3em; }
.listProduct .item .price { margin-bottom: 0.45rem; }

/* ═══════ SHOP CONTROLS v2 — category dropdown + search / Show+refresh row ═══════ */
.shop-controls { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 10px; }
.shop-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shop-filter-row .search-box { flex: 1 1 100%; min-width: 0; }
.category-select {
    flex: 1 1 100%; min-width: 0; min-height: 44px;
    padding: 10px 40px 10px 14px;
    background-color: rgba(255,255,255,0.10);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-sm); color: #fff; font-size: 0.9rem;
    font-family: inherit; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center; background-size: 16px;
}
.category-select:focus { outline: none; border-color: var(--accent, #b4070b); box-shadow: 0 0 0 3px rgba(180,7,11,0.25); }
.category-select option, .category-select optgroup { color: #1c2130; background: #fff; }
.shop-controls .items-per-page { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shop-controls .items-per-page > span { color: rgba(255,255,255,0.82); font-size: 0.85rem; font-weight: 600; margin-right: 2px; }
.shop-controls .ipp-btn { padding: 0 16px; min-height: 38px; font-size: 0.82rem; border-radius: var(--radius-sm); }
.shop-controls .shop-refresh-btn {
    margin-left: 4px; width: 40px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.10); border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-sm); color: #fff; font-size: 1.2rem; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.shop-controls .shop-refresh-btn:hover { background: var(--accent, #b4070b); border-color: var(--accent, #b4070b); }
.shop-controls .shop-refresh-btn.spinning i { animation: shop-refresh-spin 0.6s linear infinite; }
@keyframes shop-refresh-spin { to { transform: rotate(360deg); } }
@media (min-width: 620px) {
    .category-select { flex: 0 0 240px; }
    .shop-filter-row .search-box { flex: 1 1 auto; }
}

/* ── Category dropdown panel — matches the old ALL CATEGORIES look ── */
.shop-cat { position: relative; flex: 1 1 100%; min-width: 0; }
.shop-cat-btn {
    width: 100%; min-height: 44px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.10);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-sm);
    color: #fff; font-size: 0.9rem; font-weight: 600; font-family: inherit; cursor: pointer;
}
.shop-cat-btn i { font-size: 1.15rem; opacity: .9; transition: transform .2s; }
.shop-cat-btn[aria-expanded="true"] i { transform: rotate(180deg); }
.shop-cat-btn:hover { background: rgba(255,255,255,0.14); }
.shop-cat-panel {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0;
    width: min(340px, 90vw); max-height: 62vh; overflow-y: auto;
    background: #fff; border: 1px solid #e4e7ef; border-radius: 12px;
    box-shadow: 0 18px 44px rgba(12,28,68,.28);
    padding: 10px; z-index: 300;
}
.shop-cat-panel.open { display: block; }
.shop-cat-empty { padding: 16px; color: #8a90a2; font-size: 0.85rem; text-align: center; }
.shop-cat-all {
    width: 100%; text-align: left; padding: 12px 14px;
    border: none; border-radius: 8px; background: #f2f4fa; color: #0c1c44;
    font-weight: 700; font-size: 0.9rem; font-family: inherit; cursor: pointer; margin-bottom: 8px;
}
.shop-cat-all:hover { background: #e7ecf6; }
.shop-cat-group { margin-bottom: 8px; }
.shop-cat-heading {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 11px 14px; border: none; border-radius: 8px; cursor: pointer;
    background: #0c1c44; color: #fff; font-weight: 700; text-transform: uppercase;
    font-size: 0.76rem; letter-spacing: .3px; font-family: inherit; margin-bottom: 4px;
}
.shop-cat-heading i { font-size: 1rem; }
.shop-cat-heading:hover { background: #12285f; }
.shop-cat-item {
    width: 100%; text-align: left; position: relative;
    padding: 9px 14px 9px 24px; border: none; background: transparent;
    color: #33405a; font-size: 0.86rem; font-family: inherit; cursor: pointer; border-radius: 6px;
}
.shop-cat-item::before { content: "•"; position: absolute; left: 10px; color: #b6bdca; }
.shop-cat-item:hover { background: #f2f4fa; color: #0c1c44; }
@media (min-width: 620px) { .shop-cat { flex: 0 0 240px; } }

/* ── Back-to-top button (matches the checkout page) ── */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    background: var(--navy, #0c1c44);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow-md, 0 10px 24px rgba(12,28,68,.18));
    z-index: 500;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.18s ease;
    pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--blue-mid, #12285f); }
@media (max-width: 600px) {
    .back-to-top { width: 40px; height: 40px; font-size: 1.1rem; bottom: 1rem; right: 1rem; }
}
