/**
 * Modern Homepage Styles for BFHD Pro
.bfhd-modern-homepage * {
    box-sizing: border-box;
}

/* Global Styles Removed - Inherited from bfhd-theme.css */


/* ================================
   SEARCH SECTION - White Background
   ================================ */

.bfhd_s_section {
    padding: 30px 0 70px;
    background: #FFFFFF;
}

.bfhd-search-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Main Wrapper - Outer Gray Pill */
.bfhd_s_wrapper {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    width: auto;
    max-width: 100%;
    background: #F3F5F7;
    /* Very Light Gray */
    padding: 10px 14px 10px 28px;
    border-radius: 80px;
    /* Larger Radius */
    box-shadow: none;
    /* Flat look as per image */
    margin: 0 auto;
}

/* Label "Search" */
.bfhd_s_label {
    font-size: 20px;
    font-weight: 700;
    color: #5B8FE5;
    white-space: nowrap;
    margin-right: 4px;
    max-width: 6ch;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Inner White Pill (Form Container) */
.bfhd_s_pill {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    padding: 6px 6px 6px 12px;
    border-radius: 60px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    flex: 1;
    min-width: 0;
    /* Let it shrink if needed, but flex handles sharing */
}

/* Input Group */
.bfhd_s_input_group {
    flex: 2;
    padding-left: 16px;
    min-width: 250px;
}

.bfhd_s_input {
    width: 100%;
    border: none;
    padding: 12px 0;
    font-size: 15px;
    font-family: var(--font-family, sans-serif);
    color: #4B5563;
    /* Gray Text */
    background: transparent;
    outline: none;
}

.bfhd_s_input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

/* Separator - Visible now */
.bfhd_s_separator {
    display: block;
    width: 1px;
    height: 24px;
    background-color: #E5E7EB;
    margin: 0 16px;
}

/* Select/Dropdown Groups */
.bfhd_s_select_group {
    flex: 1;
    position: relative;
    min-width: 140px;
    border: none;
    margin: 0;
    padding: 0;
}

.bfhd_s_select {
    width: 100%;
    padding: 12px 24px 12px 8px;
    /* Less left padding */
    font-size: 14px;
    font-family: var(--font-family, sans-serif);
    color: #6B7280;
    border: none;
    background: transparent;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Search Button - Green Circle */
.bfhd_s_btn {
    width: 44px;
    /* Slightly smaller to fit nicely */
    height: 44px;
    background: #00E2C1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 12px;
}

.bfhd_s_btn:hover {
    background: #00C4A8;
    transform: scale(1.05);
}

.bfhd_s_btn svg {
    width: 22px;
    height: 22px;
    stroke: white;
    stroke-width: 2.5;
}

/* Advanced Search Button */
.bfhd_s_advanced {
    background: #E8EDF2;
    /* Cool Gray */
    color: #5B8FE5;
    /* Match Label Blue */
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 5px !important;
    display: inline-block;
}

.bfhd_s_advanced:hover {
    background: #DBEafe;
    color: #2563EB;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .bfhd_s_wrapper {
        flex-direction: column;
        border-radius: 24px;
        padding: 16px;
        width: 100%;
        background: #FFFFFF;
        box-shadow: none;
        gap: 16px;
    }

    .bfhd_s_label {
        display: none;
    }

    .bfhd_s_pill {
        flex-direction: column;
        width: 100%;
        background: #F3F4F6;
        border-radius: 16px;
        padding: 16px;
        min-width: 0;
        box-shadow: none;
    }

    .bfhd_s_input_group,
    .bfhd_s_select_group {
        width: 100%;
        border: none;
        margin: 0;
        padding: 0;
        border-bottom: 1px solid #E5E7EB;
        min-width: 0;
    }

    .bfhd_s_separator {
        display: none;
    }

    .bfhd_s_select_group {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .bfhd_s_input {
        text-align: left;
    }

    .bfhd_s_select {
        text-align: left;
        padding-left: 0;
        background-position: right 0 center;
    }

    .bfhd_s_btn {
        width: 100%;
        border-radius: 12px;
        margin: 12px 0 0 0;
    }

    .bfhd_s_advanced {
        margin-top: 0;
        width: 100%;
        text-align: center;
        background: #F3F4F6;
    }
}

/* Categories & Footer Styles Removed - Inherited from bfhd-theme.css */


/* Polish Search UI Overrides */
.bfhd-dropdown-trigger {
    background: transparent !important;
    border-radius: 30px;
    transition: background 0.2s ease, color 0.2s ease;
}

.bfhd-dropdown-trigger:hover {
    background: #F7FAFC !important;
    color: var(--color-text-dark);
}

.bfhd-dropdown-menu-select {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.bfhd-checkbox-item {
    border-radius: 8px;
    padding: 10px 12px;
}

.bfhd-checkbox-item:hover {
    background: #F0F4F8;
    color: var(--color-primary);
}

.bfhd-checkbox-item input[type='checkbox'] {
    width: 18px;
    height: 18px;
    border: 2px solid #CBD5E0;
    transition: border-color 0.2s;
}

.bfhd-checkbox-item input[type='checkbox']:checked {
    border-color: var(--color-primary);
}

/* Ultimate Fix for Dark Background v1.1.0 */
.bfhd-search-pill .bfhd-custom-dropdown .bfhd-dropdown-trigger {
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    color: var(--color-text-gray) !important;
}

.bfhd-search-pill .bfhd-custom-dropdown .bfhd-dropdown-trigger:hover {
    background-color: #F7FAFC !important;
    background: #F7FAFC !important;
    color: var(--color-text-dark) !important;
}

.bfhd-search-pill .bfhd-custom-dropdown .bfhd-dropdown-trigger span {
    background: transparent !important;
}

/* ==============================================
   CUSTOM DROPDOWN STYLES - VANILLA JS
   Version 3.0 - Professional WordPress implementation
   ============================================== */

/* Container */
.bfhd-dropdown {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Dropdown Button */
.bfhd-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-dark);
    position: relative;
    outline: none;
    transition: all 0.2s ease;
}

.bfhd-dropdown-btn:hover {
    color: var(--color-text-dark);
}

/* Button Value (shows selection or placeholder) */
.bfhd-dropdown-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
    font-weight: 400;
    color: var(--color-text-gray);
    /* Same color for all text */
}

.bfhd-dropdown-value.is-placeholder {
    color: var(--color-text-gray);
    /* Same as normal, not lighter */
}

/* Dropdown Arrow */
.bfhd-dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    color: var(--color-text-gray);
}

