/* ============================================================
   Lunneys Filter Sidebar — Enhanced Styles
   ============================================================ */

/* Sidebar sticky positioning — desktop only */
.sidebar-main {
    /* no positioning by default — mobile is normal flow */
}

@media (min-width: 768px) {
    .sidebar-main {
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

/* Block container */
.block.filter {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    position: relative;
    z-index: 1;
}

/* "Shop By" title bar */
.block-title.filter-title {
    padding: 14px 16px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.block-title.filter-title strong {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #888;
}
.filter-clear-all {
    font-size: 11px;
    color: #C8102E;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}
.filter-clear-all:hover {
    text-decoration: underline;
}

/* Active filter chips bar */
.lunneys-active-filters {
    padding: 10px 16px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 42px;
}
.lunneys-active-filters .af-label {
    font-size: 11px;
    color: #999;
}
.lunneys-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    background: #fdf0f2;
    color: #C8102E;
    border: 1px solid #f5c0c8;
    border-radius: 20px;
    padding: 3px 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.lunneys-filter-chip:hover {
    background: #f9d5da;
}
.lunneys-filter-chip .chip-x {
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
}

/* Section headers (filter group titles) */
.filter-options-title {
    padding: 12px 16px !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1c1c1c !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8e8e8;
    border-top: none !important;
    background: #fff;
    user-select: none;
    list-style: none;
}
.filter-options-title:hover {
    background: #fafafa;
}
.filter-options-title .lunneys-chevron {
    font-size: 12px;
    color: #aaa;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.filter-options-title.collapsed .lunneys-chevron {
    transform: rotate(-90deg);
}

/* Section content */
.filter-options-content {
    background: #fff;
    padding: 12px 16px 16px !important;
    margin: 0 !important;
    border-bottom: 1px solid #e8e8e8;
    max-height: 800px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.2s ease;
}
.filter-options-content:last-child {
    border-bottom: none;
}
.filter-options-content.is-collapsed {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none;
}

/* Default filter item links */
.filter-options-content .items {
    list-style: none;
    padding: 0;
    margin: 0;
}
.filter-options-content .items .item {
    padding: 4px 0;
}
.filter-options-content .items .item a {
    font-size: 13px;
    color: #444;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.filter-options-content .items .item a:hover {
    color: #C8102E;
}
.filter-options-content .items .item .count {
    color: #aaa;
    font-size: 11px;
}
.filter-options-content .items .item .filter-count-label {
    display: none;
}

/* ---- Colour swatches ---- */
.lunneys-colour-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 0;
}
.lunneys-swatch-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.lunneys-swatch-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: block;
    border: 2px solid rgba(0,0,0,0.08);
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: outline 0.15s;
}
.lunneys-swatch-btn.active .lunneys-swatch-dot {
    outline-color: #C8102E;
}
.lunneys-swatch-count {
    font-size: 10px;
    color: #aaa;
}

/* ---- Pill buttons (sizes, speeds) ---- */
.lunneys-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 0;
}
.lunneys-pill {
    font-size: 12px;
    padding: 5px 11px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background: #f5f5f5;
    cursor: pointer;
    color: #444;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.lunneys-pill:hover {
    border-color: #C8102E;
    color: #C8102E;
}
.lunneys-pill.active {
    background: #fdf0f2;
    border-color: #C8102E;
    color: #C8102E;
    font-weight: 500;
}
.lunneys-pill .pill-count {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

/* ---- Brand checkboxes ---- */
.lunneys-brand-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.lunneys-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.lunneys-brand-row:last-child,
.lunneys-brand-row:nth-last-child(2) {
    border-bottom: none;
}
.lunneys-brand-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
}
.lunneys-brand-row input[type="checkbox"] {
    accent-color: #C8102E;
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.lunneys-brand-count {
    font-size: 11px;
    color: #aaa;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 1px 7px;
    white-space: nowrap;
}

/* Show more toggle */
.lunneys-show-more {
    font-size: 12px;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0 0;
    font-family: inherit;
    display: block;
}
.lunneys-show-more:hover {
    color: #C8102E;
}

/* Hide Compare Products and Wish List blocks from sidebar */
.block.block-compare,
.block.block-wishlist {
    display: none;
}

/* Hide "Shopping Options" subheading */
.filter-subtitle {
    display: none;
}

/* Hide Magento's default active filters section (replaced by chips) */
.filter-current {
    display: none;
}

/* ---- Mobile overrides ---- */
@media (max-width: 767px) {
    .block.filter {
        border-left: none;
        border-right: none;
        border-radius: 0;
        margin: 0 -15px;
    }

    .lunneys-swatch-dot {
        width: 24px;
        height: 24px;
    }

    .lunneys-pill {
        padding: 7px 12px;
        font-size: 13px;
    }

    .lunneys-brand-row {
        padding: 10px 0;
    }
}
