/* Products Header Styling */
.products-top {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.products-info h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}

.results-text {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.products-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-switcher {
    display: flex;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 8px;
    gap: 4px;
}

.view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.view-btn.active {
    background: #fff;
    color: #ff6b35;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.sort-dropdown {
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    outline: none;
    cursor: pointer;
    background: #fff;
}

/* Filter Styles Restoration */
.filter-title {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-weight: 600;
    color: #333;
    border-bottom: none;
    /* Removed extra line */
}

.filter-title:hover {
    color: #ff6b35;
}

.filter-group {
    border-bottom: 1px solid #f0f0f0;
}

.filter-options {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 1;
}

.filter-group.collapsed .filter-options {
    max-height: 0;
    opacity: 0;
    display: block;
    /* Ensure it's not and display:none for animation to work */
}

.filter-chevron {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-group.collapsed .filter-chevron {
    transform: rotate(-90deg) !important;
}

/* Price Filter */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 20px 0;
}

.price-input-wrapper {
    position: relative;
    flex: 1;
}

.price-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    background: #fff;
    -moz-appearance: textfield;
    appearance: textfield;
}

.price-input:focus {
    border-color: #ff6b35;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Remove number input arrows */
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.price-separator {
    color: #999;
    font-weight: 500;
}

/* Products Container Layout */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 30px !important;
    margin-top: 20px;
}

#productsGridContainer[data-view="list"] .products-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
}

#productsGridContainer[data-view="list"] .product-card {
    flex-direction: row !important;
    align-items: stretch;
    padding: 30px;
}

#productsGridContainer[data-view="list"] .product-image-box {
    flex: 0 0 280px;
    max-width: 280px;
    height: 280px;
    background: #fcfcfc;
    border-radius: 12px;
}

#productsGridContainer[data-view="grid"] .products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
}

#productsGridContainer[data-view="grid"] .product-card {
    flex-direction: column !important;
}

/* Base Product Card */
.product-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-8px);
    border-color: #ff6b35;
}

/* Base Image Box */
.product-image-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    height: 280px;
    width: 100%;
    margin-bottom: 20px;
}

.product-image-link {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.product-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

/* Base Product Buttons */
.add-cart-btn {
    flex: 1;
    height: 44px;
    background: #ff6b35;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-cart-btn:hover:not(:disabled) {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.compare-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

#productsGridContainer[data-view="list"] .product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 0 0 10px;
}

#productsGridContainer[data-view="grid"] .product-details,
#productsGridContainer:not([data-view="list"]) .product-details {
    padding-top: 5px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#productsGridContainer[data-view="grid"] .product-title,
#productsGridContainer:not([data-view="list"]) .product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

#productsGridContainer[data-view="grid"] .product-actions,
#productsGridContainer:not([data-view="list"]) .product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
}

#productsGridContainer[data-view="list"] .add-cart-btn {
    flex: 1;
    max-width: 500px;
    height: 48px;
    background: #ff6b35;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

#productsGridContainer[data-view="list"] .add-cart-btn:hover {
    background: #e55a2b;
}

#productsGridContainer[data-view="list"] .compare-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

#productsGridContainer[data-view="list"] .compare-btn:hover {
    background: #e0e0e0;
}

.currency {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.review-count {
    font-size: 12px;
    color: #999;
}

/* Quick View Button */
.quick-view-btn {
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    cursor: pointer;
    z-index: 5;
}

.product-card:hover .quick-view-btn {
    opacity: 1;
    transform: translateY(-20px);
}

/* Badge and Wishlist */
.product-badge.NEW {
    background: #10b981;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
}

.wishlist-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 2;
}

.wishlist-icon:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.wishlist-icon.liked {
    color: #ef4444;
}

/* Responsive Grid Adjustments */
@media (max-width: 991px) {
    #productsGridContainer[data-view="list"] .product-card {
        padding: 20px;
        gap: 20px;
    }

    #productsGridContainer[data-view="list"] .product-image-box {
        flex: 0 0 200px;
        max-width: 200px;
        height: 200px;
    }
}

@media (max-width: 767px) {
    #productsGridContainer[data-view="list"] .product-card {
        flex-direction: column;
    }

    #productsGridContainer[data-view="list"] .product-image-box {
        max-width: 100%;
        width: 100%;
        height: 250px;
    }

    .products-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .products-controls {
        width: 100%;
        justify-content: space-between;
    }
}

.products-main {
    position: relative;
}

/* Smooth Loading Overlay */
.products-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.products-loading-overlay.show {
    opacity: 1;
}

.loading-content {
    text-align: center;
    z-index: 10;
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--primary-color, #ff6b35);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: rgba(255, 107, 53, 0.7);
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: rgba(255, 107, 53, 0.4);
}

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

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

