/*
   Listing-page CSS mirrored from the reference storefront's /collections
   page, so the sidebar filters, sort toolbox and pagination behave the same.
*/

.shop__header {
            background: #f8f8f8;
            border-radius: 4px;
            margin-top: 16px;
        }

        .pagination__area {
            border-radius: 4px;
            margin-bottom: 30px;
            margin-top: 25px;
        }

        .pagination__area nav.pagination ul.pagination li.page-item .page-link {
            border-radius: 50%;
            height: 38px;
            width: 38px;
            text-align: center;
            line-height: 20px;
            font-size: 18px !important;
            margin: 0px 2px;
        }

        .loading-overlay {
            position: absolute;
            top: 24px;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 101;
        }

        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #3498db;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0%  { transform: rotate(0deg); }
            100%{ transform: rotate(360deg); }
        }

        #product-container { position: relative; }

        /* ── Filter Sidebar Global ─────────────────────────────────────── */
        .sidebar .widget { margin-bottom: 6px; }
        .sidebar .widget-title label {
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            color: #222;
        }

        /* ── Custom checkbox filter items ──────────────────────────────── */
        .filter-item-row {
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 5px 0;
            cursor: pointer;
            transition: background .15s;
            border-radius: 5px;
        }
        .filter-item-row:hover { background: #f0f6ff; }

        /* Hide native checkbox, show custom one */
        .filter-item-row input[type="checkbox"] {
            appearance: none;
            -webkit-appearance: none;
            width: 16px;
            height: 16px;
            min-width: 16px;
            border: 1.5px solid #c0c0c0;
            border-radius: 4px;
            background: #fff;
            cursor: pointer;
            position: relative;
            transition: border-color .2s, background .2s;
            flex-shrink: 0;
        }
        .filter-item-row input[type="checkbox"]:checked {
            background: var(--primary-color);
            border-color:  var(--primary-color);
        }
        .filter-item-row input[type="checkbox"]:checked::after {
            content: '';
            position: absolute;
            left: 4px;
            top: 1px;
            width: 5px;
            height: 9px;
            border: 2px solid #fff;
            border-top: none;
            border-left: none;
            transform: rotate(45deg);
        }

        .filter-item-label {
            font-size: 13.5px;
            color: #333;
            line-height: 1.3;
            flex: 1;
            text-align: left;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Count badge */
        .filter-count {
            font-size: 11px;
            font-weight: 700;
            padding: 1px 7px;
            border-radius: 20px;
            flex-shrink: 0;
        }

        /* Unavailable items */
        .filter-unavailable {
            opacity: 0.38 !important;
            pointer-events: none !important;
        }

        /* Override theme's .filter-items li span { position:absolute; right:0 } */
        .filter-items li .filter-item-label {
            position: static !important;
            right: auto !important;
            text-align: left !important;
            color: #333 !important;
        }
        .filter-items li .filter-count {
            position: static !important;
            right: auto !important;
        }

        /* ── Color swatches ────────────────────────────────────────────── */
        .color-swatch-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 7px;
            padding: 4px 0 8px;
        }
        .color-swatch-item {
            position: relative;
            cursor: pointer;
        }
        .color-swatch-item input[type="checkbox"] {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }
        .color-swatch-box {
            display: inline-block;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            border: 2px solid transparent;
            box-shadow: 0 1px 4px rgba(0,0,0,.15);
            transition: transform .15s, box-shadow .15s, border-color .15s;
            position: relative;
        }
        .color-swatch-item input:checked + .color-swatch-box {
            border-color: var(--primary-color);
            transform: scale(1.18);
            box-shadow: 0 0 0 2px rgba(0,124,186,.25);
        }
        .color-swatch-box[title]:hover { transform: scale(1.15); }
        .color-swatch-item.filter-unavailable { opacity: 0.3; pointer-events: none; }

        /* ── Size pills ────────────────────────────────────────────────── */
        .size-pill-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            padding: 4px 0 8px;
        }
        .size-pill-item {
            position: relative;
            cursor: pointer;
        }
        .size-pill-item input[type="checkbox"] {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }
        .size-pill-label {
            display: inline-block;
            padding: 4px 11px;
            border: 1.5px solid #d0d0d0;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            color: #444;
            background: #fff;
            transition: border-color .15s, background .15s, color .15s;
            cursor: pointer;
        }
        .size-pill-item input:checked + .size-pill-label {
            border-color: var(--primary-color);
            background: var(--primary-color);
            color: #fff;
        }
        .size-pill-item.filter-unavailable { opacity: 0.35; pointer-events: none; }

        @media (max-width: 991px) {
            .sidebar-content.scrollable {
                overflow-y: auto !important;
                max-height: 100vh !important;
                padding-bottom: 80px !important; /* give some room at bottom */
            }
        }

.noUi-connect            { background: var(--primary-color);height: 6px; }
    .noUi-target             { border-radius: 4px; border: 1px solid #ddd; box-shadow: none; background: #eee; height: 6px; }
    .noUi-handle             { border-radius: 50%; width: 20px !important; height: 20px !important; top: -8px !important; box-shadow: 0 2px 6px rgba(0,0,0,.2); border: 2px solid #007cba; background: #fff; cursor: grab; }
    .noUi-handle:after,
    .noUi-handle:before      { display: none; }
    .noUi-horizontal         { height: 6px; }
