/* 
 * Combined CSS for Search, Filter, and Sort functionality
 * - All elements in a single row
 * - Search bar maintains original styling
 */

/* ==========================================
   SCROLLING FIX - Minimal change
   ========================================== */
body {
    overflow-y: auto !important;
}

header {
    margin-top: 70px; /* Give more space to the header to be visible */
    margin-bottom: 30px;
}

/* ==========================================
   UNIFIED CONTAINER LAYOUT - ALL IN ONE ROW
   ========================================== */
.search-filter-sort-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: nowrap; /* Prevent wrapping to ensure single row */
    gap: 15px;
}

/* Search section takes more space but preserves original style */
.search-section {
    flex: 1;
    min-width: 250px;
}

/* Group filter and sort together */
.filter-sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap; /* Prevent wrapping of text */
}

/* Filter and sort buttons should be fixed width */
.filter-container,
.sort-container {
    width: auto;
    position: relative;
    flex-shrink: 0; /* Prevent shrinking */
}

/* ==========================================
   SEARCH BAR STYLING (kept from original)
   ========================================== */
.search-form {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.search {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 45px;
    padding: 0 20px;
    padding-right: 50px;
    border-radius: 50px;
    border: 2px solid transparent;
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: var(--dark, #232342);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.search-input::placeholder {
    color: var(--gray, #64748b);
    opacity: 0.7;
}

.search-input:focus {
    outline: none;
    border-color: #7928ca;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(121, 40, 202, 0.15);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(120deg, #7928ca, #ff0080);
    background-size: 200% 100%;
    animation: gradientShift 5s ease infinite;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.search-btn i {
    font-size: 14px;
    color: white;
    -webkit-text-fill-color: white;
}

/* Dark mode search bar styles */
body.dark .search-input {
    background-color: rgba(35, 35, 66, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--light-text, #e0e0e0);
}

body.dark .search-input:focus {
    border-color: var(--primary-light, #4ecdc4);
    background-color: rgba(35, 35, 66, 1);
    box-shadow: 0 0 0 3px rgba(53, 167, 156, 0.25);
}

body.dark .search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

body.dark .search-btn {
    background: linear-gradient(120deg, #35a79c, #209cb3, #1e4a69);
    background-size: 200% 100%;
    animation: gradientShift 5s ease infinite;
}

body.dark .search-btn:hover {
    background: linear-gradient(120deg, #35a79c, #209cb3, #1e4a69);
    background-size: 200% 100%;
}

body.dark .search-btn i {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    background: none;
    animation: none;
}

/* Animation for gradient shift */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================
   FILTER BUTTON STYLING
   ========================================== */
.filter-container {
    min-width: 120px;
}

.filter-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 18px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #36d1dc, #5b86e5);
    color: white;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(91, 134, 229, 0.2);
    height: 45px;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(91, 134, 229, 0.3);
}

.filter-btn i {
    margin-left: 8px;
    font-size: 12px;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-options {
    padding: 15px;
    max-height: 450px;
    overflow-y: auto;
}

.filter-group {
    margin-bottom: 20px;
}

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

.filter-group h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #333;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-category-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-category-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-category-checkbox input {
    accent-color: #5b86e5;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-category-checkbox label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
}



.price-range-control {
    padding: 10px 0;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-inputs input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #555;
    transition: border-color 0.2s;
    width: 80px;
}

.price-inputs input:focus {
    outline: none;
    border-color: #5b86e5;
    box-shadow: 0 0 0 2px rgba(91, 134, 229, 0.1);
}

.price-range-separator {
    color: #888;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.apply-filter-btn {
    flex: 2;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #36d1dc, #5b86e5);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.apply-filter-btn:hover {
    background: linear-gradient(135deg, #32c0ca, #4a75d4);
    transform: translateY(-2px);
}

.reset-filter-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-filter-btn:hover {
    background-color: #f8f8f8;
    color: #333;
}

/* ==========================================
   SORT BUTTON STYLING
   ========================================== */
.sort-container {
    min-width: 120px;
}

.sort-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 18px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #ff9966, #ff5e62);
    color: white;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(255, 94, 98, 0.2);
    height: 45px;
}

.sort-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 94, 98, 0.3);
}

.sort-btn i {
    margin-left: 8px;
    font-size: 12px;
}

.sort-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sort-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-options {
    padding: 10px 0;
}

.sort-option {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #555;
}

.sort-option:hover {
    background-color: #f9f9f9;
    color: #ff5e62;
}

.sort-option.active {
    background-color: rgba(255, 94, 98, 0.08);
    color: #ff5e62;
    font-weight: 500;
}

.sort-option i {
    font-size: 14px;
    color: #888;
    width: 16px;
    text-align: center;
}

.sort-option.active i {
    color: #ff5e62;
}

/* Price range header styling */
.price-range-header {
    margin-left: 2px;
    padding-top: 10px;
    font-weight: 500;
}

/* ==========================================
   PRICE RANGE COMPACT STYLING
   ========================================== */
.price-range-compact {
    padding: 12px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    width: 100%;
}

.price-range-compact label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--dark, #232342);
}

.price-inputs-compact {
    display: flex;
    align-items: center;
    gap: 5px;
}

.price-inputs-compact input {
    width: 70px;
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid var(--light-gray, #e1e5e9);
    font-size: 13px;
    color: var(--dark, #232342);
    background-color: white;
    transition: border-color 0.2s ease;
}

.price-inputs-compact input:focus {
    outline: none;
    border-color: var(--primary, #35a79c);
}

.price-inputs-compact span {
    font-size: 14px;
    color: var(--gray, #64748b);
}

/* Dark mode styles */
body.dark .price-range-compact {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark .price-range-compact label {
    color: var(--light-text, #e0e0e0);
}

body.dark .price-inputs-compact input {
    background-color: rgba(35, 35, 66, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--light-text, #e0e0e0);
}

body.dark .price-inputs-compact input:focus {
    border-color: var(--primary-light, #4ecdc4);
}

body.dark .price-inputs-compact span {
    color: rgba(255, 255, 255, 0.5);
}

/* Dark mode styles for filter and sort */
body.dark .filter-btn {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

body.dark .sort-btn {
    background: linear-gradient(135deg, #5f2c82, #49a09d);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

body.dark .filter-dropdown,
body.dark .sort-dropdown {
    background: #1a1a2e;
    border-color: #2d2d44;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark .filter-group h4 {
    color: #e0e0e0;
    border-bottom-color: #2d2d44;
}

body.dark .filter-category-checkbox label {
    color: #c0c0c0;
}

body.dark .price-inputs input {
    background-color: #2d2d44;
    border-color: #3c3c56;
    color: #e0e0e0;
}

body.dark .price-range-separator {
    color: #c0c0c0;
}

body.dark .sort-option {
    color: #c0c0c0;
}

body.dark .sort-option:hover {
    background-color: #2d2d44;
    color: #49a09d;
}

body.dark .sort-option.active {
    background-color: rgba(73, 160, 157, 0.15);
    color: #49a09d;
}

body.dark .sort-option i {
    color: #888;
}

body.dark .sort-option.active i {
    color: #49a09d;
}

body.dark .reset-filter-btn {
    border-color: #3c3c56;
    color: #a0a0a0;
}

body.dark .reset-filter-btn:hover {
    background-color: #2d2d44;
    color: #e0e0e0;
}

body.dark .apply-filter-btn {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

body.dark .apply-filter-btn:hover {
    background: linear-gradient(135deg, #152f38, #264a54, #356373);
}

/* Make filter and sort icons white in dark mode for better visibility */
body.dark .filter-btn i.fas.fa-sliders-h,
body.dark .sort-btn i.fas.fa-sort-amount-down-alt,
body.dark .sort-btn i.fas.fa-sort-amount-up-alt,
body.dark .sort-btn i.fas.fa-arrow-up-short-wide,
body.dark .sort-btn i.fas.fa-arrow-down-short-wide,
body.dark .sort-btn i {
  background: none;
  -webkit-text-fill-color: white;
  color: white;
  animation: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Override any gradient animation for these specific icons */
body.dark .filter-btn i.fas.fa-sliders-h::before,
body.dark .sort-btn i.fas.fa-sort-amount-down-alt::before,
body.dark .sort-btn i.fas.fa-sort-amount-up-alt::before,
body.dark .sort-btn i.fas.fa-arrow-up-short-wide::before,
body.dark .sort-btn i.fas.fa-arrow-down-short-wide::before,
body.dark .sort-btn i::before {
  background: none;
  -webkit-text-fill-color: white;
  color: white;
  animation: none;
}

/* Price Range Section Styling */
.price-range-section {
    margin: 10px 0;
    padding: 5px 0;
    margin-left: 4px;
}

.price-range-header {
    font-weight: 600;
    margin-bottom: 8px;
    margin-left: 4px !important;
}

.price-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-input {
    width: 60px;
    padding: 4px;
    border: 1px solid #ddd;
    text-align: center;
}

body.dark .price-input {
    background-color: #2d2d44;
    border-color: #3c3c56;
    color: #e0e0e0;
}

/* Make placeholder text white in dark mode */
body.dark .price-input::placeholder {
    color: #e0e0e0;
    opacity: 0.7;
}

/* Filter Category Styling */
.filter-category {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 50%;
    box-sizing: border-box;
}

/* Make filter categories one per row on laptop and accessories pages */
.laptops-page .filter-category,
.accessories-page .filter-category,
.phones-page .filter-category {
    width: 100%;
}

.filter-category:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.filter-category input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    position: relative;
    width: 16px;
    height: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    outline: none;
    transition: all 0.2s ease;
    vertical-align: middle;
    box-sizing: border-box;
    flex-shrink: 0;
}

.filter-category input[type="checkbox"]:checked {
    background-color: #5b86e5;
    border-color: #5b86e5;
}

.filter-category input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-category input[type="checkbox"]:hover {
    border-color: #5b86e5;
}

.filter-category label {
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: color 0.2s ease;
}

.filter-category:hover label {
    color: #333;
}

/* Dark mode styles for filter categories */
body.dark .filter-category {
    transition: background-color 0.2s ease;
}

body.dark .filter-category:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark .filter-category label {
    color: #c0c0c0;
    transition: color 0.2s ease;
}

body.dark .filter-category:hover label {
    color: #e0e0e0;
}

body.dark .filter-category input[type="checkbox"] {
    border-color: #555;
    background-color: #2d2d44;
}

body.dark .filter-category input[type="checkbox"]:checked {
    background-color: #49a09d;
    border-color: #49a09d;
}

body.dark .filter-category input[type="checkbox"]:hover {
    border-color: #49a09d;
}

/* Responsive adjustments for filter categories */
@media (max-width: 480px) {
    .filter-category {
        width: 100%; /* Full width on very small screens */
    }
}

/* Responsive adjustments - Only apply these on very small screens */
@media (max-width: 768px) {
    /* Clothing page only: search on row 1 full width; row 2 has Filter (left) + Sort (next) */
    body.clothing-page .search-filter-sort-container {
        display: grid;
        grid-template-columns: auto 1fr auto; /* Filter | spacer | Sort (right) */
        grid-auto-rows: auto;
        grid-auto-flow: row dense;
        gap: 12px;
        align-items: start;
    }

    body.clothing-page .search-section {
        grid-column: 1 / -1; /* full width */
        width: 100%;
        max-width: 100%;
    }

    /* If a wrapper exists, keep buttons side-by-side, left-aligned */
    body.clothing-page .filter-sort-container {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: auto 1fr auto; /* Filter | spacer | Sort */
        gap: 12px;
        width: 100%;
        margin-top: 0;
        justify-items: stretch;
    }

    /* When no wrapper: place siblings on the same row (row 2) */
    body.clothing-page .search-filter-sort-container > .filter-container { 
        grid-column: 1; 
        justify-self: start;
        margin-top: 0;
    }
    body.clothing-page .search-filter-sort-container > .sort-container { 
        grid-column: 3; 
        justify-self: end;
        margin-top: 0;
    }

    /* Keep buttons natural width so they sit nicely side-by-side */
    body.clothing-page .filter-container,
    body.clothing-page .sort-container {
        width: auto;
    }

    /* Clothing page mobile: ensure Sort dropdown stays onscreen and above content */
    body.clothing-page .sort-container .sort-dropdown {
        right: 0;
        left: auto;
        max-width: calc(100vw - 24px);
        z-index: 1000; /* ensure visibility over cards */
    }
}

/* Laptops page: place Build Your PC button on its own row when using grid */
@media (max-width: 768px) {
    body.laptops-page .filter-sort-container .build-pc-btn {
        grid-column: 1 / -1;
        width: 100%;
        text-align: center;
    }
}

/* ==========================================
   CATEGORY ACCORDION STYLING
   ========================================== */
.category-header {
    background: transparent;
    padding: 12px 5px;
    cursor: pointer; /* Changed back to pointer for better UX */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.category-icon-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    display: flex;
    flex-wrap: wrap;
    padding: 0 5px;
}

.category-header.active + .category-content {
    max-height: 1000px; /* A large value to accommodate all content */
}

.category-header i {
    color: #888;
    font-size: 16px;
}

/* Device icons styling */
.category-header .category-icon-group i {
    color: #5b86e5;
    font-size: 16px;
}

/* Dropdown icon styling */
.category-header .dropdown-icon {
    color: #888;
    font-size: 18px;
    transition: transform 0.3s ease;
}

/* Force consistent size for image-based dropdown icons */
.category-header img.dropdown-icon,
.category-header .dropdown-icon {
    width: 16px;
    height: 16px;
}

/* Custom icon colors */
.category-header .fa-tag {
    color: #5b86e5;
}

.category-header .fa-mobile-alt {
    color: #36d1dc;
}

.category-header .fa-tablet-alt {
    color: #7928ca;
}

.category-header .fa-headphones {
    color: #ff0080;
}

/* Special styling for dropdown icon */
body.dark .category-header .dropdown-icon {
    color: #aaa;
}

body.dark .category-header {
    border-bottom-color: #444;
}

body.dark .category-header h3 {
    color: #e0e0e0;
}

/* ==========================================
   SPECIAL PRICE FILTER STYLING FROM CLOTHING CSS
   ========================================== */

/* Custom styling for number input spinners */
.price-filter-item input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield; /* Standard */
}

/* Chrome, Safari, Edge, Opera */
.price-filter-item input[type="number"]::-webkit-outer-spin-button,
.price-filter-item input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
    display: none;
}

/* Custom increment/decrement buttons */
.price-filter-item .number-controls {
    position: absolute;
    right: 20px; /* 2px more to the left from 18px */
    top: 50%;
    transform: translateY(-23%) !important; /* 2px more up from -21% */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.price-filter-item .number-control-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.price-filter-item .number-control-btn:hover {
    color: #3f51b5;
}

body.dark .price-filter-item .number-control-btn {
    color: #777;
}

body.dark .price-filter-item .number-control-btn:hover {
    color: #7986cb;
}

/* Dark mode styles for filters and sort */
body.dark .filter-dropdown, body.dark .sort-dropdown {
    background-color: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}



body.dark .filter-group h4 {
    color: #e0e0e0;
    border-bottom: 1px solid #333;
}

body.dark .filter-category-checkbox label {
    color: #ccc;
}

body.dark .price-range-separator {
    color: #ccc;
}

body.dark .reset-filter-btn {
    color: #ddd;
    border-color: #555;
}

body.dark .reset-filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #777;
    color: #fff;
}

/* ==========================================
   SIZE FILTER SECTION STYLES
   ========================================== */

.size-filter-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

body.dark .size-filter-section {
    border-top-color: #374151;
}

.size-filter-header {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.size-filter-header::before {
    content: '📏';
    font-size: 14px;
}

body.dark .size-filter-header {
    color: #d1d5db;
}

.size-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.size-filter-options::-webkit-scrollbar {
    width: 4px;
}

.size-filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.size-filter-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

body.dark .size-filter-options::-webkit-scrollbar-track {
    background: #2a2a2a;
}

body.dark .size-filter-options::-webkit-scrollbar-thumb {
    background: #555;
}

.size-filter-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.size-filter-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #504099;
}

.size-filter-item label {
    font-size: 12px;
    color: #4b5563;
    cursor: pointer;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.size-filter-item label:hover {
    background: #f3f4f6;
}

body.dark .size-filter-item label {
    color: #d1d5db;
}

body.dark .size-filter-item label:hover {
    background: #374151;
}

.size-filter-item input[type="checkbox"]:checked + label {
    background: #504099;
    color: white;
}

/* Tooltip for size filter items */
.size-filter-item label[title] {
    position: relative;
}

.size-filter-item label[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ============================================================================
   PAGINATION STYLES
   ============================================================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px 0;
    flex-wrap: wrap;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color, #374151);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-item:hover:not(.active):not(.disabled):not(.dots) {
    background: #f3f4f6;
    border-color: #504099;
    color: #504099;
}

.pagination-item.active {
    background: linear-gradient(135deg, #504099 0%, #7c3aed 100%);
    border-color: #504099;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(80, 64, 153, 0.3);
}

.pagination-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-item.dots {
    background: transparent;
    border: none;
    cursor: default;
    min-width: auto;
    padding: 0 4px;
}

.pagination-info {
    text-align: center;
    padding: 8px 16px;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
    margin-bottom: 8px;
}

/* Dark mode pagination */
body.dark .pagination-item {
    background: var(--card-bg-dark, #1f2937);
    border-color: var(--border-color-dark, #374151);
    color: var(--text-color-dark, #d1d5db);
}

body.dark .pagination-item:hover:not(.active):not(.disabled):not(.dots) {
    background: #374151;
    border-color: #7c3aed;
    color: #a78bfa;
}

body.dark .pagination-item.active {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
}

body.dark .pagination-info {
    color: var(--text-muted-dark, #9ca3af);
}

/* ============================================================================
   "YOU MAY ALSO LIKE" SECTION STYLES
   ============================================================================ */

.you-may-like-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 20px 0;
}

.you-may-like-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.you-may-like-item i {
    font-size: 28px;
    color: #504099;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.you-may-like-item span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color, #374151);
}

.you-may-like-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(80, 64, 153, 0.15);
    border-color: #504099;
}

.you-may-like-item:hover i {
    transform: scale(1.1);
}

/* Dark mode "You May Also Like" */
body.dark .you-may-like-item {
    background: var(--card-bg-dark, #1f2937);
    border-color: var(--border-color-dark, #374151);
}

body.dark .you-may-like-item span {
    color: var(--text-color-dark, #d1d5db);
}

body.dark .you-may-like-item i {
    color: #a78bfa;
}

body.dark .you-may-like-item:hover {
    border-color: #7c3aed;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
}

/* Responsive "You May Also Like" */
@media (max-width: 1024px) {
    .you-may-like-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .you-may-like-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .you-may-like-item {
        padding: 16px 10px;
    }
    
    .you-may-like-item i {
        font-size: 24px;
    }
    
    .you-may-like-item span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .you-may-like-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pagination {
        gap: 6px;
    }
    
    .pagination-item {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* ============================================================================
   SEARCH RESULTS COUNT
   ============================================================================ */

.search-results-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #504099 0%, #7c3aed 100%);
    color: white;
    border-radius: 8px;
    margin: 16px 0;
}

.search-results-count button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.search-results-count button:hover {
    background: rgba(255,255,255,0.3);
}

/* Search suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

body.dark .search-suggestions {
    background: var(--card-bg-dark, #1f2937);
    border-color: var(--border-color-dark, #374151);
}

/* ==========================================
   CATEGORY ACCORDION STYLING
   ========================================== */
.category-accordion {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-accordion-item {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
}

.category-accordion-item:last-child {
    border-bottom: none;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 6px;
}

.category-header:hover {
    background-color: rgba(91, 134, 229, 0.1);
}

.category-header span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.category-header .dropdown-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.category-header.active .dropdown-icon {
    transform: rotate(180deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 15px;
}

.filter-category {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
}

.filter-category:hover {
    background-color: rgba(91, 134, 229, 0.05);
    border-radius: 4px;
}

.filter-category input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #5b86e5;
    cursor: pointer;
}

.filter-category label {
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

/* Dark mode category accordion */
body.dark .category-header span {
    color: #e0e0e0;
}

body.dark .category-header:hover {
    background-color: rgba(78, 205, 196, 0.1);
}

body.dark .category-accordion-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark .filter-category label {
    color: #bbb;
}

body.dark .filter-category:hover {
    background-color: rgba(78, 205, 196, 0.05);
}
