.product-page-container { padding-top: 100px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.product-page-container .main-content { margin-bottom: 30px; }
.product-header { background: #81b9f0; padding: 20px 0; color: white; margin-bottom: 30px; }

.layout-grid { display: grid; grid-template-columns: 250px 1fr; gap: 30px; align-items: stretch; }

/* Sidebar */
/* .category-box { border: 1px solid #ddd; padding: 15px; border-radius: 4px; }
.category-box h3 { border-bottom: 2px solid #ddd; padding-bottom: 10px; margin-top: 0; }
.category-box ul { list-style: none; padding: 0; }
.category-box li a { text-decoration: none; color: #888; font-size: 14px; line-height: 2; } */
/* Sidebar Category Box */
.category-box { 
    border: 1px solid #ddd; 
    border-radius: 4px;
    background: #fff;
    display: flex;
    flex-direction: column;
    max-height: 600px;
}

.category-box h3 { 
    padding: 15px;
    margin: 0;
    border-bottom: 2px solid #eee;
    font-size: 18px;
    background: #fff; /* Keeps header fixed at top while scrolling */
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Scrollable Area */
.category-box ul { 
    list-style: none; 
    padding: 10px 15px; 
    margin: 0;
    overflow-y: auto; /* Enables vertical scrolling */
}

.category-box li a { 
    text-decoration: none; 
    color: #888; 
    font-size: 14px; 
    line-height: 2.2; 
    display: block;
    transition: color 0.2s ease;
}

.category-box li a:hover {
    color: #81b9f0; /* Matches your theme blue */
}

/* Custom Scrollbar Styling (Webkit browsers like Chrome/Safari) */
.category-box ul::-webkit-scrollbar {
    width: 6px;
}

.category-box ul::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.category-box ul::-webkit-scrollbar-thumb {
    background: #81b9f0; 
    border-radius: 10px;
}

.category-box ul::-webkit-scrollbar-thumb:hover {
    background: #6ea8e0;
}

/* Enhanced Desktop Category Box - Apply mobile polish to desktop (min-width 768px) */
@media (min-width: 768px) {
    .category-box {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        border-radius: 8px;
        border: 1px solid #ddd;
    }
    
    .category-box h3 {
        background: #81b9f0 !important;
        color: white !important;
        font-weight: 600;
        font-size: 18px;
        padding: 16px 20px !important;
        border-radius: 8px 8px 0 0;
        margin: 0;
        border-bottom: none;
    }
    
    .category-box ul,
    .product-category-list {
        padding: 12px 16px;
        max-height: calc(600px - 64px);
    }
    
    .product-category-list li {
        padding: 0;
        border-bottom: 1px solid #eee;
        line-height: 1.4;
    }
    
    .product-category-list li a {
        font-size: 15px;
        font-weight: 500;
        padding: 0 0 0 6px;
        border-radius: 6px;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
    }
    
    .product-category-list li a:hover,
    .product-category-list li a.active {
        background: #f0f8ff;
        color: #81b9f0 !important;
    }
    
    .product-category-list .children {
        background: #f9f9f9;
        padding: 0 0 0 20px;
        margin: 8px 0;
        border-radius: 4px;
        max-height: none;
        overflow: visible;
    }
    
    .product-category-list .children li {
        border-bottom: none;
        padding: 6px 0;
    }
    
    .product-category-list .children li a {
        font-size: 14px;
    }
}

/* Ensure the list is a single column for scrolling */
.product-category-list {
    list-style: none;
    padding: 10px 15px;
    margin: 0;
    overflow-y: auto;
}

/* Base style for all category items */
.product-category-list li {
    line-height: 2.2;
}

.product-category-list li a {
    text-decoration: none;
    color: #888;
    font-size: 14px;
    display: block;
}

/* Indentation for sub-categories */
.product-category-list .children {
    list-style: none;
    padding-left: 20px; /* Adjust this value for more/less indentation */
    margin: 0;
}

/* Optional: Subtle visual cue for nested items */
.product-category-list .children li a::before {
    content: "— "; /* Adds a dash before sub-categories */
    color: #ccc;
    margin-right: 5px;
}

.product-category-list li a:hover {
    color: #81b9f0;
}

/* Highlight the active filter */
.product-category-list li a.active {
    color: #81b9f0;
    font-weight: bold;
    border-left: 3px solid #81b9f0;
    padding-left: 10px;
}

/* Ensure the "ALL" button stands out slightly */
.product-category-list li:first-child {
    border-bottom: 1px solid #eee;
}

/* Grid */
.grid-toolbar { background: #81b9f0; color: white; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-radius: 3px; }

/* Sort Dropdown */
.sort-dropdown-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-dropdown-container label {
    margin: 0;
    font-weight: 500;
}

/* Legacy .product-sort-select styles deprecated - use custom dropdown */
.product-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;
    grid-auto-rows: 1fr;
}

/* Card */
.product-card { 
    border: 1px solid #eee; 
    padding: 15px; 
    text-align: center; 
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}
.product-card h4 { font-size: 14px; margin: 10px 0 5px; color: #333; }
.category-label {
    font-size: 12px;
    color: #81b9f0;
    font-weight: 600;
    margin-bottom: 10px;
}
.add-to-cart { 
    display: block; 
    background: #81b9f0; 
    color: white; 
    padding: 10px 15px; 
    text-decoration: none; 
    border-radius: 4px; 
    font-weight: bold;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    transition: background-color 0.3s ease;
}
.add-to-cart:hover {
    background-color: #6ea8e0;
}

/* Pagination */
.pagination ul { display: flex; list-style: none; gap: 10px; justify-content: center; margin-top: 40px; }
.pagination ul li a, .pagination ul li span { border: 1px solid #ddd; padding: 8px 15px; text-decoration: none; color: #333; }
.pagination .current { background: #81b9f0; color: white; border-color: #81b9f0; }

/* Container for the image */
.product-image {
    max-width: 100%;
    max-height: 200px; /* Adjust this to match your design's box height */
    background-color: #f9f9f9; /* Optional: light grey for images with different ratios */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Styles for both standard and external images */
.product-image img, 
.product-image .external-thumb {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Scales image to fit inside without cropping */
    object-position: center; /* Keeps image centered in the box */
}