.loading-text {
    color: var(--gray-600, #6b7280);
    font-size: 16px;
    margin: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Smooth fade-in for products content */
#productsContent {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

#productsContent.fade-out {
    opacity: 0;
}

#productsContent.fade-in {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth product card animations */
.product-card {
    animation: slideInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.product-card:nth-child(1) {
    animation-delay: 0.05s;
}

.product-card:nth-child(2) {
    animation-delay: 0.1s;
}

.product-card:nth-child(3) {
    animation-delay: 0.15s;
}

.product-card:nth-child(4) {
    animation-delay: 0.2s;
}

.product-card:nth-child(5) {
    animation-delay: 0.25s;
}

.product-card:nth-child(6) {
    animation-delay: 0.3s;
}

.product-card:nth-child(7) {
    animation-delay: 0.35s;
}

.product-card:nth-child(8) {
    animation-delay: 0.4s;
}

.product-card:nth-child(9) {
    animation-delay: 0.45s;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Variant Selection Modal Styles */
.variant-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.variant-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.variant-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.variant-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.variant-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.variant-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.variant-modal-close:hover {
    color: #1f2937;
}

.variant-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.variant-product-info {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.variant-product-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.variant-product-details {
    flex: 1;
}

.variant-product-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.variant-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.variant-item {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.variant-item:hover {
    border-color: var(--primary-color, #ff6b35);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
}

.variant-item.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
}

.variant-item-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.variant-item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.variant-item-details {
    flex: 1;
    min-width: 0;
}

.variant-item-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.variant-attr {
    font-size: 14px;
    color: #4b5563;
}

.variant-attr strong {
    color: #1f2937;
    font-weight: 600;
}

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

.variant-price-current {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color, #ff6b35);
}

.variant-price-original {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
}

.variant-discount {
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.variant-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.variant-stock {
    font-size: 13px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
}

.variant-stock.in-stock {
    color: #10b981;
    background: #d1fae5;
}

.variant-stock.out-of-stock {
    color: #ef4444;
    background: #fee2e2;
}

.variant-select-btn {
    background: var(--primary-color, #ff6b35);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-select-btn:hover:not(:disabled) {
    background: var(--primary-color-dark, #e55a2b);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.variant-select-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    opacity: 0.6;
}

.variant-loading,
.variant-error {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 16px;
}

.variant-loading i {
    margin-right: 8px;
}

.variant-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

.variant-modal-cancel {
    background: #f3f4f6;
    color: #4b5563;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-modal-cancel:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Responsive Design */
@media (max-width: 768px) {
    .variant-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .variant-modal-header {
        padding: 16px 20px;
    }

    .variant-modal-body {
        padding: 20px;
    }

    .variant-product-info {
        flex-direction: column;
        text-align: center;
    }

    .variant-product-image {
        margin: 0 auto;
    }

    .variant-item-content {
        flex-direction: column;
    }

    .variant-item-image {
        margin: 0 auto;
    }

    .variant-item-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .variant-select-btn {
        width: 100%;
    }
}

/* Products Announcement Styles */
.products-announcement {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    margin: 20px auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px dashed #cbd5e0;
}

/* Top announcement - 1248 x 132 */
.products-announcement.products-announcement-top {
    max-width: 1248px;
    height: 132px;
    margin-top: 20px;
    margin-bottom: 24px;
}

/* Bottom announcement - 961 x 132 */
.products-announcement.products-announcement-bottom {
    max-width: 961px;
    height: 132px;
    margin-top: 24px;
    margin-bottom: 0;
}

/* When has actual announcement image */
.products-announcement:has(.announcement-image),
.products-announcement:has(.announcement-link) {
    background: none;
    border: none;
}

.products-announcement .announcement-link {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.products-announcement .announcement-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.products-announcement .announcement-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 12px;
}

/* Placeholder styles when no announcement */
.products-announcement .ad-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #4a5568;
    text-align: center;
    height: 100%;
    padding: 20px;
    transition: all 0.3s ease;
}

/* Hover only for placeholder (when no announcement) */
.products-announcement:has(.ad-placeholder-content):hover {
    border-color: #4299e1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.products-announcement:has(.ad-placeholder-content):hover .ad-placeholder-content {
    color: white;
}

.products-announcement .ad-placeholder-content i {
    font-size: 28px;
    opacity: 0.5;
}

.products-announcement .ad-placeholder-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.products-announcement .ad-placeholder-text strong {
    font-size: 14px;
    font-weight: 600;
}

.products-announcement .ad-placeholder-text small {
    font-size: 11px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .products-announcement {
        border-radius: 8px;
        margin: 16px auto;
        height: auto;
        min-height: 80px;
    }

    .products-announcement.products-announcement-top,
    .products-announcement.products-announcement-bottom {
        max-width: 100%;
        height: auto;
        min-height: 80px;
    }

    .products-announcement .announcement-image {
        border-radius: 8px;
        height: auto;
    }

    .products-announcement.products-announcement-top {
        margin-bottom: 16px;
    }

    .products-announcement.products-announcement-bottom {
        margin-top: 16px;
    }
}

/* Categories Bar */
.categories-bar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 0;
    margin-bottom: 24px;
}

.categories-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.categories-scroll::-webkit-scrollbar {
    height: 6px;
}

.categories-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.categories-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.categories-scroll::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 24px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.category-chip:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-chip.active {
    background: var(--primary-color, #ff6b35);
    color: #fff;
    border-color: var(--primary-color, #ff6b35);
    font-weight: 600;
}

.category-chip.active:hover {
    background: var(--primary-color-dark, #e55a2b);
    border-color: var(--primary-color-dark, #e55a2b);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .categories-bar {
        padding: 12px 0;
        margin-bottom: 16px;
    }

    .category-chip {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* =========================================
   Responsive Filter & Layout Styles
   ========================================= */

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

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

/* Products Layout */
.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

/* Sidebar Styles */
.filters-sidebar {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 24px;
    position: sticky;
    top: 100px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.filter-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.clear-filters {
    font-size: 13px;
    color: #ef4444;
    text-decoration: underline;
    cursor: pointer;
}

.filter-close-btn {
    display: none;
    /* Hidden on desktop */
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    z-index: 10;
}

/* Filter Groups */
.filter-group {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

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

.filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    cursor: pointer;
}

.filter-options {
    display: grid;
    gap: 10px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
}

.filter-option input {
    display: none;
}

.filter-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.filter-option input:checked+.filter-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.filter-checkbox::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #fff;
    font-size: 10px;
    display: none;
}

.filter-option input:checked+.filter-checkbox::after {
    display: block;
}

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

/* Filter Toggle Button (Mobile) */
.filter-toggle-btn {
    display: none;
    /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary, #E85D04);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(232, 93, 4, 0.2);
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
    background: var(--primary-dark, #D45103);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.3);
}

/* RESPONSIVE DESIGN */
@media (max-width: 991px) {
    .products-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        z-index: 10000;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        border: none;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        padding-top: 60px;
    }

    [dir="rtl"] .filters-sidebar {
        left: auto;
        right: -320px;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

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

    [dir="rtl"] .filters-sidebar.active {
        right: 0;
        left: auto;
    }

    .filter-close-btn {
        display: block;
        top: 20px;
        right: 20px;
    }

    [dir="rtl"] .filter-close-btn {
        right: auto;
        left: 20px;
    }

    .filter-toggle-btn {
        display: flex;
    }

    .products-info {
        width: 100%;
        margin-bottom: 15px;
    }

    .products-controls {
        width: 100%;
        justify-content: space-between;
        gap: 15px;
    }

    .sort-dropdown {
        flex: 1;
    }
}

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

    /* List View Tablet/Mobile */
    #productsGridContainer[data-view="list"] .products-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    #productsGridContainer[data-view="list"] .product-card {
        flex-direction: row !important;
        /* Keep horizontal on tablets */
        align-items: center;
        gap: 20px;
        padding: 20px !important;
    }

    #productsGridContainer[data-view="list"] .product-image-box {
        flex: 0 0 150px;
        max-width: 150px !important;
        height: 150px !important;
        margin-bottom: 0;
    }

    .products-controls {
        flex-wrap: wrap;
        gap: 10px;
    }

    .sort-dropdown {
        width: 100%;
        flex: 100% !important;
        order: 3;
    }

    .view-switcher,
    .filter-toggle-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {

    /* Grid view: 2 columns */
    #productsGridContainer[data-view="grid"] .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* List view: Horizontal list style */
    #productsGridContainer[data-view="list"] .product-card {
        flex-direction: row !important;
        align-items: center;
        gap: 12px;
        padding: 10px !important;
    }

    #productsGridContainer[data-view="list"] .product-image-box {
        flex: 0 0 100px;
        width: 100px !important;
        height: 100px !important;
        margin-bottom: 0;
    }

    #productsGridContainer[data-view="list"] .product-title {
        font-size: 14px;
        margin-bottom: 5px;
        min-height: auto;
    }

    #productsGridContainer[data-view="list"] .product-details {
        padding: 0;
    }

    .product-card {
        padding: 10px !important;
    }

    .product-title {
        font-size: 13px;
        min-height: 38px;
    }
}