/* ===== Page Header ===== */
.page-header {
    margin: 30px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-weight: 600;
    font-size: 28px;
    margin-bottom: 8px;
}

.breadcrumb {
    color: var(--text-light);
    font-size: 14px;
}

.breadcrumb span {
    color: var(--primary);
    font-weight: 500;
}

/* ===== Main Layout ===== */
.main-product-page {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* ===== Filter Panel ===== */
.filter-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
    z-index: 9;
}

.filter-group {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-title i {
    margin-right: 8px;
    color: var(--primary);
}

.clear-all {
    font-size: 13px;
    font-weight: normal;
    color: var(--primary);
    cursor: pointer;
}
.category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-tree li {
    margin: 5px 0;
    cursor: pointer;
}

.category-label,
.sub-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
}

.toggle-icon {
    margin-right: 8px;
    transition: transform 0.3s;
}

.sub-category,
.sub-label + ul {
    display: none;
    padding-left: 20px;
}

li.open > .sub-category,
li.open > .sub-label + ul {
    display: block;
}

li.open > label > .toggle-icon i {
    transform: rotate(90deg);
}

/* Price Slider */
.price-slider {
    padding: 0 10px;
}

.price-slider input[type="range"] {
    width: 100%;
    margin: 15px 0;
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-light);
}

/* Filter Options */
.filter-options {
    list-style: none;
    padding-left: 0;
}

.filter-options li {
    margin-bottom: 8px;
}

.filter-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.filter-options input[type="checkbox"] {
    margin-right: 10px;
    accent-color: var(--primary);
}

/* ===== Product Grid ===== */
.product-grid {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 25px;
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.results-count {
    font-size: 14px;
    color: var(--text-light);
}

.sort-by {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-by label {
    font-size: 14px;
}

.sort-by select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}

.product-card::before {
    z-index: 0;
}

.product-page .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-gap: 10px;
    margin: 40px 0px;
    justify-content: start;
    align-items: start;
}



.multi-dropdown{
    display: flex;
    flex-direction: column;
    gap: 5px;

}
.multi-dropdown li {
  position: relative;
}

.multi-dropdown  li {
    border-bottom: 1px solid #e5e5e5;
    margin-right: 1px;
    padding: 5px 10px;
        font-size: 14px;
    cursor: pointer;
}

