/* Color palette */
.card-body .name {
    font-family: 'Playfair Display', serif;
}

body {
    background: linear-gradient(to bottom, #faf8f5 0%, #f5f3f0 100%);
}

        .top-filters-container {
            background: rgba(250, 248, 244, 0.93);
            backdrop-filter: blur(10px);
            padding: 30px;
            border-radius: 15px;
            margin: 20px auto;
            max-width: 1400px;
            box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
            border: 1px solid rgba(200, 190, 175, 0.25);
        }

        .top-filters-container::before {
            content: '';
            position: absolute;
            top: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 85%;
            height: 1.5px;
            background: linear-gradient(90deg, transparent 0%, rgba(180, 160, 130, 0.4) 25%, rgba(180, 160, 130, 0.65) 50%, rgba(180, 160, 130, 0.4) 75%, transparent 100%);
        }

        .filters-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid rgba(200, 190, 175, 0.18);
            align-items: stretch;
        }

        .filter-section {
            margin-bottom: 10px;
            min-width: 180px;
        }

        .filter-dropdown {
            position: relative;
            display: flex;
            flex-direction: column;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 1;
        }

        .filter-dropdown:hover {
            transform: translateY(-2px);
        }
        
        .filter-dropdown:has(.filter-options.show) {
            z-index: 200;
        }

        .filter-title-button {
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            padding: 12px 16px;
            border: 1.5px solid rgba(200, 190, 175, 0.22);
            border-radius: 10px;
            background: rgba(255, 254, 252, 0.98);
            width: 100%;
            font-weight: 600;
            font-size: 13px;
            color: #2f261b;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            position: relative;
            white-space: nowrap;
        }

        .filter-title-button:hover {
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
            border-color: rgba(140, 120, 90, 0.45);
        }

        .filter-title-button:active {
            transform: translateY(0) scale(0.98);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }

        .filter-title-button i {
            transition: transform 0.3s ease;
            color: #6c757d;
            font-size: 11px;
            margin-left: 5px;
        }

        .filter-title-button:hover i {
            color: #2f261b;
        }

        .filter-options.show ~ .filter-title-button i {
            transform: rotate(180deg);
        }

        .filter-options {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 8px;
            background: rgba(255, 254, 252, 0.98);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(200, 190, 175, 0.28);
            border-radius: 10px;
            z-index: 250;
            min-width: 200px;
            width: max-content;
            padding: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px) scale(0.95);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            pointer-events: none;
        }

        .filter-options.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0) scale(1);
            pointer-events: auto;
        }

        .filter-label {
            display: flex;
            align-items: center;
            margin-bottom: 8px;
            font-weight: 500;
            cursor: pointer;
            padding: 6px 10px;
            border-radius: 6px;
            transition: all 0.2s ease;
            position: relative;
            user-select: none;
            font-size: 13px;
        }
        
        .filter-label:last-child {
            margin-bottom: 0;
        }

        .filter-label:hover {
            background-color: rgba(180, 160, 130, 0.11);
            transform: translateX(5px);
        }

        .filter-label:active {
            transform: translateX(3px) scale(0.98);
            background-color: rgba(180, 160, 130, 0.18);
        }

        .filter-label input[type="checkbox"] {
            margin-right: 10px;
            width: 18px;
            height: 18px;
            accent-color: #8c7a5a;
            cursor: pointer;
        }

        .left-filters {
            display: flex;
            align-items: center;
            gap: 20px;
            flex-wrap: wrap;
        }

        .sorting-controls {
            display: flex;
            align-items: center;
            gap: 15px;
            justify-content: center;
            font-family: 'Montserrat', sans-serif;
            background: rgba(250, 248, 244, 0.92);
            padding: 18px 25px;
            border-radius: 12px;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
            position: relative;
            z-index: 50;
            border-top: 1px solid rgba(200, 190, 175, 0.22);
        }

        .sorting-controls label {
            font-weight: 600;
            color: #2f261b;
            font-size: 13px;
        }

        .search-controls {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .search-controls input {
            border: 1.5px solid rgba(200, 190, 175, 0.22);
            outline: none;
            font-weight: 500;
            padding: 10px 12px;
            border-radius: 10px;
            background: rgba(255, 254, 252, 0.98);
            min-width: 230px;
            font-size: 13px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .search-controls input:hover {
            transform: translateY(-2px) scale(1.01);
            border-color: rgba(140, 120, 90, 0.45);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
        }

        .search-controls input:focus {
            border-color: rgba(140, 120, 90, 0.55);
            box-shadow: 0 0 0 3px rgba(140, 120, 90, 0.12);
        }

        .clear-filters-btn {
            border: 1.5px solid rgba(200, 190, 175, 0.22);
            outline: none;
            font-weight: 600;
            padding: 10px 14px;
            border-radius: 10px;
            background: rgba(255, 254, 252, 0.98);
            color: #2f261b;
            font-size: 13px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            white-space: nowrap;
        }

        .clear-filters-btn:hover {
            transform: translateY(-2px) scale(1.02);
            border-color: rgba(140, 120, 90, 0.45);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
        }

        .clear-filters-btn:active {
            transform: translateY(0) scale(0.98);
        }

        .empty-state {
            width: 100%;
            text-align: center;
            padding: 4rem 1rem;
            color: #7a6a55;
        }

        .empty-state-icon {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            opacity: 0.3;
        }

        .empty-state-title {
            font-family: 'Playfair Display', serif;
            font-size: 1.4rem;
            color: #2f261b;
            margin-bottom: 0.5rem;
        }

        .empty-state-sub {
            font-size: 0.9rem;
            margin-bottom: 1.5rem;
        }

        .empty-state-clear {
            border: 1.5px solid rgba(201, 160, 44, 0.5);
            background: transparent;
            color: #2f261b;
            padding: 0.6rem 1.5rem;
            border-radius: 10px;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .empty-state-clear:hover {
            background: rgba(201, 160, 44, 0.1);
            border-color: #c9a02c;
        }

        .active-filter-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            padding: 0.5rem 1rem 0;
        }

        .active-filter-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 4px 10px;
            background: rgba(201, 160, 44, 0.12);
            border: 1px solid rgba(201, 160, 44, 0.4);
            border-radius: 20px;
            font-size: 0.78rem;
            font-weight: 600;
            color: #2f261b;
            letter-spacing: 0.03em;
        }

        .active-filter-pill-remove {
            cursor: pointer;
            font-size: 0.85rem;
            color: #a07c20;
            line-height: 1;
            border: none;
            background: none;
            padding: 0;
            margin-left: 2px;
        }

        .active-filter-pill-remove:hover { color: #2f261b; }

        .sorting-controls select {
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            border: 1.5px solid rgba(200, 190, 175, 0.22);
            outline: none;
            font-weight: 500;
            padding: 10px 15px;
            border-radius: 10px;
            background: rgba(255, 254, 252, 0.98);
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            min-width: 200px;
            position: relative;
            z-index: 60;
            font-size: 13px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }

        .sorting-controls select:hover {
            transform: translateY(-2px) scale(1.02);
            border-color: rgba(140, 120, 90, 0.45);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
            z-index: 70;
        }

        .sorting-controls select:focus {
            border-color: rgba(140, 120, 90, 0.55);
            box-shadow: 0 0 0 3px rgba(140, 120, 90, 0.12);
            z-index: 70;
        }

        .sorting-controls select:active {
            transform: translateY(0) scale(0.98);
        }

        /* Ensure dropdown options have proper z-index */
        .sorting-controls select option {
            background: white;
            color: #2f261b;
            padding: 8px 15px;
            z-index: 80;
        }

        /* Small desktop / tablet - 3 columns */
        @media (max-width: 1100px) {
            .filters-row {
                grid-template-columns: repeat(3, 1fr);
                gap: 12px;
            }
            
            .top-filters-container {
                padding: 20px;
            }
        }

        /* Mobile landscape - 2 columns */
        @media (max-width: 768px) {
            .filters-row {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }

            .top-filters-container {
                padding: 15px;
                margin: 15px auto;
            }

            .filter-title-button {
                padding: 10px 14px;
                font-size: 12px;
            }

            .sorting-controls {
                flex-direction: row;
                gap: 10px;
                padding: 15px 20px;
                flex-wrap: wrap;
            }

            .sorting-controls select {
                width: auto;
                min-width: 150px;
                font-size: 12px;
                padding: 8px 12px;
            }

            .sorting-controls label {
                font-size: 12px;
            }

            .search-controls {
                width: 100%;
                justify-content: center;
            }

            .search-controls input {
                min-width: 220px;
                width: min(100%, 320px);
                font-size: 12px;
                padding: 8px 11px;
            }

            .clear-filters-btn {
                font-size: 12px;
                padding: 8px 11px;
            }

            .filter-label {
                font-size: 12px;
                padding: 5px 8px;
                margin-bottom: 6px;
            }
        }

        /* Mobile portrait - 2 columns stacked */
        @media (max-width: 576px) {
            .filters-row {
                grid-template-columns: repeat(2, 1fr);
                gap: 8px;
            }

            .top-filters-container {
                padding: 12px;
                margin: 10px auto;
            }

            .filter-title-button {
                padding: 8px 12px;
                font-size: 11px;
            }

            .sorting-controls {
                flex-direction: row;
                flex-wrap: wrap;
                gap: 8px;
                padding: 12px 15px;
                align-items: center;
            }

            .search-controls {
                width: 100%;
            }

            .search-controls input {
                width: 100%;
                min-width: 0;
            }

            .clear-filters-btn {
                width: auto;
            }

            .sorting-controls select {
                width: auto;
                min-width: 170px;
                flex: 0 1 260px;
            }

            .filter-label {
                font-size: 11px;
            }
        }

        /* Very small screens - 1 column */
        @media (max-width: 400px) {
            .filters-row {
                grid-template-columns: 1fr;
            }

            .sorting-controls {
                align-items: stretch;
            }

            .sorting-controls select,
            .clear-filters-btn {
                width: 100%;
                min-width: 0;
                flex: 1 1 100%;
            }
        }

        .product-section {
            display: flex;
            justify-content: center;
            align-items: flex-start;
            flex-wrap: wrap;
            width: 100%;
        }

        .product-label {
            position: absolute;
            top: 10px;
            right: 10px;
            padding: 8px 8px;
            color: #ffffff;
            font-size: 10px;
            font-weight: 500;
            border-radius: 10px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .on-sale {
            background-color: #f5ead8;
            color: #5a7a3e;
            border: 1px solid #ddc88d;
        }

        .discontinued {
            background-color: #dfd4c6;
            color: #5f5145;
            border: 1px solid #c9bcab;
        }

        .out-of-stock {
            background-color: #f2dede;
            color: #8b4049;
            border: 1px solid #e4c1c4;
        }

        .old-formulation {
            background-color: #f5edd8;
            color: #7a6530;
            border: 1px solid #e2d5b5;
        }

        input[type="checkbox"] {
            border-radius: 0;
            border: 1.5px solid #5a5244;
            width: 16px;
            height: 16px;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 8px;
        }

        input[type="checkbox"]:checked {
            background-color: #5a5244;
            border: 1.5px solid #5a5244;
        }

        input[type="checkbox"]:checked::before {
            content: '\2713';
            color: white;
            display: block;
            text-align: center;
            line-height: 16px;
        }







        
        .header-bg {
            position: relative;
            overflow: hidden;
            margin-bottom: 8px;
        }

        .header-bg .container {
            max-width: none !important;
            width: 100% !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
            margin: 0 !important;
        }

        @media (max-width: 768px) {
            .header-bg {
                margin-bottom: 4px;
            }
            .header-bg::after {
                display: none;
            }
        }

        .header-bg::before {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 2px;
            background: linear-gradient(90deg, transparent 0%, rgba(180, 160, 130, 0.35) 20%, rgba(180, 160, 130, 0.6) 50%, rgba(180, 160, 130, 0.35) 80%, transparent 100%);
            z-index: 2;
        }


        .header-bg img {
            display: block;
            width: 100%;
            height: auto;
            margin: 0;
            padding: 0;
        }

         .container {
            height: 100%;
            /*I FOUND THE PROBLEM!!! */
            /* display: flex; */
            align-items: center; 
            justify-content: center;
        } 

        
        .tag-stack {
            position: absolute;
            top: 10px;
            left: 10px;
            transform: none;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 2px;
            z-index: 10;
            max-width: calc(100% - 20px);
        }

        .tag-stack.has-sale-badge {
            max-width: calc(100% - 92px);
        } 

        .stock-label-pill {
            padding: 2px 8px;
            font-size: 10px;
            border-radius: 50px;
            background-color: #f2dede !important;
            color: #8b4049 !important;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
            border: 1.5px solid #e4c1c4 !important;
            white-space: nowrap;
            overflow: visible;
        }

        /* Card is the container — queries respond to actual card width, not viewport */
        .item { container-type: inline-size; container-name: card; }

        /* =====================================================
           TUNING VARIABLES — adjust these to change sizes.
           Breakpoints are card width, not viewport width.
           badge-fs-*   = sale badge font-size per pill count (0=alone, 1=1pill, 2=2pills, 3=3pills)
           pill-*       = info pill font-size (nobadge/hasbadge × large/medium/small)
           ===================================================== */

        /* Card ≥280px (default — wide cards) */
        .item {
            --badge-fs-0: 0.92rem; --badge-pad-0: 9px 15px;
            --badge-fs-1: 0.92rem; --badge-pad-1: 9px 15px;
            --badge-fs-2: 0.80rem; --badge-pad-2: 7px 11px;
            --badge-fs-3: 0.88rem; --badge-pad-3: 8px 13px;

            --pill-nobadge-large:  13px;
            --pill-nobadge-medium: 12px;
            --pill-nobadge-small:  11px;

            --pill-hasbadge-large:  13px;
            --pill-hasbadge-medium: 12px;
            --pill-hasbadge-small:  11px;
        }

        /* Card 220–229px */
        @container card (max-width: 229px) {
            .item {
                --badge-fs-0: 0.82rem; --badge-pad-0: 7px 12px;
                --badge-fs-1: 0.82rem; --badge-pad-1: 7px 12px;
                --badge-fs-2: 0.72rem; --badge-pad-2: 6px 9px;
                --badge-fs-3: 0.78rem; --badge-pad-3: 6px 10px;

                --pill-nobadge-large:  12px;
                --pill-nobadge-medium: 11px;
                --pill-nobadge-small:  10px;

                --pill-hasbadge-large:  10px;
                --pill-hasbadge-medium:  9px;
                --pill-hasbadge-small:   8px;
            }
        }

        /* Card 160–219px */
        @container card (max-width: 219px) {
            .item {
                --badge-fs-0: 0.75rem; --badge-pad-0: 6px 10px;
                --badge-fs-1: 0.75rem; --badge-pad-1: 6px 10px;
                --badge-fs-2: 0.67rem; --badge-pad-2: 5px 8px;
                --badge-fs-3: 0.70rem; --badge-pad-3: 5px 9px;

                --pill-nobadge-large:  11px;
                --pill-nobadge-medium: 10px;
                --pill-nobadge-small:   9px;

                --pill-hasbadge-large:   9px;
                --pill-hasbadge-medium:  8px;
                --pill-hasbadge-small:   8px;
            }

            .tag-stack { gap: 2px; }
        }

        /* Apply variables — never edit below this line */
        #item-container .sale-badge                    { font-size: var(--badge-fs-0); padding: var(--badge-pad-0); top: 8px; right: 8px; line-height: 1.1; white-space: nowrap; z-index: 11; }
        #item-container .sale-badge.sale-badge-large   { font-size: var(--badge-fs-1); padding: var(--badge-pad-1); }
        #item-container .sale-badge.sale-badge-two     { font-size: var(--badge-fs-2); padding: var(--badge-pad-2); }
        #item-container .sale-badge.sale-badge-compact { font-size: var(--badge-fs-3); padding: var(--badge-pad-3); }

        .stock-label-pill.bg-warning {
            background-color: #dfd4c6 !important;
            color: #5f5145 !important;
            border: 1.5px solid #c9bcab !important;
        }

        .stock-label-pill.bg-info {
            background-color: #f5edd8 !important;
            color: #7a6530 !important;
            border: 1.5px solid #e2d5b5 !important;
        }

        .tag-stack.no-sale-badge .pill-large   { font-size: var(--pill-nobadge-large)  !important; padding: 5px 10px !important; }
        .tag-stack.no-sale-badge .pill-medium  { font-size: var(--pill-nobadge-medium) !important; padding: 4px 9px  !important; }
        .tag-stack.no-sale-badge .pill-small   { font-size: var(--pill-nobadge-small)  !important; padding: 3px 8px  !important; }

        .tag-stack.has-sale-badge .pill-large  { font-size: var(--pill-hasbadge-large)  !important; padding: 5px 10px !important; }
        .tag-stack.has-sale-badge .pill-medium { font-size: var(--pill-hasbadge-medium) !important; padding: 4px 8px  !important; }
        .tag-stack.has-sale-badge .pill-small  { font-size: var(--pill-hasbadge-small)  !important; padding: 3px 7px  !important; }


/*Pagination stuff*/
.pagination-container {
    background: rgba(250, 248, 244, 0.93);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
    margin: 30px auto;
    max-width: 800px;
    border: 1px solid rgba(200, 190, 175, 0.25);
}

@media (max-width: 575.98px) {
    .pagination-container {
        padding: 16px 10px;
    }

    .pagination {
        gap: 4px;
    }

    .pagination .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

.pagination {
    gap: 8px;
}

.pagination .btn {
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid rgba(200, 190, 175, 0.25);
    background: rgba(255, 254, 252, 0.98);
    color: #2f261b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pagination .btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
    border-color: rgba(140, 120, 90, 0.45);
}

.pagination .btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pagination .btn.active {
    background: #6a5d48;
    color: #fff;
    border-color: #6a5d48;
    box-shadow: 0 6px 20px rgba(106, 93, 72, 0.3);
    transform: scale(1.08);
}

.pagination .btn.active:hover {
    background: #584d3d;
    border-color: #584d3d;
    transform: translateY(-2px) scale(1.08);
}

/* Product card enhancements */
#item-container .card {
    border: 1px solid rgba(200, 190, 175, 0.22);
    background: rgba(255, 254, 252, 0.96);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-radius: 12px;
}

#item-container .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(140, 120, 90, 0.35);
}

#item-container .btn-outline-dark {
    border-color: rgba(90, 77, 60, 0.35);
    color: #5a4d3c;
    background: rgba(252, 250, 246, 0.8);
}

#item-container .btn-outline-dark:hover,
#item-container .card:hover .btn-outline-dark {
    background: #6a5d48;
    border-color: #6a5d48;
    color: #fff;
}












