/* Products with Filters Section */
.products-with-filters-section {
    padding: 20px 0 60px 0;
    background: #ffffff;
}

/* .wc-block-product-filter-price-slider__range .range-bar {
    background: #c2410c!important;
} */

.woocommerce-products-header {
    padding-bottom: 20px;
}

.car-shop-taxonomy-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.car-shop-taxonomy-header-title {
    flex: 1;
    text-align: center;
}

.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    width: 100%;
    max-width: 100%;
}

/* Filters Sidebar */
.filters-sidebar {
    background: white;
    border-radius: 12px;
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
}

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

.filters-header h3 {
    font-size: 20px;
    color: #c2410c;
}

.filters-reset {
    background: none;
    border: none;
    color: #ea580c;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

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

.filter-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.price-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    width: 50%;
}

.price-input:focus {
    outline: none;
    border-color: #1e40af;
}

.apply-price-btn {
    width: 100%;
    padding: 10px;
    background: #1e40af;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.apply-price-btn:hover {
    background: #1e3a8a;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 0;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-checkbox span {
    font-size: 14px;
    color: #333;
}

.filter-count {
    margin-left: auto;
    color: #999;
    font-size: 13px;
}

/* Hierarchical Categories Styles */
.hierarchical-categories {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hierarchical-categories .category-item {
    margin: 0;
    padding: 0;
}

.hierarchical-categories .category-item .filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
    position: relative;
    justify-content: space-between;
}

.hierarchical-categories .category-item.depth-0 .filter-checkbox {
    padding-left: 0;
}

.hierarchical-categories .category-item.depth-1 .filter-checkbox {
    padding-left: 25px;
}

.hierarchical-categories .category-item.depth-2 .filter-checkbox {
    padding-left: 50px;
}

.hierarchical-categories .category-item.depth-3 .filter-checkbox {
    padding-left: 75px;
}

.hierarchical-categories .category-item.depth-4 .filter-checkbox {
    padding-left: 100px;
}

.hierarchical-categories .category-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    min-width: 0;
}

.hierarchical-categories .category-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.hierarchical-categories .filter-count {
    color: #999;
    font-size: 13px;
    white-space: nowrap;
}

.hierarchical-categories .toggle-children {
    display: inline-block;
    width: 16px;
    text-align: center;
    cursor: pointer;
    font-size: 10px;
    color: #666;
    user-select: none;
    transition: transform 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.hierarchical-categories .toggle-children:hover {
    color: #ea580c;
}

.hierarchical-categories .category-item.has-children.expanded .toggle-children {
    transform: rotate(90deg);
}

.hierarchical-categories .category-children {
    margin-left: 0;
    padding-left: 0;
    /* border-left: 1px solid #e5e7eb; */
    margin-top: 0;
}

.hierarchical-categories .category-children .category-item {
    border-left: none;
}

.hierarchical-categories .category-item.has-children .filter-checkbox {
    font-weight: 500;
}

.hierarchical-categories .category-item:not(.has-children) .filter-checkbox {
    font-weight: normal;
}

.filters-toggle-mobile {
    display: none;
}

/* Products Main */
.products-main {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* .products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 15px;
} */

.products-toolbar-item {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    flex-wrap: wrap;
}

.products-count {
    font-size: 16px;
    color: #666;
}

.products-count strong {
    color: #1e40af;
    font-weight: 600;
}

.products-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.products-sort label {
    font-size: 14px;
    color: #666;
}

.sort-select {
    padding: 8px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: #1e40af;
}

/* Products Grid - 4 columns */
.products-grid-4col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
}

.product-card-shop {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.product-card-shop:hover {
    border-color: #1e40af;
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.15);
    transform: translateY(-3px);
}