.multi-dropdown a {
  display: block;
  /*padding: 10px 15px;*/
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.multi-dropdown li:hover > a {
  background: #007BFF;
  color: #fff;
}

.multi-dropdown li:hover > ul {
  display: block;
}

.multi-dropdown ul ul {
  top: 0;
  left: 100%;
}


.multi-dropdown {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 250px;
    /* background: #f8f8f8; */
    font-family: Arial, sans-serif;
  }
  
  .multi-dropdown > li {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    position: relative;
    cursor: pointer;
  }
  
  .multi-dropdown > li:hover {
    background-color: #eaeaea;
  }
  
  .dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }
  
  .sub-dropdown {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: #fff;
    border: 1px solid #e5e5e5;
    width: max-content; 
    z-index: 1000;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  }
  
  .dropdown-item:hover > .sub-dropdown,
  .sub-label:hover > .sub-dropdown {
    display: block;
  }
  
  .sub-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 14px;
    color: #333;
    /* white-space: nowrap; */
    cursor: pointer;
  }
  
  .sub-label:hover {
    background: var(--primary);
    color: #fff;
  }
  
  .sub-dropdown li {
    position: relative;
    color: black;
  }

    .sub-dropdown > li:hover{
        background-color: #ddecff;
    }
  
  .fas.fa-chevron-right {
    font-size: 12px;
    margin-left: 10px;
  }
  

  .product-card .product-content {
    margin-top: 20px;
    position: relative;
    z-index: 1;
    height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card .product-action-wrap .product-action button {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    background: #134464;
    color: #fff;
    text-align: center;
    border-radius: 50%;
    margin: 0 3px;
    cursor: pointer;
}

/* ===== RESPONSIVE STYLES ===== */

/* Filter Toggle Button for Mobile */
.filter-toggle {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 20px;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.filter-toggle:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.filter-toggle i {
    font-size: 16px;
}

/* Mobile Filter Panel Animation */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) {
    .main-product-page {
        grid-template-columns: 250px 1fr;
        gap: 20px;
    }
    
    .filter-panel {
        padding: 15px;
    }
    
    .product-page .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-gap: 15px;
        padding: 0px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .grid-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .sort-by {
        width: 100%;
    }
    
    .sort-by select {
        flex: 1;
    }
}

/* Mobile Styles (up to 767px) */
@media (max-width: 767px) {
    .main-product-page {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-toggle {
        display: flex;
    }
    
    .filter-panel {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 99999;
        border-radius: 0;
        overflow-y: auto;
        padding: 20px;
        background: white;
        box-shadow: none;
        margin: 0;
        animation: slideInFromLeft 0.3s ease-out;
    }
    
    .filter-panel.active {
        display: block;
    }
    
    .filter-panel.closing {
        animation: slideOutToLeft 0.3s ease-in;
    }
    
    .filter-panel .close-filter {
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 24px;
        color: #666;
        cursor: pointer;
        z-index: 10;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background-color 0.3s;
    }
    
    .filter-panel .close-filter:hover {
        background-color: #f5f5f5;
    }
    
    .page-header {
        margin: 20px 0;
    }
    
    .page-header h1 {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .breadcrumb {
        font-size: 12px;
    }
    
    .product-grid {
        padding: 15px;
        margin: 20px 0;
    }
    
    .product-page .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        grid-gap: 12px;
        margin: 20px 0;
    }
    
    .grid-header {
        margin-bottom: 20px;
    }
    
    .results-count {
        font-size: 13px;
    }
    
    .sort-by {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .sort-by label {
        font-size: 13px;
    }
    
    .sort-by select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Mobile Product Card Adjustments */
    .product-card {
        padding: 10px;
    }
    
    .product-card .product-content {
        margin-top: 15px;
        height: auto;
    }
    
    .product-card .product-title {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .product-card .product-price {
        font-size: 13px;
    }
    
    .product-card .product-rate {
        font-size: 12px;
    }
    
    /* Mobile Multi-dropdown Adjustments */
    .multi-dropdown {
        width: 100% !important;
        max-width: none !important;
        display: flex !important;
        flex-direction: column !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .multi-dropdown > li {
        border-bottom: 1px solid #e5e5e5 !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        position: relative !important;
        flex-direction: column;
    }
    
    .multi-dropdown > li:last-child {
        border-bottom: none !important;
    }
    
    .sub-dropdown {
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        border-left: 2px solid var(--primary) !important;
        margin-left: 15px !important;
        margin-top: 5px !important;
        left: auto !important;
        top: auto !important;
        display: none !important;
        padding-left: 10px !important;
        flex-direction: column !important;
        list-style: none !important;
        padding: 0 !important;
    }
    
    /* Nested dropdown levels for mobile */
    .sub-dropdown .sub-dropdown {
        margin-left: 20px !important;
        border-left: 2px solid #ff6b6b !important;
        margin-top: 3px !important;
        flex-direction: column !important;
    }
    
    .sub-dropdown .sub-dropdown .sub-dropdown {
        margin-left: 25px !important;
        border-left: 2px solid #4ecdc4 !important;
        margin-top: 3px !important;
        flex-direction: column !important;
    }
    
    /* Override all hover effects on mobile */
    .dropdown-item:hover > .sub-dropdown,
    .sub-label:hover > .sub-dropdown,
    .multi-dropdown li:hover > ul {
        display: none !important;
    }
    
    /* Show dropdowns only when open class is present */
    .dropdown-item.open > .sub-dropdown,
    .sub-label.open > .sub-dropdown {
        display: flex !important;
    }
    
    /* Ensure all nested levels show when parent is open */
    .dropdown-item.open .sub-dropdown.open,
    .sub-label.open .sub-dropdown.open {
        display: flex !important;
    }
    
    .sub-label {
        padding: 8px 10px !important;
        font-size: 13px !important;
        white-space: normal !important;
        cursor: pointer !important;
        transition: background-color 0.2s ease !important;
        border-bottom: 1px solid #f0f0f0 !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-decoration: none !important;
        color: #333 !important;
    }
    
    .sub-label:last-child {
        border-bottom: none !important;
    }
    
    .sub-label:hover {
        background-color: #f8f9fa !important;
    }
    
    .sub-label.open {
        background-color: #e3f2fd !important;
        color: var(--primary) !important;
        font-weight: 500 !important;
    }
    
    /* Chevron rotation for open items */
    .sub-label.open i.fas.fa-chevron-right,
    .dropdown-item.open i.fas.fa-chevron-right {
        transform: rotate(90deg) !important;
        transition: transform 0.3s ease !important;
    }
    
    /* Better spacing for nested items */
    .sub-dropdown li {
        margin-bottom: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        position: relative !important;
    }
    
    .sub-dropdown .sub-label {
        padding: 6px 8px !important;
        font-size: 12px !important;
        width: 100% !important;
        flex-direction: column;
    }
    
    .sub-dropdown .sub-dropdown .sub-label {
        padding: 5px 6px !important;
        font-size: 11px !important;
        width: 100% !important;
    }
    
    /* Ensure dropdown items are also in column layout */
    .dropdown-item {
        display: flex !important;
        justify-content: space-between !important;
        align-items: start !important;
        width: 100% !important;
        padding: 10px 15px !important;
        border-bottom: 1px solid #e5e5e5 !important;
        cursor: pointer !important;
        text-decoration: none !important;
        color: #333 !important;
    }
    
    .dropdown-item:last-child {
        border-bottom: none !important;
    }
    
    .dropdown-item:hover {
        background-color: #f8f9fa !important;
    }
    
    .dropdown-item.open {
        background-color: #e3f2fd !important;
        color: var(--primary) !important;
        font-weight: 500 !important;
    }
    
    .filter-group {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .filter-title {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .filter-options label {
        font-size: 13px;
    }
    
    .product-page {
        padding: 50px 0;
    }
}

/* Small Mobile Styles (up to 480px) */
@media (max-width: 480px) {
    .product-page .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        grid-gap: 10px;
    }
    
    .product-card {
        padding: 8px;
    }
    
    .product-card .product-title {
        font-size: 13px;
    }
    
    .product-card .product-price {
        font-size: 12px;
    }
    
    .page-header h1 {
        font-size: 18px;
    }
    
    .filter-panel {
        padding: 15px;
    }
    
    .filter-group {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .filter-title {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .sub-label {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .multi-dropdown > li {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Landscape Mobile Styles */
@media (max-width: 767px) and (orientation: landscape) {
    .filter-panel {
        height: 100vh;
        overflow-y: auto;
    }
    
    .product-page .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-card img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

.product-page .product-grid .product-card {
    width: 100%;
}

.category-item{
    display: flex;
    align-items: center;
}