.bfhd-dropdown.is-open .bfhd-dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Dropdown Menu */
.bfhd-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 8px;
    display: none;
    /* Hidden by default */
    z-index: 10000 !important;
    /* Very high to ensure visibility */
}



/* Dropdown open state */
.bfhd-dropdown.is-open .bfhd-dropdown-menu {
    display: block;
}

/* Dropdown Items */
.bfhd-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.bfhd-dropdown-item:hover {
    background: #F7FAFC;
}

.bfhd-dropdown-item.is-selected {
    background: #E6F9F5;
}

/* Custom Checkbox */
.bfhd-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;
    transition: all 0.2s ease;
    position: relative;
}

.bfhd-dropdown-item.is-selected .bfhd-checkbox {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.bfhd-dropdown-item.is-selected .bfhd-checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
    display: block;
}

/* Label - STRICT 14 character truncation */
.bfhd-label {
    flex: 1;
    min-width: 0;
    max-width: 14ch;
    /* Exactly 14 characters */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    color: var(--color-text-dark);
    font-weight: 400;
}

/* Count Badge - RIGHT ALIGNED */
.bfhd-count {
    margin-left: auto !important;
    /* Force right alignment */
    background: #EDF2F7;
    color: #718096;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1;
}

/* Scrollbar Styling */
.bfhd-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.bfhd-dropdown-menu::-webkit-scrollbar-track {
    background: #F7FAFC;
    border-radius: 10px;
}

.bfhd-dropdown-menu::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 10px;
}

.bfhd-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #A0AEC0;
}

/* Green Counter for Business Listings */
.bfhd-hero-subtitle .bfhd-counter {
    color: var(--color-primary) !important;
    font-weight: 700;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .bfhd-label {
        max-width: 12ch !important;
    }

    .bfhd-dropdown-menu {
        max-width: 100%;
        left: -8px;
        right: -8px;
    }
}

