/**
 * Shop Archive & Filters Styles
 * Surplus Général Tardif
 */

/* Shop Wrapper */
.surplus-shop-wrapper {
    max-width: 1600px;
    margin: 50px auto;
    padding: 20px;
}

/* Shop Header */
.shop-header {
    margin-bottom: 20px;
}

.shop-header .page-title {
    font-size: 32px;
    font-weight: bold;
    text-transform: uppercase;
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
}

/* Breadcrumbs */
.shop-breadcrumb {
    display: none !important;
}

.woocommerce-breadcrumb {
    display: none !important;
}

/* Shop Container - Two Column Layout */
.shop-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* Sidebar */
.shop-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

/* Shop Content */
.shop-content {
    min-width: 0;
}

/* Shop Page Title - WooCommerce Header */
.woocommerce-products-header {
    margin-bottom: 30px;
}

.woocommerce-products-header__title,
.page-title {
    font-size: 48px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    margin: 0 0 15px 0 !important;
    font-family: "Bebas Neue", sans-serif !important;
    letter-spacing: 2px !important;
    color: #000 !important;
}

/* Hide taxonomy description if present */
.term-description {
    display: none;
}

/* Shop Search Bar */
.shop-search-bar {
    margin-bottom: 30px;
}

.search-input-wrapper {
    position: relative;
    max-width: 100%;
}

.shop-search-input {
    width: 100% !important;
    padding: 15px 50px 15px 20px !important;
    font-size: 16px;
    border-radius: 100px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 35px rgba(0, 0, 0, 0.1);
    border: none !important;
}

.shop-search-input:focus {
    outline: none;
    border-color: #c41e1e;
    box-shadow: 0 0 0 3px rgba(196, 30, 30, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.shop-search-input:focus+.search-icon {
    color: #c41e1e;
}

/* Search Autocomplete Results */
.search-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 450px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.search-autocomplete-results.show {
    display: flex;
    flex-direction: column;
}

.search-results-list {
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    color: #333;
}

.search-result-item:hover {
    background: #f9f9f9;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.search-result-details {
    flex: 1;
    min-width: 0;
    font-family: "Bebas Neue", sans-serif;
}

.search-result-title {
    font-size: 14px;
    color: #000;
    margin: 0 0 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-sku {
    font-size: 15px;
    color: #999;
    margin: 0 0 5px 0;
    text-transform: uppercase;
}

.search-result-price {
    font-size: 14px;
    color: #c41e1e;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.search-show-more {
    padding: 12px 15px;
    text-align: center;
    background: #f5f5f5;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    border-top: 1px solid #ddd;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.search-show-more:hover {
    background: #e0e0e0;
}

/* Shop Toolbar */
.shop-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 30px;
}

/* Hide result count */
.woocommerce-result-count {
    display: none !important;
}

/* Custom Shop Ordering */
.custom-shop-ordering {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    float: right;
    margin-bottom: 30px;
}

.ordering-label {
    font-size: 20px;
    text-transform: uppercase;
    color: #000;
    font-family: "Bebas Neue", sans-serif;
}

.ordering-toggle {
    background-color: #ffffff00 !important;
    border: none;
    cursor: pointer !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000 !important;
    transition: color 0.3s ease;
}

.ordering-toggle:hover {
    color: #c41e1e;
}


.ordering-toggle svg {
    width: 28px;
    height: 28px;
}

.ordering-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 100;
}

.ordering-option {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.ordering-option:last-child {
    border-bottom: none;
}

.ordering-option:hover {
    background: #f9f9f9;
    color: #000;
}

.ordering-option.active {
    background: #c41e1e;
    color: #fff;
    font-weight: bold;
}

.ordering-option.active:hover {
    background: #a01818;
}

/* Hide default WooCommerce ordering */
.woocommerce-ordering {
    display: none !important;
}

/* Products Grid */
.products-grid-wrapper {
    margin-bottom: 40px;
}

ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Override WooCommerce default product styles */
.woocommerce ul.products li.product,
ul.products li.product {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    clear: none !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after,
ul.products::before,
ul.products::after {
    display: none !important;
}

/* Product Card Styles */
.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Product Image */
.product-card-image {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card-image img {
    width: 60% !important;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 20px;
}

/* Product Info Section */
.product-card-info {
    padding: 20px;
    text-align: center;
}

/* Product Brand (Red box) */
.product-brand {
    display: inline-block;
    color: #CE2222;
    padding: 4px 12px;
    font-size: 15px;
    text-transform: uppercase;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.5px;
}

/* Product SKU (UGS) */
.product-sku {
    font-size: 14px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 500;
    font-family: "Bebas Neue", sans-serif;
}

/* Product Title */
.product-title {
    font-size: 20px !important;
    /* font-weight: 400; */
    color: #333;
    text-transform: uppercase;
    margin: 0 0 12px 0;
    line-height: 1.4;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.3px;
}

/* Product Price */
.product-price {
    font-size: 24px;
    font-weight: 400 !important;
    color: #000;
    font-family: "Bebas Neue", sans-serif;
}

.product-price .woocommerce-Price-amount {
    font-size: 28px;
}

/* Sale Price Styling */
.product-price del {
    display: block;
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    font-weight: 400 !important;
    margin-bottom: 5px;
}

.product-price del .woocommerce-Price-amount {
    font-size: 16px;
}

.product-price ins {
    text-decoration: none;
    color: #c41e1e !important;
    font-weight: 400 !important;
}

.product-price ins .woocommerce-Price-amount {
    color: #c41e1e !important;
    font-size: 28px;
}

/* Stock Badge (top left of image) */
.product-card-image {
    position: relative;
}

.stock {
    color: #49724A;
    font-family: "Bebas Neue", Sans-serif;
    font-size: 21px;
    font-weight: 400;
    text-transform: none;
    font-style: normal;
    text-decoration: none;
}

.stock.out-of-stock {
    color: #dc3545;
}

/* Filters Sidebar */
.shop-filters-sidebar {
    background: #fff;
    padding: 0px;
    border-radius: 4px;
    /*box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);*/
}

/* Filters Header */
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e5e5;
}

.filters-title {
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
}

.filters-reset {
    background: none;
    border: none;
    color: #c41e1e !important;
    cursor: pointer !important;
    font-size: 13px !important;
    text-decoration: underline;
    padding: 0 !important;
    background-color: #ffffff00 !important;
}

.filters-reset:hover {
    color: #a01818;
}

/* Filter Section */
.filter-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-title {
    font-size: 25px !important;
    font-weight: 500;
    text-transform: uppercase !important;
    margin: 0 0 15px 0;
    color: #000;
    font-family: "Bebas Neue", sans-serif !important;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
}

.product-search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.product-search-input:focus {
    outline: none;
    border-color: #c41e1e;
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    color: #666;
}

.search-button:hover {
    color: #c41e1e;
}

/* Filter Title with Toggle */
.filter-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.filter-toggle {
    ackground: none;
    border: none;
    cursor: pointer !important;
    padding: 5px !important;
    color: #000 !important;
    transition: transform 0.3s ease;
    background-color: #ffffff00 !important;
}

.filter-toggle:hover {
    opacity: 0.7;
}

.filter-toggle.collapsed svg {
    transform: rotate(90deg);
}

.filter-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.filter-content.hidden {
    max-height: 0;
    opacity: 0;
}

/* Price Range Slider */
.price-range-container {
    padding: 10px 0;
}

.price-slider-wrapper {
    position: relative;
    height: 40px;
}

.price-slider-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    background: #000;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0;
    border-radius: 10px;
}

.price-slider {
    position: absolute;
    width: 100%;
    height: 5px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

.price-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
    background: transparent;
}

.price-slider::-moz-range-track {
    width: 100%;
    height: 5px;
    background: transparent;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 1px solid #c41e1e;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    margin-top: -7.5px;
}

.price-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 1px solid #c41e1e;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.price-slider-min {
    z-index: 3;
}

.price-slider-max {
    z-index: 4;
}

.price-slider-wrapper .slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 8px;
    background: #c41e1e;
    pointer-events: none;
    z-index: 2;
}