.product-image-shop {
    position: relative;
    height: 180px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-shop img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-label {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.product-label.in-stock {
    background: #10b981;
}

.product-label.on-order {
    background: #f59e0b;
}

.product-label.out-of-stock {
    background: #ef4444;
}

.product-info-shop {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title-shop {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    min-height: 5px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.product-code-shop {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
    margin-top: auto;
}

.product-price .price {
    font-size: 20px;
    font-weight: bold;
    color: #1e40af;
}

.product-price .old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.buy-btn {
    width: 100%;
    padding: 10px;
    background: #ea580c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
}

.buy-btn:hover {
    background: #c2410c;
    transform: scale(1.02);
}

/* Pagination */
.page-numbers {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
    list-style: none;
}

li .page-numbers {
    padding: 10px 15px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

li a.page-numbers {
    padding: 10px 15px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    color: #000;
    text-decoration: none;
}

li .page-numbers:hover:not(:disabled) {
    border-color: #c2410c;
    color: #000000;
}

li .page-numbers.current {
    background: #ea580c;
    color: white;
    border-color: #c2410c;
}

li .page-numbers.current:hover:not(:disabled) {
    border-color: #c2410c;
    color: #ffffff;
}

li .page-numbers:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1200px) {
    .products-grid-4col {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 992px) {
    .woocommerce-products-header {
        padding-bottom: 5px;
    }

    .products-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 300px;
        height: 100vh;
        z-index: 9999;
        overflow-y: auto;
        transition: left 0.3s;
        padding: 20px;
    }

    .filters-sidebar.open {
        left: 0;
    }

    .products-main {
        padding: 20px;
    }

    .products-grid-4col {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .products-toolbar {
        padding: 0 0 15px 0;
    }
}

@media (max-width: 760px) {
    .car-shop-taxonomy-header {
        flex-wrap: wrap;
        justify-content: center;
    }

    .car-shop-taxonomy-header-title {
        flex-basis: 100%;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    .products-main {
        padding: 15px;
        border-radius: 8px;
    }

    .products-grid-4col {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .products-sort {
        flex-direction: column;
        align-items: stretch;
        width: 50%;
    }

    .sort-select {
        width: 100%;
    }

    .product-image-shop {
        height: auto;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 380px) {

    .products-toolbar-item {
        justify-content: center;
    }

    .products-sort {
        width: 100%;
    }

    .product-card-shop {
        min-width: 0;
    }

    .product-title-shop {
        font-size: 20px;
        min-height: 36px;
    }

    .current-price {
        font-size: 18px;
    }
}

/* Search page should behave like a single-column shop */
body.search .products-layout {
    display: block;
    grid-template-columns: none;
    gap: 0;
}

body.search #secondary,
body.search .filters-sidebar,
body.search .filters-header,
body.search .filters-sidebar + * {
    display: none;
}

body.search .products-main {
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}

body.search .products-toolbar {
    justify-content: flex-start;
    padding-bottom: 0;
    border-bottom: none;
}

body.search .products-grid-4col {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 18px;
}

body.search .products-count,
body.search .products-toolbar,
body.search .woocommerce-notices-wrapper {
    width: 100%;
}

a.woocommerce-LoopProduct-link {
    text-decoration: none;
}

/* Sales Page Specific Styles */
.sales-page .page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.sales-page .page-header h1 {
    font-size: 32px;
    color: #c2410c;
    margin-bottom: 15px;
}

.sales-page .page-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-top: 15px;
}

.sales-page .page-description p {
    margin-bottom: 10px;
}

.sales-page .no-filters {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.sales-page .sales-filters-sidebar {
    /* Inherits from .filters-sidebar, can be extended */
}

.sales-page .no-products-found {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
    margin-top: 30px;
}

.sales-page .no-products-found p {
    font-size: 18px;
    color: #666;
}

.sales-page .pagination-wrapper {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e5e7eb;
}

.sales-page .pagination-wrapper .page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.sales-page .pagination-wrapper .page-numbers li {
    list-style: none;
    margin: 0;
}

.sales-page .pagination-wrapper .page-numbers a,
.sales-page .pagination-wrapper .page-numbers span {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    background: white;
}

.sales-page .pagination-wrapper .page-numbers a:hover {
    background: #ea580c;
    color: white;
    border-color: #c2410c;
}

.sales-page .pagination-wrapper .page-numbers .current {
    background: #ea580c;
    color: white;
    border-color: #c2410c;
    cursor: default;
}

.sales-page .pagination-wrapper .page-numbers .dots {
    border: none;
    background: transparent;
    cursor: default;
}

.sales-page .pagination-wrapper .page-numbers .dots:hover {
    background: transparent;
    color: #333;
}

/* Sales badge enhancement for products on sale */
.sales-page .product-card-shop .onsale {
    background: #ea580c;
    color: white;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
}

/* Responsive adjustments for sales page */
@media (max-width: 992px) {
    .sales-page .page-header h1 {
        font-size: 28px;
    }
}

@media (max-width: 576px) {
    .sales-page .page-header h1 {
        font-size: 24px;
    }
    
    .sales-page .page-description {
        font-size: 14px;
    }
    
    .sales-page .pagination-wrapper .page-numbers a,
    .sales-page .pagination-wrapper .page-numbers span {
        padding: 8px 12px;
        font-size: 14px;
    }
}