/**
 * Product Page Layout Styles - PHASE 3
 * Version: 3.8.0
 * Date: November 19, 2025
 *
 * Flexible product page layout system with:
 * - 6 grid layouts (2-5 columns, list, masonry)
 * - 6 card styles (minimal, bordered, shadow, overlay, compact, detailed)
 * - 6 hover effects (zoom, lift, quickview, gallery, overlay, none)
 * - Responsive breakpoints for all layouts
 */

/* =====================================================
   BASE PRODUCT GRID CONTAINER
   ===================================================== */

.products-container {
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

.products-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

/* =====================================================
   GRID LAYOUT VARIATIONS
   ===================================================== */

/* 2 Column Grid - Large Cards */
.products-grid.product-grid-2col {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* 3 Column Grid - Default Medium Cards */
.products-grid.product-grid-3col {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* 4 Column Grid - Compact Cards */
.products-grid.product-grid-4col {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* 5 Column Grid - Dense Display */
.products-grid.product-grid-5col {
    grid-template-columns: repeat(5, 1fr) !important;
}

/* List View - Full Width Rows */
.products-grid.product-grid-list {
    grid-template-columns: 1fr !important;
    gap: 15px;
}

/* Masonry Grid - Pinterest Style */
.products-grid.product-grid-masonry {
    column-count: 3 !important;
    column-gap: 25px;
    display: block !important;
}

.product-grid-masonry .product-card {
    break-inside: avoid;
    margin-bottom: 25px;
}

/* =====================================================
   PRODUCT CARD BASE STYLES
   ===================================================== */

.product-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* =====================================================
   PRODUCT IMAGE CONTAINER
   ===================================================== */

.product-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f9fafb;
}

.product-image-aspect {
    position: relative;
    padding-bottom: 100%; /* Default 1:1, adjusted via inline style */
}

.product-image-aspect .product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: #d1d5db;
}

/* =====================================================
   PRODUCT CARD CONTENT
   ===================================================== */

.product-card-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}

.product-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.product-badge.brand {
    background: #dbeafe;
    color: #1e40af;
}

.product-badge.category {
    background: #fce7f3;
    color: #be185d;
}

.product-badge.sku {
    background: #f3f4f6;
    color: #4b5563;
    font-family: monospace;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-model {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #059669;
    margin: auto 0 10px 0;
}

.product-button {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.product-button.btn-primary {
    background: #6366f1;
    color: white;
}

.product-button.btn-primary:hover {
    background: #4f46e5;
}

.product-button.btn-secondary {
    background: #8b5cf6;
    color: white;
}

.product-button.btn-secondary:hover {
    background: #7c3aed;
}

.product-button.btn-outline {
    background: transparent;
    color: #6366f1;
    border: 2px solid #6366f1;
}

.product-button.btn-outline:hover {
    background: #6366f1;
    color: white;
}

.product-button.btn-theme {
    background: var(--theme-primary-color, #6366f1);
    color: white;
    transition: all 0.3s ease;
}

.product-button.btn-theme:hover {
    filter: brightness(0.85);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* =====================================================
   CARD STYLE VARIATIONS
   ===================================================== */

/* Minimal Card - Clean and Simple */
.product-card-minimal {
    background: white;
    box-shadow: none;
    border: none;
}

.product-card-minimal .product-card-content {
    padding: 12px;
}

.product-card-minimal .product-image-wrapper {
    background: white;
}

.product-card-minimal:hover {
    transform: none;
}

/* Bordered Card - Clear Separation */
.product-card-bordered {
    border: 2px solid #e5e7eb;
    box-shadow: none;
}

.product-card-bordered:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Shadow Card - Elevated Appearance (Default) */
.product-card-shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.product-card-shadow:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Overlay Card - Image with Text Overlay */
.product-card-overlay {
    position: relative;
}

.product-card-overlay .product-card-link {
    position: relative;
}

.product-card-overlay .product-image-wrapper {
    height: 350px;
}

.product-card-overlay .product-image-aspect {
    height: 100%;
    padding-bottom: 0;
}

.product-card-overlay .product-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
    color: white;
    padding: 20px;
    z-index: 10;
}

.product-card-overlay .product-title,
.product-card-overlay .product-model,
.product-card-overlay .product-price {
    color: white;
}

.product-card-overlay .product-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.product-card-overlay .product-button {
    background: rgba(255, 255, 255, 0.9);
    color: #111827;
}

.product-card-overlay .product-button:hover {
    background: white;
}

/* Compact Card - Horizontal Layout with Small Thumbnail */
/* Force horizontal layout by overriding ALL base card styles with !important */
.products-grid .product-card.product-card-compact {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
}

.products-grid .product-card.product-card-compact > .product-card-link {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
}

/* Small thumbnail image on the left */
.products-grid .product-card-compact .product-image-wrapper {
    position: relative !important;
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    height: 110px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
}

.products-grid .product-card-compact .product-image-aspect {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
}

.products-grid .product-card-compact .product-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Content on the right side */
.products-grid .product-card-compact .product-card-content {
    flex: 1 !important;
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

/* Compact typography */
.products-grid .product-card-compact .product-title {
    font-size: 14px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.products-grid .product-card-compact .product-model {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.products-grid .product-card-compact .product-price {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.products-grid .product-card-compact .product-meta {
    margin-bottom: 6px;
    gap: 4px;
}

.products-grid .product-card-compact .product-badge {
    font-size: 10px;
    padding: 2px 6px;
}

.products-grid .product-card-compact .product-button {
    padding: 8px 12px;
    font-size: 12px;
    width: auto;
    align-self: flex-start;
}

/* Detailed Card - Large with Extensive Info */
.product-card-detailed {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-card-detailed .product-image-wrapper {
    height: 280px;
}

.product-card-detailed .product-image-aspect {
    height: 100%;
    padding-bottom: 0;
}

.product-card-detailed .product-card-content {
    padding: 20px;
}

.product-card-detailed .product-title {
    font-size: 18px;
    -webkit-line-clamp: 3;
    margin-bottom: 12px;
    font-weight: 600;
}

.product-card-detailed .product-model {
    font-size: 14px;
    margin-bottom: 12px;
    color: #6b7280;
}

.product-card-detailed .product-price {
    font-size: 22px;
    margin-bottom: 15px;
    font-weight: 700;
}

.product-card-detailed .product-button {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
}

/* =====================================================
   HOVER EFFECTS
   ===================================================== */

/* Zoom Effect - Scale Image */
.hover-zoom:hover .product-image {
    transform: scale(1.1);
}

/* Lift Effect - Lift Card with Shadow */
.hover-lift .product-image {
    transition: none; /* Disable image zoom for lift effect */
}

.hover-lift:hover .product-image {
    transform: none !important; /* Prevent any image transform on hover */
}

.hover-lift:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* None Effect - No hover effects */
.product-card.hover-none * {
    transition: none !important; /* Disable ALL transitions */
}

.product-card.hover-none .product-image {
    transition: none !important; /* Disable image transitions */
}

.product-card.hover-none:hover .product-image {
    transform: none !important; /* Prevent any image transform on hover */
}

.product-card.hover-none:hover {
    transform: none !important; /* Prevent card transform on hover */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important; /* Keep original shadow */
}

.product-card.hover-none:hover .product-image-wrapper {
    transform: none !important;
}

/* Quick View Effect - Show Button on Hover (Uses Theme Secondary Color) */
.hover-quickview .quick-view-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    background: var(--theme-secondary-color, #8b5cf6);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
    border: none;
    cursor: pointer;
}

.hover-quickview:hover .quick-view-btn {
    opacity: 1;
    pointer-events: auto;
}

.hover-quickview:hover .product-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 5;
    pointer-events: none;
}

/* ===================================================================
   QUICK VIEW MODAL
   ================================================================ */

.quick-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.quick-view-modal.active {
    opacity: 1;
    pointer-events: auto;
}

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

.quick-view-content {
    position: relative;
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.quick-view-modal.active .quick-view-content {
    transform: scale(1);
}

.quick-view-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease, transform 0.2s ease;
}

.quick-view-close:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.1);
}

.quick-view-title {
    padding: 15px 20px;
    margin: 0;
    background: linear-gradient(135deg, var(--theme-primary-color, #6366f1), var(--theme-secondary-color, #8b5cf6));
    color: white;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.quick-view-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    cursor: pointer;
    min-height: 400px;
}

.quick-view-image {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-view-footer {
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.quick-view-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: #6c757d;
}

.quick-view-hint::before {
    content: '👆';
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .quick-view-content {
        max-width: 95vw;
        border-radius: 8px;
    }

    .quick-view-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
    }

    .quick-view-title {
        padding: 12px 15px;
        font-size: 16px;
    }

    .quick-view-image-wrapper {
        padding: 15px;
        min-height: 300px;
    }

    .quick-view-image {
        max-height: 60vh;
    }

    .quick-view-footer {
        padding: 10px 15px;
    }

    .quick-view-hint {
        font-size: 12px;
    }
}

/* Gallery Effect - Show Additional Images */
.product-card.hover-gallery .product-image {
    transition: opacity 0.3s ease !important; /* Only transition opacity for image switching */
}

.product-card.hover-gallery:hover .product-image {
    transform: none !important; /* Prevent zoom on hover */
}

.product-card.hover-gallery:hover .product-image-wrapper {
    transform: none !important; /* Prevent wrapper zoom */
}

.hover-gallery .product-gallery-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.hover-gallery:hover .product-gallery-dots {
    opacity: 1;
}

.product-gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0.6;
    cursor: pointer;
}

.product-gallery-dot.active {
    opacity: 1;
}

/* Overlay Effect - Color Overlay on Hover (Uses Theme Secondary Color) */
.hover-overlay .product-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--theme-secondary-color, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.hover-overlay:hover .product-image-wrapper::before {
    opacity: 0.3;
}

/* =====================================================
   LIST VIEW SPECIFIC STYLES
   ===================================================== */

/* List view overrides card styles for horizontal layout */
.product-grid-list .product-card {
    flex-direction: row !important;
    align-items: stretch;
}

/* List view cards should not use overlay style */
.product-grid-list .product-card-overlay .product-card-content {
    position: relative;
    background: white;
    color: inherit;
    padding: 20px;
}

.product-grid-list .product-card-overlay .product-title,
.product-grid-list .product-card-overlay .product-model,
.product-grid-list .product-card-overlay .product-price {
    color: inherit;
}

.product-grid-list .product-card-overlay .product-image-wrapper {
    height: auto;
}

.product-grid-list .product-card-link {
    flex-direction: row !important;
}

.product-grid-list .product-image-wrapper {
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
}

.product-grid-list .product-image-aspect {
    height: 100%;
    padding-bottom: 0;
}

.product-grid-list .product-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-grid-list .product-title {
    font-size: 20px;
    -webkit-line-clamp: 2;
}

.product-grid-list .product-model {
    font-size: 14px;
}

.product-grid-list .product-price {
    font-size: 20px;
    font-weight: 600;
}

.product-grid-list .product-button {
    width: auto;
    align-self: flex-start;
    padding: 10px 30px;
    margin-top: auto;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
    /* Reduce grid columns */
    .product-grid-5col {
        grid-template-columns: repeat(4, 1fr);
    }

    .product-grid-4col {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-grid-masonry {
        column-count: 2;
    }

    .product-grid-list .product-image-wrapper {
        width: 200px;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .products-grid {
        gap: 15px;
    }

    /* Stack to 2 columns max */
    .product-grid-5col,
    .product-grid-4col,
    .product-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-grid-2col {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-grid-masonry {
        column-count: 2;
    }

    /* List view becomes vertical */
    .product-grid-list .product-card {
        flex-direction: column;
    }

    .product-grid-list .product-card-link {
        flex-direction: column !important;
    }

    .product-grid-list .product-image-wrapper {
        width: 100%;
        min-width: 100%;
    }

    .product-grid-list .product-image-aspect {
        padding-bottom: 100%;
        height: auto;
    }

    /* Compact cards become vertical on mobile */
    .products-grid .product-card.product-card-compact {
        flex-direction: column !important;
    }

    .products-grid .product-card.product-card-compact > .product-card-link {
        flex-direction: column !important;
    }

    .products-grid .product-card-compact .product-image-wrapper {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }

    .products-grid .product-card-compact .product-image-aspect {
        padding-bottom: 100%;
    }

    /* Overlay cards adjust height on mobile */
    .product-card-overlay .product-image-wrapper {
        height: 250px;
    }

    .product-card-overlay .product-card-content {
        padding: 15px;
    }

    /* Detailed cards reduce padding on mobile */
    .product-card-detailed .product-image-wrapper {
        height: 200px;
    }

    .product-card-detailed .product-card-content {
        padding: 15px;
    }

    .product-card-detailed .product-title {
        font-size: 16px;
    }

    .product-card-detailed .product-price {
        font-size: 18px;
    }

    .product-card-content {
        padding: 12px;
    }

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

    .product-price {
        font-size: 16px;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    /* Single column on small screens */
    .product-grid-5col,
    .product-grid-4col,
    .product-grid-3col,
    .product-grid-2col {
        grid-template-columns: 1fr;
    }

    .product-grid-masonry {
        column-count: 1;
    }

    .products-grid {
        gap: 12px;
    }
}

/* =====================================================
   LOADING & EMPTY STATES
   ===================================================== */

.products-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.products-empty {
    text-align: center;
    padding: 60px 20px;
}

.products-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.products-empty-message {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 10px;
}

/* =====================================================
   PRODUCT STOCK STATUS BADGES
   ===================================================== */

.product-stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 5;
}

.product-stock-badge.in-stock {
    background: #d1fae5;
    color: #065f46;
}

.product-stock-badge.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

.product-stock-badge.low-stock {
    background: #fef3c7;
    color: #92400e;
}

/* =====================================================
   PRODUCT RATING DISPLAY
   ===================================================== */

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    font-size: 12px;
}

.product-rating-stars {
    color: #fbbf24;
}

.product-rating-count {
    color: #6b7280;
}

/* =====================================================
   FILTER & SORT POSITIONING - PHASE 3
   ===================================================== */

/* Products Layout Container */
.products-layout {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

/* Filter Position: Left Sidebar (Default) */
.products-layout.filter-position-left {
    grid-template-columns: 280px 1fr;
}

.products-layout.filter-position-left .products-sidebar {
    order: 1;
}

.products-layout.filter-position-left .products-main-content {
    order: 2;
}

/* Filter Position: Right Sidebar */
.products-layout.filter-position-right {
    grid-template-columns: 1fr 280px;
}

.products-layout.filter-position-right .products-sidebar {
    order: 2;
}

.products-layout.filter-position-right .products-main-content {
    order: 1;
}

/* Filter Position: Top Bar */
.products-layout.filter-position-top {
    grid-template-columns: 1fr;
}

.products-layout.filter-position-top .products-sidebar {
    order: 1;
    max-width: 100%;
}

.products-layout.filter-position-top .sidebar-sticky {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    position: static !important;
}

.products-layout.filter-position-top .products-main-content {
    order: 2;
}

/* Filter Position: None (Hidden) */
.products-layout.filter-position-none {
    grid-template-columns: 1fr;
}

.products-layout.filter-position-none .products-sidebar {
    display: none;
}

/* Sort Dropdown Positioning */
.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #f9fafb;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 15px;
}

.products-toolbar.sort-position-top-right .toolbar-right {
    margin-left: auto;
}

.products-toolbar.sort-position-top-left {
    flex-direction: row-reverse;
}

.products-toolbar.sort-position-top-left .toolbar-left {
    margin-left: auto;
}

.products-toolbar.sort-position-top-center {
    flex-direction: column;
    align-items: center;
}

.products-toolbar.sort-position-top-center .toolbar-left,
.products-toolbar.sort-position-top-center .toolbar-right {
    margin: 0;
}

/* Collapsible Filter Cards */
.filter-card.collapsible .filter-title {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    padding: 15px;
    margin: 0;
    background: #f9fafb;
    border-radius: 8px 8px 0 0;
}

.filter-card.collapsible .filter-title:hover {
    background: #f3f4f6;
}

.filter-card.collapsible .filter-title-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-card.collapsible .filter-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.filter-card.collapsible .filter-toggle:hover {
    color: #374151;
}

.filter-card.collapsible.collapsed .filter-toggle .chevron {
    transform: rotate(-90deg);
}

.filter-card.collapsible .filter-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}

.filter-card.collapsible.collapsed .filter-content {
    max-height: 0;
    opacity: 0;
    padding: 0;
}

.filter-card:not(.collapsible) .filter-title {
    padding: 15px 0;
}

/* Responsive Adjustments for Filter Positioning */
@media (max-width: 992px) {
    /* Stack sidebar on tablets */
    .products-layout.filter-position-left,
    .products-layout.filter-position-right {
        grid-template-columns: 1fr;
    }

    .products-layout.filter-position-left .products-sidebar,
    .products-layout.filter-position-right .products-sidebar {
        order: 1;
    }

    .products-layout.filter-position-left .products-main-content,
    .products-layout.filter-position-right .products-main-content {
        order: 2;
    }
}

@media (max-width: 768px) {
    /* Adjust toolbar for mobile */
    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .products-toolbar .toolbar-left,
    .products-toolbar .toolbar-right {
        width: 100%;
        margin: 0 !important;
    }

    .products-toolbar.sort-position-top-left,
    .products-toolbar.sort-position-top-right,
    .products-toolbar.sort-position-top-center {
        flex-direction: column;
    }

    /* Top filters become single column on mobile */
    .products-layout.filter-position-top .sidebar-sticky {
        grid-template-columns: 1fr;
    }
}