.price-display {
    text-align: right;
    font-size: 16px;
    color: #000;
    white-space: nowrap;
    font-family: "Bebas Neue", sans-serif;
}

/* Filter Options */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.filter-options::-webkit-scrollbar {
    width: 6px;
}

.filter-options::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    transition: color 0.2s ease;
    font-family: "Bebas Neue", sans-serif;
}

.filter-checkbox:hover {
    color: #000;
}

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

.filter-checkbox-child {
    padding-left: 28px;
    font-size: 13px;
}

.filter-checkbox input[type="checkbox"]:checked+span {
    font-weight: 400;
    color: #000;
}

/* Active Filters */
.active-filters {
    margin-bottom: 20px;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.active-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-family: "Bebas Neue", sans-serif;
    color: #333;
}

.active-filter-badge .remove {
    cursor: pointer;
    font-weight: bold;
    color: #999;
}

.active-filter-badge .remove:hover {
    color: #c41e1e;
}

/* Filter Count */
.filter-count {
    margin-top: 15px;
    padding: 10px;
    background: #f9f9f9;
    text-align: center;
    font-size: 16px;
    color: #666;
    border-radius: 4px;
    font-family: "Bebas Neue", sans-serif;
}

.filter-count strong {
    color: #000;
    font-weight: 400;
}

/* Loading State */
.shop-content.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.shop-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #c41e1e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Filter Toggle Button */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #c41e1e;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 16px;
    font-family: "Bebas Neue", sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(196, 30, 30, 0.4);
    z-index: 999;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mobile-filter-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(196, 30, 30, 0.5);
}

.mobile-filter-toggle svg {
    width: 24px;
    height: 24px;
}

/* Filter Overlay */
.filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Filter Header */
.mobile-filter-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #e5e5e5;
    margin-bottom: 20px;
}

.mobile-filter-header h3 {
    font-size: 24px;
    font-family: "Bebas Neue", sans-serif;
    text-transform: uppercase;
    margin: 0;
}

.mobile-filter-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #000;
    transition: color 0.3s ease;
}

.mobile-filter-close:hover {
    color: #c41e1e;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .shop-container {
        grid-template-columns: 250px 1fr;
        gap: 30px;
    }

    ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {

    /* Show mobile filter button */
    .mobile-filter-toggle {
        display: flex;
    }

    /* Show mobile filter header */
    .mobile-filter-header {
        display: flex;
    }

    /* Hide sidebar by default on mobile */
    .shop-sidebar {
        position: fixed !important;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        overflow-y: auto;
        background: #fff;
        z-index: 1001;
        transition: left 0.3s ease;
        padding: 0 !important;
    }

    .shop-sidebar.active {
        left: 0;
    }

    .shop-sidebar .shop-filters-sidebar {
        box-shadow: none;
        border-radius: 0;
        padding: 20px !important;
    }

    .shop-container {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .shop-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 480px) {
    ul.products {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 15px !important;
    }

    .filters-title {
        font-size: 20px;
    }

    .filter-title {
        font-size: 14px;
    }
}

/* No Products Message */
.woocommerce-no-products-found {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
}