/* ==========================================================================
   ALL PRODUCTS PAGE - STYLES
   ========================================================================== */

/* Breadcrumb Section */
.all-products-breadcrumb {
    background: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.all-products-breadcrumb .breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
}

.all-products-breadcrumb .breadcrumb-item a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.all-products-breadcrumb .breadcrumb-item a:hover {
    color: #b8860b;
}

.all-products-breadcrumb .breadcrumb-item.active {
    color: #333;
    font-weight: 500;
}

.all-products-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #999;
}

/* Main Products Section */
.all-products-section {
    padding: 30px 0 60px;
    background: #fff;
}

.all-products-section .container-fluid {
    padding: 0 40px;
}

/* ==========================================================================
   LEFT SIDEBAR STYLES
   ========================================================================== */
.product-sidebar-wrapper {
    position: sticky;
    top: 100px;
}

.product-sidebar {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}

.mobile-filter-toggle {
    display: none;
    width: 100%;
    padding: 12px 20px;
    background: #b8860b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
    cursor: pointer;
}

.mobile-filter-toggle:hover {
    background: #a07608;
}

/* Filter Widget */
.filter-widget {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.filter-widget:last-of-type {
    border-bottom: none;
    margin-bottom: 15px;
    padding-bottom: 0;
}

.filter-widget h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom scrollbar for filter options */
.filter-options::-webkit-scrollbar {
    width: 5px;
}

.filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.filter-options::-webkit-scrollbar-thumb:hover {
    background: #b8860b;
}

/* Custom Checkbox */
.filter-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    font-size: 14px;
    color: #444;
    transition: color 0.2s;
    user-select: none;
}

.filter-checkbox-label:hover {
    color: #b8860b;
}

/* Highlight only labels that are actively checked (controlled via JS) */
.filter-checkbox-label.is-checked {
    color: #b8860b;
}

