/* ============================================================
   TECP Filter — left drawer panel (Phase 3 + Phase 5 tokens)
   Drawer slides from the left; mini-cart mirrors it from the right.

   tokens + drawer width live in popups.css (--tecp-pop-*, --tecp-drawer-width).
   NOTE: the on-page filter bar (toggle/badge/clear) sits on the white collection
   page — it keeps dark colours. Only the DRAWER + overlay use pop-up tokens.
   ============================================================ */

/* --- on-page filter toggle button (NOT a pop-up — stays dark on white page) --- */
.tecp-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.tecp-filter-toggle {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: lowercase;
    color: rgba(0, 0, 0, 0.65);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.tecp-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 10px;
    letter-spacing: 0;
    padding: 0 3px;
    margin-left: 6px;
}
.tecp-filter-clear-bar {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    color: rgba(0, 0, 0, 0.35);
    text-decoration: none;
}
.tecp-filter-clear-bar:hover { color: rgba(0, 0, 0, 0.65); }

/* --- overlay (shared with mini-cart) --- */
.tecp-drawer-overlay {
    position: fixed;
    inset: 0;
    background: var(--tecp-pop-overlay-bg);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.tecp-drawer-overlay.visible { opacity: 1; pointer-events: auto; }

/* --- filter panel (left drawer) --- */
.tecp-filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--tecp-drawer-width);
    max-width: 92vw;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--tecp-pop-panel-bg);
    -webkit-backdrop-filter: blur(var(--tecp-pop-panel-blur));
    backdrop-filter: blur(var(--tecp-pop-panel-blur));
    overflow-y: auto;
    overflow-x: hidden;
}
.tecp-filter-panel.open { transform: translateX(0); }

/* --- close button (absolute top-right, forced via JS) --- */
.tecp-filter-panel { position: relative; } /* anchor for close btn */
.tecp-filter-close { color: var(--tecp-pop-icon) !important; }
.tecp-filter-close:hover { color: var(--tecp-pop-icon-hover) !important; }

/* --- tecp-hidden utility --- */
.tecp-hidden { display: none !important; }

/* --- views --- */
.tecp-filter-view { padding: 24px 28px 32px; }
.tecp-filter-view-header {
    display: flex;
    align-items: center;
    min-height: 52px; /* space for the absolute close button */
    margin-bottom: 16px;
}
.tecp-filter-view-title {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    letter-spacing: 2.5px;
    text-transform: lowercase;
    color: var(--tecp-pop-text);
}

/* --- back button (view 2 header) --- */
.tecp-filter-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    letter-spacing: 1.5px;
    color: var(--tecp-pop-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}
.tecp-filter-back:hover { color: var(--tecp-pop-text); }

/* --- category navigation (view 1) --- */
.tecp-filter-cat-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tecp-filter-cat-all {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: lowercase;
    color: var(--tecp-pop-text-muted);
    text-decoration: none;
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid var(--tecp-pop-sep);
    margin-bottom: 12px;
}
.tecp-filter-cat-all:hover,
.tecp-filter-cat-all.active { color: var(--tecp-pop-text); }

.tecp-filter-cat-group { margin-bottom: 4px; }
.tecp-filter-cat-item {
    display: block;
    width: 100%;
    text-align: left;
    font-family: Verdana, Geneva, sans-serif;
    background: none;
    border: none;
    cursor: pointer;
    padding: 7px 0;
    -webkit-appearance: none;
    appearance: none;
    transition: color 0.15s;
}
.tecp-filter-cat-parent {
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: lowercase;
    color: var(--tecp-pop-text);
    font-weight: normal;
}
.tecp-filter-cat-parent:hover,
.tecp-filter-cat-parent.active { color: var(--tecp-pop-text); }

.tecp-filter-cat-children {
    padding-left: 14px;
    margin-top: 2px;
    margin-bottom: 4px;
}
.tecp-filter-cat-child {
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: lowercase;
    color: var(--tecp-pop-text-muted);
}
.tecp-filter-cat-child:hover,
.tecp-filter-cat-child.active { color: var(--tecp-pop-text); }

.tecp-filter-cat-grandchildren { padding-left: 12px; }
.tecp-filter-cat-grandchild {
    font-size: 11px;
    letter-spacing: 0.8px;
    color: var(--tecp-pop-text-faint);
}
.tecp-filter-cat-grandchild:hover,
.tecp-filter-cat-grandchild.active { color: var(--tecp-pop-text-muted); }

/* --- groups (view 2) --- */
.tecp-filter-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--tecp-pop-sep);
    margin-bottom: 24px;
}
.tecp-filter-group:last-of-type { border-bottom: none; margin-bottom: 0; }
.tecp-filter-group-label {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10px;
    letter-spacing: 2.5px;
    text-transform: lowercase;
    color: var(--tecp-pop-text-faint);
}

/* --- size buttons --- */
.tecp-filter-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tecp-filter-size {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--tecp-pop-text-muted);
    background: var(--tecp-pop-surface);
    border: 1px solid var(--tecp-pop-surface-border);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.tecp-filter-size:hover {
    background: var(--tecp-pop-surface-hover);
    color: var(--tecp-pop-text);
}
.tecp-filter-size.active {
    background: var(--tecp-pop-surface-active);
    color: var(--tecp-pop-primary-text);
    border-color: transparent;
}

/* --- colour circles --- */
.tecp-filter-colours {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tecp-filter-colour {
    border-radius: 50%;
    border: 1px solid var(--tecp-pop-control-border);
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
    -webkit-appearance: none;
    appearance: none;
    background-size: cover;
    background-position: center;
}
.tecp-filter-colour:hover { transform: scale(1.1); }
.tecp-filter-colour.active {
    box-shadow: 0 0 0 2px var(--tecp-pop-panel-bg), 0 0 0 3.5px var(--tecp-pop-text);
}

/* --- price --- */
.tecp-filter-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tecp-filter-currency {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    color: var(--tecp-pop-text-faint);
}
.tecp-filter-price-dash { color: var(--tecp-pop-text-faint); font-size: 12px; }
.tecp-filter-price-input {
    width: 72px;
    height: 36px;
    background: var(--tecp-pop-surface);
    border: 1px solid var(--tecp-pop-surface-border);
    padding: 0 10px;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    color: var(--tecp-pop-text);
    -webkit-appearance: none;
    appearance: none;
    -moz-appearance: textfield;
}
.tecp-filter-price-input::placeholder { color: var(--tecp-pop-text-faint); opacity: 1; }
.tecp-filter-price-input::-webkit-inner-spin-button,
.tecp-filter-price-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.tecp-filter-price-input:focus { outline: none; border-color: var(--tecp-pop-control-border); }

/* --- actions (bottom of drawer) --- */
.tecp-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}
.tecp-filter-apply {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--tecp-pop-primary-text);
    background: var(--tecp-pop-primary-bg);
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
}
.tecp-filter-apply:hover { background: var(--tecp-pop-primary-bg-hover); }
.tecp-filter-reset {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--tecp-pop-text-faint);
    text-decoration: none;
    text-align: center;
    display: block;
}
.tecp-filter-reset:hover { color: var(--tecp-pop-text-muted); }
