.filter-sidebar {
    background: #ffffff;
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.filter-sidebar:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.categories-section {
    margin-bottom: 30px;
}

.categories-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.categories-dropdown {
    background: white;
    border: none;
    padding-left: 20px;
    display: none;
}

.category-item {
    padding: 8px 0;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-item:hover {
    color: #333;
}

.category-item.active {
    color: #24511D;
    font-weight: 500;
}

.subcategory-dropdown {
    padding-left: 20px;
    margin-top: 8px;
    display: none;
}

.subcategory-item {
    padding: 6px 0;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
}

.subcategory-item:hover {
    color: #666;
}

.filter-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch.active {
    background-color: #24511D;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(20px);
}

.brands-list {
    overflow-y: auto;
}

.brand-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.brand-item input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #24511D;
}

.brand-item label {
    color: #666;
    cursor: pointer;
    margin-bottom: 0;
}

.show-all-link {
    color: #24511D;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
}

.show-all-link:hover {
    text-decoration: underline;
}

/* NEW MOBILE CSS - Add these styles */

/* Mobile filter button */
.mobile-filter-btn {
    margin-bottom: 15px;
}

.filter-toggle-btn {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.filter-toggle-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.filter-toggle-btn i {
    font-size: 1rem;
}

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

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

/* Hide mobile elements on desktop */
.mobile-filter-header,
.mobile-filter-actions {
    display: none;
}

/* Mobile responsive adjustments */
@media (max-width: 767.98px) {
    .filter-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 90%;
        max-width: 350px;
        height: 100vh;
        z-index: 999;
        transition: right 0.3s ease-in-out;
        overflow-y: auto;
        margin-bottom: 0;
        border-radius: 0;
        border: none;
        padding: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .filter-sidebar.show {
        right: 0;
    }
    
    /* Show mobile elements */
    .mobile-filter-header,
    .mobile-filter-actions {
        display: block;
    }
    
    /* Mobile filter header */
    .mobile-filter-header {
        padding: 20px 24px;
        border-bottom: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f8f9fa;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .mobile-filter-header h5 {
        margin: 0;
        font-weight: 600;
        color: #333;
        font-size: 1.1rem;
    }
    
    .btn-close {
        background: none;
        border: none;
        font-size: 1.4rem;
        opacity: 0.6;
        cursor: pointer;
        padding: 4px;
        line-height: 1;
        color: #333;
    }
    
    .btn-close:hover {
        opacity: 1;
    }
    
    /* Filter content padding for mobile */
    .categories-section,
    .filter-group {
        padding-left: 24px;
        padding-right: 24px;
    }
    
    .categories-section {
        padding-top: 20px;
        margin-bottom: 25px;
    }
    
    .filter-group {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
    
    /* Mobile filter actions */
    .mobile-filter-actions {
        padding: 20px 24px;
        border-top: 1px solid #e5e7eb;
        background: #f8f9fa;
        position: sticky;
        bottom: 0;
        display: flex;
        gap: 12px;
        margin-top: auto;
    }
    
    .mobile-filter-actions .btn {
        padding: 12px 20px;
        font-weight: 500;
        border-radius: 8px;
        font-size: 0.9rem;
    }
    
    .mobile-filter-actions .btn-primary {
        background-color: #24511D;
        border-color: #24511D;
    }
    
    .mobile-filter-actions .btn-outline-secondary {
        border-color: #ccc;
        color: #666;
    }
    
    /* Adjust categories dropdown for mobile */
    .categories-title {
        font-size: 1rem;
        padding: 15px 0;
    }
    
    .categories-dropdown {
        padding-left: 16px;
    }
    
    .category-item {
        padding: 12px 0;
        font-size: 0.95rem;
    }
    
    .subcategory-dropdown {
        padding-left: 16px;
    }
    
    .subcategory-item {
        padding: 10px 0;
        font-size: 0.9rem;
    }
    
    /* Better touch targets for mobile */
    .toggle-switch {
        width: 48px;
        height: 28px;
    }
    
    .toggle-slider {
        width: 24px;
        height: 24px;
        top: 2px;
        left: 2px;
    }
    
    .toggle-switch.active .toggle-slider {
        transform: translateX(20px);
    }
    
    .filter-title {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
    
    .brand-item {
        padding: 10px 0;
    }
    
    .brand-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-right: 12px;
    }
    
    .brand-item label {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .show-all-link {
        font-size: 0.9rem;
        margin-top: 8px;
        display: inline-block;
    }
}

/* Prevent body scroll when mobile filters are open */
body.filter-open {
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .filter-sidebar {
        width: 95%;
        max-width: none;
    }
    
    .mobile-filter-header {
        padding: 16px 20px;
    }
    
    .categories-section,
    .filter-group {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .mobile-filter-actions {
        padding: 16px 20px;
    }
}

.main-header {
    margin-bottom: 25px;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.sort-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sort-label {
    color: #666;
    font-size: 0.9rem;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    min-width: 140px;
    font-size: 0.9rem;
}

.products-count {
    color: #666;
    font-size: 0.9rem;
}

.view-options {
    display: flex;
    gap: 0; /* Remove gap between items */
}

.view-option {
    padding: 12px 20px; /* Increased padding for better click area */
    border: none; /* Remove all borders */
    background: transparent; /* Remove background */
    color: #666;
    cursor: pointer;
    font-size: 0.9rem; /* Slightly larger font */
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    border-bottom: 2px solid transparent; /* Add transparent bottom border */
}

.view-option:hover {
    color: #333;
    background: transparent; /* Keep background transparent on hover */
}

.view-option.active {
    background: transparent; /* Remove active background */
    border: none; /* Remove active border */
    color: #24511D; /* Blue text color for active state */
    border-bottom: 2px solid #24511D; /* Blue bottom border for active state */
    font-weight: 600; /* Slightly bolder font for active state */
}

/* Updated subcategory carousel styles */
.subcategory-carousel-wrapper {
    position: relative;
    margin-bottom: 30px;
    max-width: 98%;
    overflow: hidden;
}

.subcategory-carousel {
    display: flex;
    gap: 15px;
    padding: 10px 0;
    transition: transform 0.3s ease;
    width: 100%;
}

.subcategory-item-carousel {
    display: flex;
    flex-direction: row; /* Changed from column to row */
    align-items: center; /* Center vertically */
    min-width: calc(25% - 12px);
    flex: 0 0 calc(25% - 12px);
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 35px; /* Rounded pill shape */
    transition: all 0.2s ease;
    border: 2px solid #e0e0e0; /* Add border */
    background: white;
    white-space: nowrap; /* Prevent text wrapping */
}

.subcategory-item-carousel:hover {
    background-color: #f8f9fa;
    border-color: #24511D;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.1);
}

.subcategory-icon {
    position: relative;
    width: 85px; /* Slightly increased for arch layout */
    height: 45px; /* Increased height for vertical arch positioning */
    margin-right: 12px;
    margin-bottom: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subcategory-icon img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ffffff;
    position: absolute;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Center image (highest in arch) */
.subcategory-icon img:nth-child(1) {
    left: 23px; /* Center position */
    top: 2px; /* Higher position for arch effect */
    z-index: 3;
    transform: translateY(0);
}

/* Left image (lower in arch) */
.subcategory-icon img:nth-child(2) {
    left: 8px; /* Left position */
    top: 8px; /* Lower position for arch effect */
    z-index: 2;
    transform: translateY(0);
}

/* Right image (lower in arch) */
.subcategory-icon img:nth-child(3) {
    left: 38px; /* Right position */
    top: 8px; /* Lower position for arch effect */
    z-index: 1;
    transform: translateY(0);
}

/* Hover effects - images spread apart */
.subcategory-item-carousel:hover .subcategory-icon img:nth-child(1) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.subcategory-item-carousel:hover .subcategory-icon img:nth-child(2) {
    transform: translateX(-3px) translateY(2px) scale(1.02);
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}

.subcategory-item-carousel:hover .subcategory-icon img:nth-child(3) {
    transform: translateX(3px) translateY(2px) scale(1.02);
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}

.subcategory-name {
    font-size: 0.9rem; /* Slightly larger for better readability */
    color: #333;
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.carousel-nav-btn:hover {
    background: #f8f9fa;
    border-color: #24511D;
    color: #24511D;
}

.carousel-prev {
    left: -20px;
}

.carousel-next {
    right: -20px;
}

.carousel-nav-btn:disabled,
.carousel-nav-btn.hidden {
    display: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .subcategory-item-carousel {
        min-width: calc(50% - 8px);
        flex: 0 0 calc(50% - 8px);
        padding: 10px 12px;
    }
    
    .subcategory-carousel {
        gap: 10px;
    }
    
    .subcategory-icon {
        width: 75px;
        height: 40px;
        margin-right: 10px;
    }
    
    .subcategory-icon img {
        width: 33px;
        height: 33px;
    }
    
    /* Adjusted positions for mobile */
    .subcategory-icon img:nth-child(1) {
        left: 21px;
        top: 2px;
    }
    
    .subcategory-icon img:nth-child(2) {
        left: 8px;
        top: 7px;
    }
    
    .subcategory-icon img:nth-child(3) {
        left: 34px;
        top: 7px;
    }
    
    .subcategory-name {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .subcategory-item-carousel {
        min-width: calc(100% - 5px);
        flex: 0 0 calc(100% - 5px);
    }
    
    .subcategory-icon {
        width: 65px;
        height: 35px;
    }
    
    .subcategory-icon img {
        width: 28px;
        height: 28px;
    }
    
    /* Further adjusted positions for small mobile */
    .subcategory-icon img:nth-child(1) {
        left: 18px;
        top: 2px;
    }
    
    .subcategory-icon img:nth-child(2) {
        left: 6px;
        top: 6px;
    }
    
    .subcategory-icon img:nth-child(3) {
        left: 30px;
        top: 6px;
    }
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    border: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

.product-card-link:hover {
    text-decoration: none !important;
    color: inherit !important;
}

.product-card-link:focus {
    text-decoration: none !important;
    color: inherit !important;
    outline: none; /* Optional: removes focus outline */
}

.product-card-link:visited {
    text-decoration: none !important;
    color: inherit !important;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 315px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.no-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    background: #f8f9fa;
}

.no-image-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.no-image-placeholder span {
    font-size: 0.8rem;
    text-align: center;
}

.best-seller-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: white;
    color: #333;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600; /* Thin font weight */
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.best-seller-badge::before {
    content: "";
    width: 14px;
    height: 14px;
    background-image: url('/static/icons/star.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.sustainable-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 8px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.2s ease;
    background-image: url('/static/icons/leaf.png');
    background-size: 18px 18px;
    background-repeat: no-repeat;
    background-position: center;
}

.sustainable-badge:hover {
    transform: scale(1.1);
}

.icon-leaf::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('/static/icons/leaf.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 8px;
    vertical-align: middle;
}

.icon-star::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('/static/icons/star.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 8px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .best-seller-badge {
        top: 8px;
        left: 8px;
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .best-seller-badge::before {
        width: 12px;
        height: 12px;
    }
    
    .sustainable-badge {
        bottom: 8px;
        right: 8px;
        width: 28px;
        height: 28px;
        padding: 6px;
        background-size: 16px 16px;
    }
}

.product-info {
    padding: 15px;
    flex: 1; /* Allow product-info to grow and fill remaining space */
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #333;
    line-height: 1.3;
    height: 2.6em; /* Fixed height for 2 lines max */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-brand {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.product-description {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
    height: 3.36em; /* Fixed height for 3 lines max */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.product-colors {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    min-height: 32px;
}

.color-option {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.color-option:hover {
    transform: scale(1.1);
    border-color: #333;
}

.color-option.selected {
    border-color: #333;
    border-width: 2px;
    transform: scale(1.05);
}

.color-more {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    margin-left: 4px;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; 
}

.product-price {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.personalize-btn {
    background: none;
    border: 1px solid #24511D;
    color: #24511D;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.personalize-btn:hover {
    background: #0a3304;
    color: white;
}

.personalize-btn i {
    font-size: 0.7rem;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.page-link {
    color: #333;
    border-color: #ddd;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.page-link:hover {
    color: #24511D;
    border-color: #24511D;
    background-color: #f8f9fa;
}

.page-item.active .page-link {
    background-color: #24511D;
    border-color: #24511D;
}

.no-products-found {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-products-found i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .header-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-section {
        justify-content: space-between;
    }
    
    .subcategory-carousel {
        gap: 15px;
    }
    
    .subcategory-item-carousel {
        min-width: 100px;
    }
}

.page-header-section {
    background: #f8f9fa;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.breadcrumb-item {
    color: #6c757d;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item:hover {
    color: #24511D;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #333;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #6c757d;
    font-size: 0.8rem;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    margin-top: 0;
}

.page-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
    font-size: 16px;
}

.page-description a {
    color: #24511D;
    text-decoration: none;
}

.page-description a:hover {
    text-decoration: underline;
}

.highlight-text {
    font-weight: 600;
    color: #333;
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .breadcrumb-nav {
        font-size: 0.85rem;
    }
}

.btn-primary {
    background-color: #0a3304;
    border: 2px solid #0a3304;
    color: white;
}

.btn-primary:hover {
    background-color: #24511D;
    border-color: #24511D;
    border: 2px solid #24511D;
    transform: translateY(-2px);
}