/**
 * TNCODTHEME - Shop Page Styles
 * Modern sidebar filters with AJAX
 * Version: 1.0
 * Author: digitaliny
 */

/* ===========================================
   SHOP PAGE LAYOUT
   =========================================== */

/* Override main padding for shop page */
.main.shop-main {
    padding: 30px 0;
}

/* Shop Page Title - Direct child of main.shop-main */
.main.shop-main>.shop-page-title {
    max-width: 1400px;
    margin: 0 auto 25px;
    padding: 0 20px 15px;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3436;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.main.shop-main>.shop-page-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 20px;
    width: 80px;
    height: 2px;
    background: var(--primary-color, #00b894);
}

.shop-page-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Sidebar */
.shop-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

/* Hide scrollbar for Chrome/Safari/Opera */
.shop-sidebar::-webkit-scrollbar {
    display: none;
}

/* Products Area */
.shop-products {
    flex: 1;
    min-width: 0;
}

/* ===========================================
   SIDEBAR FILTER STYLES
   =========================================== */

.filter-section {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
}

.filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: #2d3436;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.filter-title::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    transition: transform 0.3s ease;
}

.filter-section.collapsed .filter-title::after {
    transform: rotate(-90deg);
}

.filter-section.collapsed .filter-content {
    display: none;
}

/* Category Filter */
.filter-categories {
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-categories li {
    margin-bottom: 8px;
}

.filter-categories label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #4a4a5a;
    cursor: pointer;
    transition: color 0.2s ease;
}

.filter-categories label:hover {
    color: var(--primary-color, #00b894);
}

.filter-categories input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color, #00b894);
    cursor: pointer;
}

.filter-categories .count {
    margin-right: auto;
    color: #999;
    font-size: 12px;
}

/* Price Range Filter */
.price-range-slider {
    margin: 15px 0;
}

.price-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-inputs input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.price-inputs span {
    color: #999;
}

/* Color Swatches */
.filter-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: var(--primary-color, #00b894);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary-color, #00b894);
}

.color-swatch.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Size Filter */
.filter-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-btn {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #4a4a5a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.size-btn:hover {
    border-color: var(--primary-color, #00b894);
    color: var(--primary-color, #00b894);
}

.size-btn.active {
    background: var(--primary-color, #00b894);
    border-color: var(--primary-color, #00b894);
    color: #fff;
}

/* Filter Buttons */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.filter-apply-btn {
    flex: 1;
    padding: 12px 20px;
    background: var(--primary-color, #00b894) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-apply-btn:hover {
    background: var(--secondary-color, #00a885) !important;
    transform: translateY(-2px);
}

.filter-clear-btn {
    padding: 12px 20px;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-clear-btn:hover {
    border-color: #999;
    color: #333;
}

/* ===========================================
   SHOP HEADER / TOOLBAR
   =========================================== */

.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.shop-result-count {
    font-size: 14px;
    color: #666;
}

.shop-result-count strong {
    color: #2d3436;
}

.shop-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.shop-sort select {
    padding: 10px 35px 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat left 10px center/12px;
    appearance: none;
    cursor: pointer;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn.active {
    background: var(--primary-color, #00b894);
    border-color: var(--primary-color, #00b894);
    color: #fff;
}

/* ===========================================
   LOADING STATE
   =========================================== */

.shop-products.loading {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
}

.shop-products.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color, #00b894);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===========================================
   MOBILE RESPONSIVE
   =========================================== */

@media (max-width: 991px) {
    .shop-page-wrapper {
        flex-direction: column;
    }

    .shop-sidebar {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100vh;
        max-height: 100vh;
        background: #fff;
        z-index: 9999;
        transition: right 0.3s ease;
        padding: 20px;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    .shop-sidebar.open {
        right: 0;
    }

    .mobile-filter-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        background: var(--primary-color, #00b894);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }

    .sidebar-close-btn {
        position: absolute;
        top: 15px;
        left: 15px;
        width: 40px;
        height: 40px;
        background: #f5f5f5;
        border: none;
        border-radius: 50%;
        font-size: 20px;
        cursor: pointer;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.open {
        opacity: 1;
        visibility: visible;
    }
}

@media (min-width: 992px) {

    .mobile-filter-btn,
    .sidebar-close-btn,
    .sidebar-overlay {
        display: none;
    }
}

/* ===========================================
   PAGINATION
   =========================================== */

.woocommerce-pagination {
    margin-top: 40px;
    text-align: center;
}

.woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-pagination li a,
.woocommerce-pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #4a4a5a;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.woocommerce-pagination li a:hover {
    border-color: var(--primary-color, #00b894);
    color: var(--primary-color, #00b894);
}

.woocommerce-pagination li span.current {
    background: var(--primary-color, #00b894);
    border-color: var(--primary-color, #00b894);
    color: #fff;
}