/* Integration with Search Pill */
.bfhd_s_select_group .bfhd-dropdown {
    height: 100%;
}

.bfhd_s_pill .bfhd-dropdown-btn {
    padding: 0 32px 0 16px;
}


/* ==============================================
   CLEAN DROPDOWN FIXES - V2.0
   ============================================== */

/* 1. Hide default Choices.js tags (we use custom summary instead) */
.choices__inner .choices__list--multiple .choices__item,
.choices__inner .choices__list--single .choices__item {
    display: none !important;
}

/* 2. Custom Summary Element (shows "All Categories" or selection count) */
.bfhd_s_summary {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 16px;
    right: 40px;
    font-size: 15px;
    color: var(--color-text-dark);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 10;
    background: transparent;
    font-weight: 400;
}

.bfhd_s_summary.is-placeholder {
    color: #9CA3AF;
}

/* 3. Inner container adjustment */
.choices__inner {
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    background: transparent !important;
    border: none !important;
    padding: 0 16px !important;
    position: relative;
}

/* 4. Dropdown list styling */
.choices__list--dropdown {
    width: auto !important;
    min-width: 100%;
    max-width: 350px;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    margin-top: 8px !important;
    padding: 8px !important;
}

/* 5. Individual choice items in dropdown */
.choices__list--dropdown .choices__item {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px;
    width: 100% !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    position: relative;
}

.choices__list--dropdown .choices__item:hover {
    background: #F7FAFC !important;
}

/* 6. Selected state styling */
.choices__list--dropdown .choices__item.is-selected {
    background: #E6F9F5 !important;
}

.choices__list--dropdown .choices__item.is-selected .bfhd_s_checkbox {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.choices__list--dropdown .choices__item.is-selected .bfhd_s_checkbox::after {
    content: '✓';
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 7. Checkbox styling */
.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;
    transition: all 0.2s ease;
}

/* 8. Label text with STRICT 14-char truncation */
.bfhd_s_label_text {
    flex: 1;
    min-width: 0;
    max-width: 14ch !important;
    /* Exactly 14 characters */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    color: var(--color-text-dark);
    font-weight: 400;
}

/* 9. Country count badge - RIGHT ALIGNED */
.bfhd-country-count {
    margin-left: auto !important;
    /* Force to right */
    background: #EDF2F7;
    color: #718096;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1;
}

/* 10. Dropdown arrow icon */
.choices__list--dropdown .choices__item[data-choice-selectable]::before {
    display: none;
}

/* 11. Search input in dropdown */
.choices__input {
    background: #F7FAFC !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
    border: 1px solid #E2E8F0 !important;
}

/* 12. Scrollbar styling for dropdown */
.choices__list--dropdown::-webkit-scrollbar {
    width: 6px;
}

.choices__list--dropdown::-webkit-scrollbar-track {
    background: #F7FAFC;
    border-radius: 10px;
}

.choices__list--dropdown::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 10px;
}

.choices__list--dropdown::-webkit-scrollbar-thumb:hover {
    background: #A0AEC0;
}

/* 13. Green counter for Business listings */
.bfhd-hero-subtitle .bfhd-counter {
    color: var(--color-primary) !important;
    font-weight: 700;
}

/* 14. Responsive adjustments */
@media (max-width: 768px) {
    .bfhd_s_label_text {
        max-width: 12ch !important;
    }

    .choices__list--dropdown {
        max-width: 100%;
    }
}


/* ==============================================
   FIXES FOR DROPDOWNS & CATEGORIES
   ============================================== */

/* 1. Hide default choices tags in input to favor our custom Summary string */
.choices__inner .choices__list--multiple .choices__item,
.choices__inner .choices__list--single .choices__item {
    display: none !important;
}

/* 2. Style the Custom Summary (Placeholder/Value) */
.bfhd_s_summary {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 16px;
    right: 36px;
    font-size: 15px;
    color: var(--color-text-dark);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 5;
    background: transparent;
}

.bfhd_s_summary.is-placeholder {
    color: #9CA3AF;
    /* Placeholder gray */
}

