/* WC Attribute Filter Shortcode */

.wcaf-wrapper { width: 100%; margin-bottom: 20px; }

/* ── Filter bar ─────────────────────────────────── */
.wcaf-filter-bar {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}
.wcaf-filter-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1 1 auto;
    align-items: flex-end;
}
.wcaf-filter-field {
    display: flex;
    flex-direction: column;
    min-width: 160px;
    flex: 1 1 160px;
    max-width: 280px;
    position: relative;    /* anchor for dropdown list */
}
.wcaf-filter-field.wcaf-field-multi {
    max-width: 340px;
    flex: 2 1 200px;
}
.wcaf-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #333;
    margin-bottom: 5px;
}

/* ── Hide native select ─────────────────────────── */
.wcaf-wrapper .wcaf-select { display: none !important; }

/* ── Dropdown container ─────────────────────────── */
.wcaf-dropdown { position: relative; width: 100%; }

/* ── Trigger button ─────────────────────────────── */
.wcaf-dd-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid #c8c8c8;
    border-radius: 5px;
    padding: 6px 10px;
    min-height: 40px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    width: 100%;
    user-select: none;
}
.wcaf-dropdown.open .wcaf-dd-btn,
.wcaf-dd-btn:hover {
    border-color: #96003b;
    box-shadow: 0 0 0 2px rgba(150,0,59,.1);
}

/* Placeholder text */
.wcaf-dd-ph {
    flex: 1;
    font-size: 13px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Selected value (single) */
.wcaf-dd-val {
    flex: 1;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Clear × (single) */
.wcaf-dd-x {
    font-size: 18px;
    color: #bbb;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s;
}
.wcaf-dd-x:hover { color: #96003b; }

/* Arrow */
.wcaf-dd-arrow {
    font-size: 10px;
    color: #888;
    flex-shrink: 0;
    transition: transform .2s;
    pointer-events: none;
}
.wcaf-dropdown.open .wcaf-dd-arrow { transform: rotate(180deg); }

/* Tag pills area (multi) */
.wcaf-dd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    align-items: center;
}

/* ── Dropdown list ──────────────────────────────── */
.wcaf-dd-list {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #c8c8c8;
    border-radius: 5px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 260px;
    overflow-y: auto;
    z-index: 99999;
    box-sizing: border-box;
}
.wcaf-dropdown.open .wcaf-dd-list { display: block; }

/* ── Option items ───────────────────────────────── */
.wcaf-dd-opt {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    list-style: none;
    transition: background .1s;
    user-select: none;
}
.wcaf-dd-opt:hover                        { background: #faf0f4; }
.wcaf-dd-opt.wcaf-selected                { background: #f5e8ed; font-weight: 500; }
.wcaf-dd-opt.wcaf-selected:hover          { background: #eedce4; }
.wcaf-dd-opt-all                          { color: #888; font-style: italic; }
.wcaf-dd-opt-all.wcaf-selected            { background: transparent; font-weight: 400; }

/* Checkbox for multi */
.wcaf-dd-chk {
    width: 16px; height: 16px;
    border: 2px solid #ccc;
    border-radius: 3px;
    flex-shrink: 0;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
    pointer-events: none;
}
.wcaf-dd-opt.wcaf-selected .wcaf-dd-chk {
    background: #96003b;
    border-color: #96003b;
}
.wcaf-dd-opt.wcaf-selected .wcaf-dd-chk::after {
    content: '✓';
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
}

/* ── Tag pills ──────────────────────────────────── */
.wcaf-tag {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #bbb;
    border-radius: 20px;
    padding: 2px 6px 2px 9px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    gap: 4px;
    white-space: nowrap;
    max-width: 160px;
}
.wcaf-tag > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}
.wcaf-tag-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px; height: 17px;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
    line-height: 1;
}
.wcaf-tag-x:hover { background: #96003b; }

/* ── Reset button ───────────────────────────────── */
.wcaf-filter-actions { display: flex; align-items: flex-end; flex-shrink: 0; }
.wcaf-reset-btn {
    padding: 0 22px;
    height: 40px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #96003b;
    background: #96003b;
    color: #fff;
    transition: background .15s;
    white-space: nowrap;
    line-height: 1;
}
.wcaf-reset-btn:hover { background: #7a0030; border-color: #7a0030; }

/* ── Sort bar ───────────────────────────────────── */
.wcaf-sort-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.wcaf-sort-select {
    appearance: none; -webkit-appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1.5px solid #c8c8c8;
    border-radius: 5px;
    color: #333;
    cursor: pointer;
    font-size: 13px;
    height: 40px;
    padding: 0 36px 0 12px;
    min-width: 200px;
    max-width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}
.wcaf-sort-select:hover,
.wcaf-sort-select:focus { border-color: #96003b; outline: none; }

/* ── Result count ───────────────────────────────── */
.wcaf-result-count { font-size: 13px; color: #777; margin-bottom: 10px; }

/* ── Loading ────────────────────────────────────── */
.wcaf-loading-overlay { text-align: center; padding: 12px 0; }
.wcaf-spinner {
    display: inline-block;
    width: 28px; height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: #96003b;
    border-radius: 50%;
    animation: wcaf-spin .6s linear infinite;
    vertical-align: middle;
}
@keyframes wcaf-spin { to { transform: rotate(360deg); } }

/* ── Products ───────────────────────────────────── */
.wcaf-products-wrapper { min-height: 80px; }
.wcaf-no-products { text-align: center; padding: 40px 20px; color: #888; font-size: 15px; }

/* ── Pagination ─────────────────────────────────── */
.wcaf-pagination { margin-top: 20px; text-align: center; }
.wcaf-pagination .woocommerce-pagination ul.page-numbers {
    list-style: none; margin: 0; padding: 0;
    display: inline-flex; flex-wrap: wrap; gap: 4px;
}
.wcaf-pagination .woocommerce-pagination ul.page-numbers li { list-style: none; }
.wcaf-pagination a.page-numbers,
.wcaf-pagination span.page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 10px;
    border: 1px solid #ddd; border-radius: 4px;
    font-size: 13px; text-decoration: none; color: #333; background: #fff;
    transition: background .15s, color .15s, border-color .15s; cursor: pointer;
}
.wcaf-products-container ul.products li.product a.button {
    color: #FFFFFF;
    background-color: var(--e-global-color-915d123);
    transition: all 0.25s ease;
}

#wcaf-1 .wcaf-pagination span.page-numbers.current
 {
    background: var(--e-global-color-915d123);
    border-color: var(--e-global-color-915d123);
    color: #fff;
}

#wcaf-1 .wcaf-pagination a.page-numbers:hover {
    background:  var(--e-global-color-915d123);
    border-color:  var(--e-global-color-915d123);
    color: #fff;
}

.wcaf-pagination span.page-numbers.dots { border: none; background: transparent; color: #aaa; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
    .wcaf-filter-bar      { flex-direction: column; align-items: stretch; }
    .wcaf-filter-fields   { flex-direction: column; }
    .wcaf-filter-field,
    .wcaf-filter-field.wcaf-field-multi { max-width: 100%; min-width: 0; flex: none; }
    .wcaf-filter-actions  { justify-content: stretch; }
    .wcaf-reset-btn       { width: 100%; text-align: center; }
}
