/* Variables */
:root {
    --hexa-primary-color: #2563EB;
    --hexa-accent-color: #1F2937;
    --hexa-border-color: #E5E7EB;
    --hexa-background-color: #FFFFFF;
    --hexa-text-color: #374151;
    --hexa-light-text: #6B7280;
}

.hexa-filter-wrapper {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Filter Sidebar */
.hexa-filter {
    width: 280px;
    background-color: var(--hexa-background-color);
    border: 1px solid var(--hexa-border-color);
    border-radius: 8px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.hexa-filter-section {
    border-bottom: 1px solid var(--hexa-border-color);
    padding: 1rem 0;
}

.hexa-filter-section:last-of-type {
    border-bottom: none;
}

.hexa-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.hexa-filter-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--hexa-accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hexa-toggle-icon {
    font-size: 12px;
    color: var(--hexa-light-text);
    transition: transform 0.3s ease;
}

.hexa-toggle-icon.hexa-active {
    transform: rotate(180deg);
}

.hexa-filter-content {
    margin-top: 1rem;
    display: none;
}

.hexa-filter-content.hexa-active {
    display: block;
}

/* Switch */
.hexa-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
    font-size: 14px;
    color: var(--hexa-text-color);
}

.hexa-switch input {
    display: none;
}

.hexa-slider {
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: var(--hexa-border-color);
    border-radius: 12px;
    position: relative;
    transition: background-color 0.3s ease;
}

.hexa-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hexa-switch input:checked + .hexa-slider {
    background-color: var(--hexa-primary-color);
}

.hexa-switch input:checked + .hexa-slider::after {
    left: 22px;
}

/* Price Section */
.hexa-price-info {
    font-size: 12px;
    color: var(--hexa-light-text);
    margin-bottom: 0.5rem;
}

.hexa-price-current-range {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--hexa-accent-color);
    margin-bottom: 1rem;
}

.hexa-price-slider-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.hexa-price-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--hexa-border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 0.5rem;
}

.hexa-price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--hexa-primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.hexa-price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hexa-price-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--hexa-primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.hexa-price-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Categories Select */
.hexa-categories-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--hexa-border-color);
    border-radius: 4px;
    font-size: 13px;
    color: var(--hexa-text-color);
    background-color: var(--hexa-background-color);
}

.hexa-categories-select option {
    padding: 0.5rem;
}

/* Order Section */
.hexa-order-section {
    border-bottom: none;
    padding: 1rem 0 0 0;
}

.hexa-order-section label {
    display: block;
    font-size: 12px;
    color: var(--hexa-light-text);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.hexa-order-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--hexa-border-color);
    border-radius: 4px;
    font-size: 13px;
    color: var(--hexa-text-color);
    background-color: var(--hexa-background-color);
}

/* Buttons */
.hexa-btn-clear {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--hexa-border-color);
    background-color: transparent;
    color: var(--hexa-text-color);
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hexa-btn-clear:hover {
    border-color: var(--hexa-primary-color);
    color: var(--hexa-primary-color);
}

.hexa-btn-load-more {
    display: block;
    margin: 2rem auto 0;
    padding: 0.75rem 2rem;
    border: 1px solid var(--hexa-primary-color);
    background-color: var(--hexa-primary-color);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hexa-btn-load-more:hover {
    background-color: #1D4ED8;
    border-color: #1D4ED8;
}

/* Products Wrapper */
.hexa-products-wrapper {
    flex: 1;
    position: relative;
}

.hexa-products-container {
    min-height: 400px;
}

.hexa-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.hexa-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--hexa-light-text);
}

.woocommerce ul.products li.product img,
ul.products li.product img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

ul.products.hexa-filtered-products {
    align-items: start;
}

ul.products.hexa-filtered-products li.product {
    align-self: start;
    height: auto !important;
    max-width: 100%;
    overflow: hidden;
}

ul.products.hexa-filtered-products li.product .woocommerce-LoopProduct-link {
    display: block;
    height: auto !important;
}

ul.products.hexa-filtered-products li.product .hexa-product-image-frame {
    display: block !important;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #F9FAFB;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    border-radius: inherit;
    overflow: hidden;
}

ul.products.hexa-filtered-products li.product .woocommerce-LoopProduct-link img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

ul.products.hexa-filtered-products li.product img.hexa-product-image {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    object-position: center;
}

ul.products.hexa-filtered-products li.product .wa-shop-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
}

/* Loader */
.hexa-products-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

.hexa-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--hexa-border-color);
    border-top-color: var(--hexa-primary-color);
    border-radius: 50%;
    animation: hexa-spin 0.8s linear infinite;
}

@keyframes hexa-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Filter Toggle (Mobile) */
.hexa-filter-toggle {
    display: none;
    padding: 0.75rem 1rem;
    background-color: var(--hexa-primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hexa-filter-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }

    .hexa-filter {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        border-radius: 0;
        max-height: 100vh;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .hexa-filter.hexa-mobile.hexa-active {
        transform: translateX(0);
    }

    .hexa-filter-toggle {
        display: block;
        position: relative;
        z-index: 999;
    }

    .hexa-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hexa-products-grid {
        grid-template-columns: 1fr;
    }

}

/* Elementor Compatibility */
.elementor-widget-hexa_filter_widget .hexa-filter-wrapper {
    margin: 0;
}
