/* ================================================================
   Ecodle Filter Plugin — CSS
   Matches the Ecodle shop design: cream bg, dark crimson accents,
   serif/uppercase labels, clean radio/checkbox styling.
================================================================ */

:root {
    --ecf-crimson:    #8b1a3a;
    --ecf-crimson-bg: #f5eaee;
    --ecf-text:       #1a1a1a;
    --ecf-muted:      #6b6b6b;
    --ecf-border:     #e0d6d8;
    --ecf-tag-bg:     #8b1a3a;
    --ecf-tag-text:   #fff;
    --ecf-radius:     3px;
}

/* ---------------------------------------------------------------
   SIDEBAR
--------------------------------------------------------------- */
.ecf-sidebar {
    width: 100%;
    color: var(--ecf-text);
}

.ecf-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ecf-border);
    margin-bottom: 4px;
}

.ecf-filters-icon {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ecf-text);
}

.ecf-filters-icon svg {
    flex-shrink: 0;
}

.ecf-clear-link {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--ecf-crimson);
    text-decoration: none;
    text-transform: uppercase;
    transition: opacity .2s;
}
.ecf-clear-link:hover { opacity: .7; }

/* Section */
.ecf-section {
    border-bottom: 1px solid var(--ecf-border);
}

.ecf-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--ecf-text);
    cursor: pointer;
    user-select: none;
}

.ecf-chevron {
    display: flex;
    align-items: center;
    line-height: 1;
    transition: transform .25s;
    color: var(--ecf-muted);
}

.ecf-section-header.ecf-collapsed .ecf-chevron {
    transform: rotate(180deg);
}

.ecf-section-body {
    padding-bottom: 12px;
    overflow: hidden;
    transition: max-height .3s ease, opacity .25s;
}

.ecf-section-body.ecf-hidden {
    display: none;
}

/* Radio */
.ecf-radio-label,
.ecf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    font-size: 13.5px;
    color: var(--ecf-text);
    cursor: pointer;
    border-radius: var(--ecf-radius);
    transition: color .15s;
    position: relative;
}

.ecf-radio-label:hover,
.ecf-checkbox-label:hover {
    color: var(--ecf-crimson);
}

/* Active / selected state — crimson background pill */
.ecf-radio-label:has(input:checked),
.ecf-radio-label.ecf-active-item:has(input:checked) {
    color: var(--ecf-crimson);
    font-weight: 500;
}

/* Hide native inputs */
.ecf-radio-label input[type="radio"],
.ecf-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

/* Custom radio — hidden by default, shows ✦ when active */
.ecf-radio-custom {
    display: none;
}

.ecf-radio-label:has(input:checked)::before {
    content: '✦';
    font-size: 10px;
    color: var(--ecf-crimson);
    flex-shrink: 0;
    line-height: 1;
    margin-right: -2px;
}

/* Custom checkbox */
.ecf-check-custom {
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--ecf-border);
    border-radius: 2px;
    flex-shrink: 0;
    position: relative;
    background: #fff;
    transition: border-color .15s, background .15s;
}

.ecf-checkbox-label:has(input:checked) .ecf-check-custom {
    border-color: var(--ecf-crimson);
    background: var(--ecf-crimson);
}

.ecf-checkbox-label:has(input:checked) .ecf-check-custom::after {
    content: '';
    position: absolute;
    left: 3px; top: 1px;
    width: 5px; height: 8px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(40deg);
}

/* Active label highlight */
.ecf-radio-label.ecf-active-item:has(input:checked) {
    border-radius: var(--ecf-radius);
}

/* Category count badge */
.ecf-cat-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--ecf-muted);
}

/* Apply button (no-JS fallback) */
.ecf-apply-btn {
    width: 100%;
    margin-top: 14px;
    padding: 10px;
    background: var(--ecf-crimson);
    color: #fff;
    border: none;
    border-radius: var(--ecf-radius);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
}

/* ---------------------------------------------------------------
   TOP BAR
--------------------------------------------------------------- */
.ecf-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--ecf-border);
    margin-bottom: 20px;
}

.ecf-topbar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ecf-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Count text */
.ecf-count {
    font-size: 13px;
    color: var(--ecf-text);
    font-weight: 400;
}

.ecf-count span {
    color: var(--ecf-muted);
}

.ecf-active-count {
    font-size: 12px;
    color: var(--ecf-muted);
}

/* Active filter tags */
.ecf-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1.5px solid var(--ecf-crimson);
    color: var(--ecf-crimson);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 30px;
}

.ecf-tag-remove {
    color: var(--ecf-crimson);
    text-decoration: none;
    font-size: 10px;
    line-height: 1;
    transition: opacity .15s;
}
.ecf-tag-remove:hover { opacity: .6; }

/* Sort select */
.ecf-sort-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font-family: var(--ecf-font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ecf-text);
    cursor: pointer;
    padding-right: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231a1a1a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    outline: none;
}

.ecf-sort-form { display: inline-flex; align-items: center; }

/* Clear top button */
.ecf-clear-top {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ecf-text);
    text-decoration: none;
    transition: color .15s;
}
.ecf-clear-top:hover { color: var(--ecf-crimson); }

/* ---------------------------------------------------------------
   Loading state overlay on Elementor Loop Grid
--------------------------------------------------------------- */
.ecf-loop-loading {
    position: relative;
    pointer-events: none;
}
.ecf-loop-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.55);
    z-index: 10;
}

/* ---------------------------------------------------------------
   Responsive
--------------------------------------------------------------- */
@media (max-width: 768px) {
    .ecf-topbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .ecf-topbar-right {
        width: 100%;
        justify-content: flex-end;
    }
}
