/**
 * Search Section Dropdown Styles  
 * Version 4.0.1 - Fixed z-index to not interfere with theme header
 * Z-Index: Search dropdown (900) must be lower than theme header menu (10000)
 */

/* Dropdown Container */
.bfhd_s_dropdown {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Fix Z-Index Conflict: Active dropdown must be higher than siblings */
.bfhd_s_dropdown.is-open {
    z-index: 100;
}

/* CRITICAL: Parent group must also pop up to overlap adjacent groups */
.bfhd_s_select_group.is-active-group {
    z-index: 100 !important;
}

/* Dropdown Button */
.bfhd_s_dropdown_btn {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0 32px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--color-text-gray);
    position: relative;
    outline: none;
}

/* Button Value */
.bfhd_s_dropdown_value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
    font-weight: 400;
    color: var(--color-text-gray);
}

/* Dropdown Arrow */
.bfhd_s_dropdown_arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    color: var(--color-text-gray);
}

.bfhd_s_dropdown.is-open .bfhd_s_dropdown_arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Dropdown Menu - ONLY applies to search dropdowns */
.bfhd_s_select_group .bfhd_s_dropdown_menu,
.bfhd_s_dropdown .bfhd_s_dropdown_menu {
    position: absolute !important;
    top: calc(100% + 12px) !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding: 8px !important;
    display: none !important;
    z-index: 900 !important;
    max-height: 320px !important;
    overflow-y: auto !important;
    min-width: 220px !important;
}

/* Open State */
.bfhd_s_dropdown.is-open .bfhd_s_dropdown_menu {
    display: block !important;
}

/* Dropdown Items */
.bfhd_s_dropdown_item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.bfhd_s_dropdown_item:hover {
    background: #F7FAFC !important;
}

.bfhd_s_dropdown_item.is-selected {
    background: #E6F9F5 !important;
}

/* Checkbox */
.bfhd_s_checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #CBD5E0;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bfhd_s_dropdown_item.is-selected .bfhd_s_checkbox {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.bfhd_s_dropdown_item.is-selected .bfhd_s_checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Label - 14 char truncation - RENAMED to avoid conflict */
.bfhd_s_dropdown_label {
    flex: 1;
    min-width: 0;
    max-width: 20ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    color: var(--color-text-dark);
}

/* Count - Right Aligned */
.bfhd_s_count {
    margin-left: auto !important;
    background: #EDF2F7;
    color: #718096;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Ensure parents don't clip */
.bfhd_s_select_group {
    position: relative !important;
    overflow: visible !important;
    z-index: 1 !important;
}

.bfhd_s_pill {
    overflow: visible !important;
    position: relative !important;
}

/* Green counter */
.bfhd-hero-subtitle .bfhd-counter {
    color: var(--color-primary) !important;
    font-weight: 700;
}