/* AGH E-commerce Filter Styles */
:root {
    --agh-ecf-sidebar-width: 280px;
    --agh-ecf-gap: 30px;
    --agh-ecf-primary-color: #000;
    --agh-ecf-secondary-color: #666;
    --agh-ecf-accent-color: #007cba;
    --agh-ecf-border-color: #ddd;
    --agh-ecf-bg-color: #fff;
    --agh-ecf-overlay-color: rgba(0, 0, 0, 0.45);
    --agh-ecf-drawer-width: 85vw;
    --agh-ecf-drawer-max-width: 360px;
    --agh-ecf-transition: all 0.3s ease;
}

/* Desktop Layout */
@media screen and (min-width: 992px) {
    .agh-ecf-container {
        display: grid;
        grid-template-columns: var(--agh-ecf-sidebar-width) 1fr;
        gap: 36px;
        align-items: start;
        margin-bottom: 40px;
    }

    .agh-ecf-sidebar {
        position: sticky;
        top: 20px;
        background: var(--agh-ecf-bg-color);
        padding: 22px 20px;
        border: 1px solid #e5e5e5;
        border-radius: 6px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
    }

    .agh-ecf-content {
        flex: 1;
    }

    /* Ensure product grid works well */
    .agh-ecf-content ul.products {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 26px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .agh-ecf-content ul.products li.product {
        margin: 0;
        width: 100%;
    }

    .agh-ecf-mobile-trigger {
        display: none;
    }
}

/* Mobile Layout */
@media screen and (max-width: 991px) {
    .agh-ecf-container {
        display: block;
    }

    .agh-ecf-sidebar {
        display: none;
    }

    .agh-ecf-mobile-trigger {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: var(--agh-ecf-primary-color);
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 4px;
        cursor: pointer;
        margin-bottom: 20px;
        font-size: 14px;
        font-weight: 500;
        transition: var(--agh-ecf-transition);
    }

    .agh-ecf-mobile-trigger:hover {
        opacity: 0.9;
    }

    .agh-ecf-filter-icon {
        display: inline-block;
        width: 16px;
        height: 16px;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="white" d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/></svg>') no-repeat center;
    }
}

/* Filter Components */
.agh-ecf-filters-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--agh-ecf-primary-color);
}

.agh-ecf-filter-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--agh-ecf-border-color);
}

.agh-ecf-filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.agh-ecf-filter-title {
    margin: 0 0 15px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--agh-ecf-primary-color);
}

.agh-ecf-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.agh-ecf-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    min-width: 42px;
    border: 1px solid var(--agh-ecf-border-color);
    border-radius: 24px;
    background: #fafafa;
    color: var(--agh-ecf-primary-color);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--agh-ecf-transition);
}

.agh-ecf-chip:hover {
    border-color: var(--agh-ecf-primary-color);
    color: var(--agh-ecf-primary-color);
}

.agh-ecf-chip.active {
    border-color: var(--agh-ecf-primary-color);
    background: var(--agh-ecf-primary-color);
    color: #fff;
}

.agh-ecf-color-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.agh-ecf-color-swatch {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #e5e5e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--agh-ecf-transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.agh-ecf-color-swatch:hover {
    border-color: var(--agh-ecf-primary-color);
    transform: translateY(-1px);
}