.filter-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.filter-checkbox-label .checkmark {
    height: 16px;
    width: 16px;
    min-width: 16px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.filter-checkbox-label:hover .checkmark {
    border-color: #b8860b;
}

.filter-checkbox-label input[type="checkbox"]:checked ~ .checkmark {
    background-color: #b8860b;
    border-color: #b8860b;
}

.filter-checkbox-label input[type="checkbox"]:checked ~ .checkmark::after {
    content: "";
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* Clear Filters Button */
.clear-filters-btn {
    width: 100%;
    padding: 10px 15px;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clear-filters-btn:hover {
    background: #f8f9fa;
    border-color: #b8860b;
    color: #b8860b;
}

/* ==========================================================================
   PRODUCTS CONTENT AREA
   ========================================================================== */
.products-content-area {
    padding-left: 20px;
}

/* Top Bar */
.products-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.results-count {
    font-size: 14px;
    color: #666;
}

.results-count span {
    font-weight: 600;
    color: #333;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-wrapper label {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.sort-select {
    padding: 8px 35px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    color: #333;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center;
    background-size: 18px;
    appearance: none;
    cursor: pointer;
    min-width: 150px;
}

.sort-select:focus {
    outline: none;
    border-color: #b8860b;
}

/* ==========================================================================
   PRODUCTS GRID
   ========================================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 260px; /* ensure consistent height across cards */
}

.product-card:hover {
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

/* New Badge */
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #4CAF50;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}

/* Product Image */
.product-image {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 15px;
    flex-shrink: 0; /* keep image area fixed */
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Compact cart controls on product card */
.product-card-controls {
    position: relative;
    display: flex;
    justify-content: center; /* center the Add button */
    align-items: center;
    padding: 10px 15px 16px;
    gap: 8px;
}

.card-cart-add {
    background: transparent; /* outline-only */
    color: #b8860b; /* gold accent */
    border: 1.5px solid #b8860b; /* thin outline */
    padding: 6px 18px; /* pill/button padding */
    border-radius: 999px; /* pill style */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 180ms ease, transform 120ms ease, color 180ms ease;
    font-size: 13px;
    min-height: 34px;
}

.card-cart-add:hover {
    background-color: rgba(184,134,11,0.06); /* subtle hover tint */
    transform: translateY(-1px);
}

.card-qty {
    display: none; /* shown after adding */
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 6px 8px;
    border-radius: 999px;
    border: 1px solid #eee;
}

.card-qty button {
    background: transparent;
    border: none;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
}

.card-qty .qty-value {
    min-width: 20px;
    text-align: center;
    font-size: 13px;
    color: #333;
}

/* Ensure the additional controls do not change card layout */
.product-card { position: relative; }

/* Product placeholder icon */
.product-placeholder {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-placeholder i {
    font-size: 30px;
    color: #bbb;
}

/* Product Info */
.product-info {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin: 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em; /* reserve space for two lines */
}

.product-brand {
    font-size: 12px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: #b8860b;
    color: #b8860b;
}

.page-btn.active {
    background: #b8860b;
    border-color: #b8860b;
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #999;
    font-size: 14px;
}

/* ==========================================================================
   NO PRODUCTS FOUND
   ========================================================================== */
.no-products-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.no-products-found i {
    font-size: 60px;
    color: #ddd;
    margin-bottom: 20px;
}

.no-products-found h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.no-products-found p {
    color: #666;
    font-size: 14px;
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

/* Large Desktop */
@media (max-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Desktop */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .all-products-section .container-fluid {
        padding: 0 30px;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .products-content-area {
        padding-left: 15px;
    }
    
    .product-sidebar-wrapper {
        position: static;
    }
}

/* Small Tablet */
@media (max-width: 768px) {
    .all-products-section .container-fluid {
        padding: 0 15px;
    }
    
    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .product-sidebar {
        display: none;
        margin-bottom: 20px;
    }
    
    .product-sidebar.active {
        display: block;
    }

    /* Mobile filter modal styles */
    .product-sidebar.mobile-active {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) scale(0.98);
        width: 92%;
        max-width: 520px;
        max-height: 80vh;
        overflow: auto;
        z-index: 1100;
        border-radius: 10px;
        box-shadow: 0 12px 40px rgba(0,0,0,0.25);
        background: #fff;
        display: block;
        padding: 12px;
        opacity: 0;
        transition: transform 200ms ease, opacity 160ms ease;
    }

    .product-sidebar.mobile-active.mobile-show {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .mobile-filter-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1050;
        opacity: 1;
    }

    .mobile-filter-actions {
        padding: 12px;
        display: flex;
        justify-content: center;
        gap: 8px;
        box-shadow: 0 -6px 16px rgba(0,0,0,0.06);
    }

    .mobile-apply-btn {
        background: #b8860b;
        color: #fff;
        border: none;
        padding: 10px 18px;
        border-radius: 8px;
        font-size: 15px;
        font-weight: 600;
        width: 100%;
        max-width: 420px;
        cursor: pointer;
    }
    
    .products-content-area {
        padding-left: 0;
        margin-top: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .products-top-bar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-title {
        font-size: 11px;
        height: 30px;
    }

    .product-card { min-height: 220px; }
}

/* Mobile */
@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-info {
        padding: 10px 12px;
    }
    
    .product-image {
        height: 100px;
        padding: 10px;
    }
    
    .product-badge {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .product-title {
        font-size: 11px;
        height: 30px;
        -webkit-line-clamp: 2;
    }

    .product-card { min-height: 200px; }
    
    .product-brand {
        font-size: 10px;
    }
    
    .page-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* Extra Small Mobile */
@media (max-width: 400px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-image {
        height: 90px;
    }
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */
.loading-spinner {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-spinner::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #b8860b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   ACTIVE FILTERS DISPLAY
   ========================================================================== */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 12px;
    color: #333;
}

.active-filter-tag button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #999;
    font-size: 14px;
    line-height: 1;
}

.active-filter-tag button:hover {
    color: #b8860b;
}
/* ==========================================================================
   SUB-PRODUCTS EXPANDABLE STRUCTURE
   ========================================================================== */

/* Expand indicator for products with sub-products */
.product-card.has-sub-products {
    position: relative;
    cursor: pointer;
}

.expand-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.expand-indicator:hover {
    background: #b8860b;
    transform: scale(1.1);
}

.expand-indicator i {
    color: #fff;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.product-card.expanded .expand-indicator {
    background: #b8860b;
}

.product-card.expanded .expand-indicator i {
    transform: rotate(180deg);
}

/* Sub-products container */
.sub-products-container {
    width: 100%;
    background: #f8f9fa;
    border-top: 2px solid #e0e0e0;
    padding: 15px;
    margin-top: 10px;
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
}

/* Individual sub-product item */
.sub-product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.sub-product-item:last-child {
    margin-bottom: 0;
}

.sub-product-item:hover {
    border-color: #b8860b;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.1);
    transform: translateX(5px);
}

.sub-product-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.sub-product-actions {
    display: flex;
    gap: 8px;
}

.sub-add-cart {
    padding: 6px 16px;
    background: #000;
    color: #b8860b;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sub-add-cart:hover {
    background: #b8860b;
    color: #fff;
    transform: scale(1.05);
}

.sub-add-cart:active {
    transform: scale(0.98);
}

/* Smooth expand/collapse animation */
.product-card.has-sub-products {
    transition: all 0.3s ease;
}

.product-card.expanded {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments for sub-products */
@media (max-width: 768px) {
    .sub-products-container {
        padding: 10px;
        max-height: 300px;
    }
    
    .sub-product-item {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .sub-product-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .expand-indicator {
        width: 26px;
        height: 26px;
    }
    
    .expand-indicator i {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .sub-products-container {
        padding: 8px;
        max-height: 250px;
    }
    
    .sub-product-item {
        padding: 8px 10px;
    }
    
    .sub-product-name {
        font-size: 13px;
    }
    
    .sub-add-cart {
        padding: 5px 12px;
        font-size: 12px;
    }
}

/* ==========================================================================
   ACCESSORY CATEGORY CARDS - Category Grid Style
   ========================================================================== */
/* Wider grid for category cards - 4 columns instead of 6 */
.products-grid:has(.accessory-category-card) {
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.accessory-category-card {
    display: block;
    text-align: center;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.accessory-category-card:hover {
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: #b8860b;
}

/* Image Box - Similar to shop-cat-card */
.accessory-cat-img {
    width: 100%;
    height: 180px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: all 0.3s ease;
}

.accessory-cat-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.accessory-category-card:hover .accessory-cat-img img {
    transform: scale(1.05);
}

/* Category Name - Below the image */
.accessory-cat-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 14px 12px 18px;
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.accessory-category-card:hover .accessory-cat-name {
    color: #b8860b;
}

/* Back button shown inside accessory subcategory products */
.accessory-back-wrap {
    grid-column: 1 / -1;
    margin-bottom: 6px;
}

.accessory-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #333;
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.accessory-back-btn:hover {
    border-color: #b8860b;
    color: #b8860b;
    background: #fffdf7;
}

/* Responsive - Tablet */
@media (max-width: 991px) {
    .products-grid:has(.accessory-category-card) {
        grid-template-columns: repeat(3, 1fr);
    }

    .accessory-cat-img {
        height: 150px;
    }

    .accessory-cat-name {
        font-size: 13px;
        padding: 12px 10px 16px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .products-grid:has(.accessory-category-card) {
        grid-template-columns: repeat(2, 1fr);
    }

    .accessory-cat-img {
        height: 140px;
        padding: 15px;
    }

    .accessory-cat-name {
        font-size: 12px;
        padding: 10px 8px 14px;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .accessory-cat-img {
        height: 110px;
        padding: 10px;
    }

    .accessory-cat-name {
        font-size: 10px;
        padding: 6px 4px 10px;
    }
}