/* 3. Adjust inner to hold space */
.choices__inner {
    min-height: 48px;
    display: flex;
    align-items: center;
    background: transparent !important;
    border: none !important;
    padding: 0 16px !important;
}

/* 4. Fix Choices Dropdown List Items */
.choices__list--dropdown .choices__item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px !important;
}

/* 5. Custom Label Styling - Truncation */
.bfhd_s_label_text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
    color: var(--color-text-dark);
}

/* 6. Enforce truncation width for countries per user request */
/* Target country specific dropdown if possible, or apply globally to this class */
.choices[data-type*="select-multiple"] .bfhd_s_label_text {
    /* "when the name of the country more than 15 characters, please make it shorter" */
    max-width: 15ch;
}

/* 7. Count Styling - Right Aligned */
.bfhd-country-count {
    margin-left: auto !important;
    background: #EDF2F7;
    color: #718096;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    display: inline-block;
    line-height: normal;
}

/* Polish Search UI Overrides */
.bfhd-dropdown-trigger {
    background: transparent !important;
    border-radius: 30px;
    transition: background 0.2s ease, color 0.2s ease;
}

.bfhd-dropdown-trigger:hover {
    background: #F7FAFC !important;
    color: var(--color-text-dark);
}

.bfhd-dropdown-menu-select {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.bfhd-checkbox-item {
    border-radius: 8px;
    padding: 10px 12px;
}

.bfhd-checkbox-item:hover {
    background: #F0F4F8;
    color: var(--color-primary);
}

.bfhd-checkbox-item input[type='checkbox'] {
    width: 18px;
    height: 18px;
    border: 2px solid #CBD5E0;
    transition: border-color 0.2s;
}

.bfhd-checkbox-item input[type='checkbox']:checked {
    border-color: var(--color-primary);
}

/* Ultimate Fix for Dark Background v1.1.0 */
.bfhd-search-pill .bfhd-custom-dropdown .bfhd-dropdown-trigger {
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    color: var(--color-text-gray) !important;
}

.bfhd-search-pill .bfhd-custom-dropdown .bfhd-dropdown-trigger:hover {
    background-color: #F7FAFC !important;
    background: #F7FAFC !important;
    color: var(--color-text-dark) !important;
}

.bfhd-search-pill .bfhd-custom-dropdown .bfhd-dropdown-trigger span {
    background: transparent !important;
}

/* ==============================================
   FIXES FOR DROPDOWNS & CATEGORIES
   ============================================== */

/* 1. Hide default choices tags in input to favor our custom Summary string */
.choices__inner .choices__list--multiple .choices__item,
.choices__inner .choices__list--single .choices__item {
    display: none !important;
}

/* 2. Style the Custom Summary (Placeholder/Value) */
.bfhd_s_summary {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 16px;
    right: 36px;
    font-size: 15px;
    color: var(--color-text-dark);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 5;
    background: transparent;
}

.bfhd_s_summary.is-placeholder {
    color: #9CA3AF;
    /* Placeholder gray */
}

/* 3. Adjust inner to hold space */
.choices__inner {
    min-height: 48px;
    display: flex;
    align-items: center;
    background: transparent !important;
    border: none !important;
    padding: 0 16px !important;
}

/* 4. Fix Choices Dropdown List Items */
.choices__list--dropdown .choices__item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px !important;
}

/* 5. Custom Label Styling - Truncation */
.bfhd_s_label_text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
    color: var(--color-text-dark);
}

/* 6. Enforce truncation width for countries per user request */
/* Target country specific dropdown if possible, or apply globally to this class */
.choices[data-type*="select-multiple"] .bfhd_s_label_text {
    /* "when the name of the country more than 15 characters, please make it shorter" */
    max-width: 15ch;
}

/* 7. Count Styling - Right Aligned */
.bfhd-country-count {
    margin-left: auto !important;
    background: #EDF2F7;
    color: #718096;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    display: inline-block;
    line-height: normal;
}

/* 8. Fix dropdown Z-indexes and overflows */
.choices__list--dropdown {
    width: auto !important;
    min-width: 100%;
    max-width: 300px;
    word-break: break-word;
}

/* 9. Search Counter Green Color */
.bfhd-hero-subtitle .bfhd-counter {
    color: var(--color-primary);
    font-weight: 700;
}