/* Container */
.wtp-shop-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Sidebar */
.wtp-shop-sidebar {
    flex: 0 0 260px;
    width: 260px;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.wtp-shop-sidebar::-webkit-scrollbar {
    width: 4px;
}
.wtp-shop-sidebar::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 4px;
}

.wtp-filter-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.wtp-filter-group {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
.wtp-filter-group:last-child {
    border-bottom: none;
}

.wtp-group-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    color: #333;
}

.wtp-checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}
.wtp-checkbox-label input {
    margin-right: 10px;
}

/* Price Range */
.wtp-price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.wtp-price-inputs input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}
.wtp-price-slider-range {
    position: relative;
    height: 30px;
}
.wtp-price-slider-range input[type=range] {
    position: absolute;
    width: 100%;
    pointer-events: none;
    -webkit-appearance: none;
    background: none;
    top: 5px;
}
.wtp-price-slider-range input[type=range]::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #4a69bd;
    cursor: pointer;
    margin-top: -6px;
    position: relative;
    z-index: 2;
}
.wtp-price-slider-range input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
}
.wtp-price-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

/* Buttons */
.wtp-btn-primary {
    width: 100%;
    background: #2b62c6;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
}
.wtp-btn-primary:hover {
    background: #1e4b9e;
}
.wtp-btn-link {
    width: 100%;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    text-decoration: underline;
}

/* Main Content */
.wtp-shop-main {
    flex: 1;
    min-width: 0;
}

/* Header */
.wtp-shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}
.wtp-page-title {
    font-size: 24px;
    margin: 0 0 5px;
}
.wtp-result-count {
    color: #666;
    font-size: 14px;
}
.wtp-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Styled Select Box */
.wtp-sort-wrapper {
    position: relative;
    display: inline-block;
}
.wtp-sort-wrapper::after {
    content: "▼";
    font-size: 10px;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
}
#wtp-sort-by {
    padding: 10px 30px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    min-width: 180px;
    height: 42px; /* Fixed height for alignment */
}
#wtp-sort-by:focus {
    outline: none;
    border-color: #2b62c6;
}

.wtp-view-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    height: 42px; /* Match sort height */
}
.wtp-view-btn {
    background: #fff;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    border-right: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
}
.wtp-view-btn:last-child {
    border-right: none;
}
.wtp-view-btn.active {
    background: #f5f5f5;
    color: #2b62c6;
}
.wtp-view-btn i {
    pointer-events: none;
}

/* Grid */
.wtp-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
    position: relative; /* For loader overlay */
    min-height: 200px;
}

/* Card */
.wtp-shop-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
    position: relative;
}
.wtp-shop-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.wtp-card-image-wrap {
    position: relative;
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wtp-card-image-wrap img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

.wtp-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}
.wtp-badge-instock { background: #28a745; }
.wtp-badge-out { background: #6c757d; }
.wtp-badge-sale { background: #dc3545; }

.wtp-card-content {
    padding: 20px;
}
.wtp-card-cat {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}
.wtp-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.4;
}
.wtp-card-title a {
    color: #333;
    text-decoration: none;
}
.wtp-card-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #f1c40f;
}
.wtp-review-count {
    color: #999;
}

.wtp-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #2b62c6;
    margin-bottom: 15px;
}
.wtp-card-price del {
    color: #999;
    font-size: 14px;
    font-weight: 400;
    margin-left: 5px;
}

.wtp-add-to-cart-btn {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    background: #2b62c6;
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.wtp-add-to-cart-btn:hover {
    background: #1e4b9e;
    color: #fff;
}
.wtp-add-to-cart-btn.disabled {
    background: #ddd;
    cursor: not-allowed;
    color: #999;
}

/* Pagination */
.wtp-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
    padding: 0;
    list-style: none; /* Fix for ul output */
}
.wtp-pagination ul {
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.wtp-pagination li {
    list-style: none;
    margin: 0;
    padding: 0;
}
.wtp-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    background: #fff;
    transition: all 0.2s;
    font-size: 14px;
}
.wtp-pagination .page-numbers.current {
    background: #2b62c6;
    color: #fff;
    border-color: #2b62c6;
}
.wtp-pagination .page-numbers:hover:not(.current) {
    background: #f9f9f9;
    border-color: #ccc;
    color: #2b62c6;
}
.wtp-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
}
.wtp-pagination .wtp-page-arrow {
    font-size: 16px;
    line-height: 1;
}

/* Loading Animation */
.wtp-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    border-radius: 8px;
}

.wtp-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #e5e5e5;
    border-bottom-color: #2b62c6;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: wtp-rotation 1s linear infinite;
}

@keyframes wtp-rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading State for Grid */
.wtp-product-grid.loading {
    /* Optional: can add specific styles for the grid itself when loading */
}

/* Mobile Filter Toggle & Sidebar */
#wtp-mobile-filter-toggle {
    display: none;
}
#wtp-mobile-filter-close {
    display: none;
}

@media (max-width: 768px) {
    #wtp-mobile-filter-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        top: 30%;
        left: 0;
        z-index: 999;
        background: #2b62c6;
        color: #fff;
        border: none;
        padding: 10px 15px;
        border-radius: 0 4px 4px 0;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
        transition: transform 0.2s;
    }
    #wtp-mobile-filter-toggle:active {
        transform: scale(0.95);
    }

    .wtp-shop-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 10000;
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
        border-radius: 0;
        margin: 0;
        flex: none;
    }
    .wtp-shop-sidebar.active {
        left: 0;
        box-shadow: 5px 0 25px rgba(0,0,0,0.2);
    }

    #wtp-mobile-filter-close {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 20px;
        color: #999;
        cursor: pointer;
        padding: 5px;
        z-index: 10;
    }

    /* Backdrop */
    .wtp-filter-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }
    .wtp-filter-backdrop.active {
        opacity: 1;
        visibility: visible;
    }
}
