/* Inline Filter Styling - Inherits theme colors */
.store-filter-inline {
    padding: 12px 15px;
    background: var(--bs-secondary-bg, rgba(128, 128, 128, 0.1));
    border-radius: 4px;
}

.store-filter-inline form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.store-filter-group {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.store-filter-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    opacity: 0.7;
}

/* Hide the PRICE label */
.store-filter-group:has(.store-filter-price-slider) .store-filter-title {
    display: none;
}

.store-filter-options {
    display: inline-flex;
    align-items: center;
}

/* Boxed Checkboxes */
.store-filter-boxed-options {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.store-filter-box {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bs-body-bg, transparent);
    border: 1px solid var(--bs-border-color, currentColor);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    font-size: 0.85rem;
    line-height: 1.3;
    opacity: 0.8;
}

.store-filter-box:hover {
    opacity: 1;
    border-color: var(--bs-primary, currentColor);
}

.store-filter-box.active {
    background: var(--bs-primary, currentColor);
    border-color: var(--bs-primary, currentColor);
    color: var(--bs-light, #fff);
    opacity: 1;
}

.store-filter-box.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.store-filter-box input[type="checkbox"] {
    display: none;
}

.store-filter-box-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.store-filter-count {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Price Slider - theme-matched colors */
.store-filter-price-slider {
    min-width: 200px;
    padding: 10px 5px;
}

.store-filter-price-slider .irs {
    font-family: inherit;
    font-size: 0.8rem;
}

.store-filter-price-slider .irs-line {
    height: 4px;
    top: 27px;
    background: currentColor !important;
    opacity: 0.2;
    border-radius: 2px;
}

.store-filter-price-slider .irs-bar {
    height: 4px;
    top: 27px;
    background-color: currentColor !important;
    opacity: 0.7;
    border-radius: 2px;
}

.store-filter-price-slider .irs-handle {
    width: 16px;
    height: 16px;
    top: 21px;
    background: var(--bs-body-bg, #222) !important;
    border: 2px solid currentColor !important;
    border-color: currentColor !important;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: none !important;
}

.store-filter-price-slider .irs-handle:hover,
.store-filter-price-slider .irs-handle.state_hover {
    background: currentColor !important;
}

.store-filter-price-slider .irs-from,
.store-filter-price-slider .irs-to,
.store-filter-price-slider .irs-single {
    background-color: var(--bs-body-bg, #222) !important;
    color: inherit !important;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    border: 1px solid currentColor;
}

.store-filter-price-slider .irs-from::before,
.store-filter-price-slider .irs-to::before,
.store-filter-price-slider .irs-single::before {
    border-top-color: var(--bs-body-bg, #222) !important;
}

.store-filter-price-slider .irs-min,
.store-filter-price-slider .irs-max {
    color: inherit;
    opacity: 0.5;
    font-size: 0.75rem;
    background: transparent !important;
}

.store-filter-price-slider .irs-grid-text {
    font-size: 0.7rem;
    color: inherit;
    opacity: 0.4;
}

/* Filter Actions */
.store-filter-actions {
    display: inline-flex;
    gap: 8px;
    /* Add top margin to align with attribute buttons (below the titles) */
    margin-top: calc(0.85rem * 1.2 + 6px); /* title font-size * line-height + gap */
    margin-left: auto; /* Right-align in container */
}

.store-filter-actions .btn {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .store-filter-inline {
        padding: 10px 12px;
    }
    
    .store-filter-inline form {
        gap: 16px;
    }
    
    .store-filter-group {
        flex-wrap: wrap;
    }
    
    .store-filter-box {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .store-filter-title {
        font-size: 0.8rem;
    }
}



/* Product List Block Container */
.store-product-list-block {
    margin: 2rem 0;
}

/* Product List Grid Row */
.store-product-list {
    margin-left: -15px;
    margin-right: -15px;
}

/* Individual Product Item Card */
.store-product-list-item {
    padding: 15px; /* Padding around the entire card */
    /*margin-bottom: 40px;*/
    /*background: #fff;*/
    border: none; /* No visible borders */
    cursor: pointer; /* Show pointer cursor for clickable tiles */
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

.store-product-list-item[data-product-url] {
    cursor: pointer;
}

/* Display border and shadow on hover */
.store-product-list-item:hover {
    border: 1px solid #e0e0e0; /* Light gray border */
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); /* 1px shadow */
}

/* Price display - always visible */
.store-product-list-item .store-product-list-price {
    /* Removed display-on-hover - price is always visible */
}

.store-product-list-item form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Product Thumbnail Container - with price overlay */
.store-product-list-thumbnail {
    margin-bottom: 0;
    margin-top: 0;
    overflow: hidden; /* Clip content to container */
   /* background: #fff;*/
    position: relative;
    padding: 0;
    border: none;
    /* Set aspect ratio for consistent image sizing */
    aspect-ratio: 1 / 1; /* Default Community Store product list ratio */
}

.store-product-list-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop to fill container while maintaining aspect ratio */
    display: block;
    transition: opacity 0.3s ease;
}

/* Fade thumbnail for out-of-stock products */
.store-product-out-of-stock .store-product-list-thumbnail img {
    opacity: 0.4; /* Faded appearance */
}

.store-product-list-thumbnail a {
    display: block;
    position: relative;
}

/* Out of Stock Overlay - centered on thumbnail */
.store-out-of-stock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    z-index: 20;
    pointer-events: none;
    white-space: nowrap;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Price display - positioned after thumbnail in normal flow */
.store-product-list-price {
    margin: 10px 0 5px 0; /* Reduced bottom margin for less space before button */
    padding: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: center; /* Center the price */
}

.store-product-list-price .store-sale-price {
    font-weight: 400;
}

.store-product-list-price .store-original-price {
    font-size: 0.9em;
    text-decoration: line-through;
    margin-left: 5px;
}

/* Product Name - appears underneath the image */
.store-product-list-name {
    font-size: 1rem;
    font-weight: 700; /* Bold font weight for product name */
    margin: 15px 0 10px 0;
    line-height: 1.4;
    padding: 0;
}

.store-product-list-name a {
    color: #333;
    text-decoration: none;
}

.store-product-list-name a:hover {
    color: #333;
    text-decoration: underline;
}

/* Product Description - centered above thumbnail */
.store-product-list-description {
    /* Color removed to match price (inherit default text color) */
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0 0 15px 0;
    padding: 0;
    text-align: center; /* Center the text */
    flex-grow: 1;
}

.store-product-list-description p {
    margin-bottom: 0;
}

/* Action Bar - More Details and Add to Cart at bottom */
.store-product-list-block__action {
    padding: 0; /* Removed top padding to eliminate gap */
    border-top: none; /* No divider */
    display: flex;
    justify-content: center; /* Center content */
    align-items: center;
    margin-top: auto;
    flex-direction: column; /* Stack vertically for centering */
    gap: 10px; /* Space between elements */
}

/* More Details Link */
.store-btn-more-details,
.store-product-list-block__more-details {
    color: #007bff;
    text-decoration: none;
    font-size: 0.875rem;
    background: none;
    border: none;
    padding: 0;
}

.store-btn-more-details:hover,
.store-product-list-block__more-details:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Add to Cart Button - display on hover */
.store-btn-add-to-cart {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    border-radius: 0;
    border: 1px solid #ccc;
    background-color: #e0e0e0; /* Light gray background */
    color: #333;
    width: auto;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    margin: 0 auto; /* Center the button */
    margin-top: 0 !important; /* Remove any top margin */
    display: block;
}

.store-product-list-item:hover .store-btn-add-to-cart {
    opacity: 1 !important;
    visibility: visible !important;
}

.store-btn-add-to-cart:hover {
    background-color: #d0d0d0;
    border-color: #bbb;
    color: #333;
}

/* Product Options */
.store-product-options {
    margin: 0 0 0 0; /* Removed bottom margin to eliminate gap above button */
    padding: 0;
}

.store-product-option-group {
    margin-bottom: 15px;
}

.store-product-option-group-label {
    font-weight: 400;
    margin-bottom: 8px;
    display: block;
    color: #333;
    font-size: 0.875rem;
}

/* Quantity Input */
.store-product-quantity {
    margin-bottom: 15px;
}

.store-product-qty {
    max-width: 120px;
}

/* SKU */
.store-product-sku {
    font-size: 0.85em;
    color: #999;
    font-weight: normal;
}

/* Out of Stock Label */
.store-out-of-stock-label {
    margin: 15px 0;
    padding: 10px;
    font-size: 0.875rem;
}

/* Sort Options */
.store-product-list-sort {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* Divider */
.store-product-list-block hr.store-product-divider {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid #eee;
}

/* List View Mode Adjustments */
.store-product-list-item .row {
    align-items: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Ensure Bootstrap grid columns work on mobile */
    .store-product-list .store-product-list-item.col-xs-6 {
        width: 50% !important;
        float: left !important;
        padding-left: 15px;
        padding-right: 15px;
        display: block;
    }
    
    /* Clear floats to prevent wrapping issues */
    .store-product-list .row::after {
        content: "";
        display: table;
        clear: both;
    }
    
    .store-product-list-item {
        margin-bottom: 30px;
        padding: 12px; /* Slightly less padding on mobile */
    }
    
    .store-product-list-name {
        font-size: 0.95rem;
    }
    
    .store-product-list-price {
        font-size: 0.9rem;
        margin: 8px 0 5px 0;
        text-align: center;
    }
    
    .store-product-list-block__action {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-top: 12px;
    }
    
    .store-btn-add-to-cart {
        width: 100%;
    }
    
    /* Center description on mobile too */
    .store-product-list-description {
        text-align: center;
    }
}