.agh-ecf-color-swatch.active {
    border-color: var(--agh-ecf-primary-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.agh-ecf-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: inline-block;
}

/* Category Tree */
.agh-ecf-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.agh-ecf-category-list.depth-0 {
    margin-left: 0;
}

.agh-ecf-category-list.depth-1 {
    margin-left: 15px;
    margin-top: 5px;
}

.agh-ecf-category-item {
    position: relative;
    margin-bottom: 8px;
}

.agh-ecf-category-item:last-child {
    margin-bottom: 0;
}

.agh-ecf-accordion-toggle {
    position: absolute;
    left: -25px;
    top: 2px;
    background: none;
    border: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agh-ecf-toggle-icon {
    display: inline-block;
    transition: var(--agh-ecf-transition);
    font-size: 14px;
    line-height: 1;
}

.agh-ecf-category-item.active > .agh-ecf-accordion-toggle .agh-ecf-toggle-icon {
    transform: rotate(45deg);
}

.agh-ecf-category-link {
    display: block;
    padding: 4px 0;
    color: var(--agh-ecf-secondary-color);
    text-decoration: none;
    transition: var(--agh-ecf-transition);
    font-size: 14px;
}

.agh-ecf-category-link:hover {
    color: var(--agh-ecf-primary-color);
}

.agh-ecf-category-link.current {
    color: var(--agh-ecf-accent-color);
    font-weight: 500;
}

/* Availability Checkboxes */
.agh-ecf-checkbox-wrapper {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.agh-ecf-checkbox-wrapper:last-child {
    margin-bottom: 0;
}

.agh-ecf-checkbox {
    margin: 0 10px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.agh-ecf-checkbox-wrapper label {
    cursor: pointer;
    font-size: 14px;
    color: var(--agh-ecf-secondary-color);
    user-select: none;
}

/* Price Filter */
.agh-ecf-price-divider {
    height: 2px;
    width: 100%;
    background: #2f2f2f;
    margin-bottom: 16px;
    opacity: 0.85;
}

.agh-ecf-price-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 18px;
    align-items: center;
    margin: 14px 0 14px;
}

.agh-ecf-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 0%;
}

.agh-ecf-input-currency {
    font-size: 15px;
    color: #2f2f2f;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.agh-ecf-price-separator {
    font-size: 15px;
    color: #2f2f2f;
    font-weight: 600;
}

.agh-ecf-price-input {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--agh-ecf-border-color);
    border-radius: 3px;
    font-size: clamp(13px, 2.5vw, 15px);
    transition: var(--agh-ecf-transition);
    color: var(--agh-ecf-primary-color);
    text-align: center;
    background: #fff;
}

.agh-ecf-price-input:focus {
    outline: none;
    border-color: var(--agh-ecf-accent-color);
    box-shadow: 0 0 0 1px var(--agh-ecf-accent-color);
}

/* Range Slider */
.agh-ecf-range-slider {
    position: relative;
    height: 52px;
    margin-bottom: 18px;
    padding: 0 8px;
}

.agh-ecf-range-track {
    position: absolute;
    top: 50%;
    left: 14px;
    right: 14px;
    height: 10px;
    background: #2f2f2f;
    border-radius: 6px;
    transform: translateY(-50%);
    pointer-events: none;
}

.agh-ecf-range {
    position: absolute;
    top: 50%;
    left: 14px;
    right: 14px;
    width: calc(100% - 28px);
    height: 0;
    margin: 0;
    pointer-events: none;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
}

.agh-ecf-range::-webkit-slider-thumb {
    pointer-events: auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    border: 6px solid #2f2f2f;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.agh-ecf-range::-moz-range-thumb {
    pointer-events: auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    border: 6px solid #2f2f2f;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.agh-ecf-range-min {
    z-index: 2;
}

.agh-ecf-range-max {
    z-index: 3;
}

/* Apply Button */
.agh-ecf-apply-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--spacing-unit, 4px) * 1);
    width: 100%;
    background: var(--color-apply, #e9d9a3);
    color: #1a1a1a;
    border: none;
    padding: calc(var(--spacing-unit, 4px) * 3) calc(var(--spacing-unit, 4px) * 6);
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-base, var(--agh-ecf-transition));
}

.agh-ecf-apply-price:hover {
    background: #d8c48b;
    color: #0f0f0f;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
}

.agh-ecf-clear-all {
    display: inline-block;
    color: var(--agh-ecf-accent-color);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
    transition: var(--agh-ecf-transition);
}

.agh-ecf-clear-all:hover {
    text-decoration: underline;
}

/* Mobile Drawer */
.agh-ecf-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--agh-ecf-overlay-color);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: var(--agh-ecf-transition);
}

.agh-ecf-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.agh-ecf-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--agh-ecf-drawer-width);
    max-width: var(--agh-ecf-drawer-max-width);
    background: var(--agh-ecf-bg-color);
    z-index: 9999;
    transform: translateX(-100%);
    transition: var(--agh-ecf-transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.agh-ecf-mobile-drawer.active {
    transform: translateX(0);
}

.agh-ecf-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--agh-ecf-border-color);
    flex-shrink: 0;
}

.agh-ecf-drawer-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--agh-ecf-primary-color);
}

.agh-ecf-close-drawer {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--agh-ecf-secondary-color);
    padding: 0;
    transition: var(--agh-ecf-transition);
}

.agh-ecf-close-drawer:hover {
    color: var(--agh-ecf-primary-color);
}

.agh-ecf-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Body lock when drawer is open */
body.agh-ecf-drawer-open {
    overflow: hidden;
}

/* Responsive adjustments for product grid */
@media screen and (max-width: 768px) {
    .agh-ecf-content ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media screen and (max-width: 480px) {
    .agh-ecf-content ul.products {
        grid-template-columns: 1fr;
    }
    
    .agh-ecf-price-inputs {
        grid-template-columns: 1fr auto 1fr;
        gap: 10px;
    }
}

@media screen and (min-width: 992px) {
    .agh-ecf-filters {
        display: flex;
        flex-direction: column;
        gap: 18px;
    }

    .agh-ecf-filters-title {
        font-size: 16px;
        letter-spacing: 0.3px;
    }

    .agh-ecf-filter-section {
        margin-bottom: 18px;
        padding-bottom: 18px;
        border-bottom: 1px solid #eaeaea;
    }

    .agh-ecf-filter-section:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .agh-ecf-filter-title {
        font-size: 14px;
        letter-spacing: 0.2px;
        font-weight: 700;
    }

    .agh-ecf-price-input {
        height: 44px;
        border-color: #d6d6d6;
        border-radius: 4px;
    }
}
