.filter-dropdown--countries {
    position: fixed;
    width: fit-content;
    overflow-y: auto;
    overflow-x: hidden;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--color-light-gray) #f5f5f5;
}

.filter-dropdown--countries[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-dropdown--countries::-webkit-scrollbar { width: 6px; }
.filter-dropdown--countries::-webkit-scrollbar-track { background: #f5f5f5; }
.filter-dropdown--countries::-webkit-scrollbar-thumb { background: var(--color-light-gray); border-radius: 3px; }
.filter-dropdown--countries::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ============================================
   NAGŁÓWEK: przycisk wszystkie kraje + wyszukiwarka
   ============================================ */

.country-dropdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    border-bottom: 1px solid #f0f0f0;
}

.country-dropdown-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 8px 16px;
    border: 1.5px solid var(--color-light-gray);
    border-radius: 20px;
    font-family: var(--font-condensed);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-secondary);
    text-decoration: none;
    background: white;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.country-dropdown-all-link:hover:not(.is-current) {
    background: #f8f8f8;
}

.country-dropdown-all-link.is-current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    font-weight: 600;
}

.country-search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--color-light-gray);
    border-radius: 20px;
    background: white;
    transition: border-color 0.2s ease;
    min-width: 0;
}

.country-search-wrap:focus-within {
    background: #f8f8f8;
}

.country-search-icon {
    flex-shrink: 0;
    margin-left: 12px;
    color: #aaa;
    pointer-events: none;
}

.country-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-condensed);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-secondary);
    padding: 8px 8px 8px 8px;
    min-width: 0;
}

.country-search-input::placeholder {
    color: #bbb;
    font-weight: 400;
}

.country-search-clear:not([hidden]) {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #aaa;
    border-radius: 50%;
    transition: color 0.15s ease, background 0.15s ease;
}

.country-search-clear:hover {
    color: var(--color-secondary);
    background: #f0f0f0;
}

/* ============================================
   KOMUNIKAT BRAKU WYNIKÓW
   ============================================ */

.country-search-empty {
    padding: 16px 14px;
    font-family: var(--font-condensed);
    font-size: 14px;
    color: var(--color-secondary);
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

/* ============================================
   KONTYNENTY I SUBREGIONY
   ============================================ */

.country-continent-row:not([hidden]) {
    display: flex;
    border-top: 1px solid #f0f0f0;
}

.country-continent-row:first-of-type {
    border-top: none;
}

.country-subregion-block:not([hidden]) {
    display: block;
}

.country-continent-label {
    flex-shrink: 0;
    width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.country-continent-label.odd  { background: var(--color-primary-dark); }
.country-continent-label.even { background: var(--color-secondary-dark); }

.country-continent-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-condensed);
    font-size: 10px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.country-subregions-col {
    flex: 1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.country-subregion-title {
    font-family: var(--font-condensed);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}

.country-chips-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

/* ============================================
   CHIPY KRAJÓW
   ============================================ */

.country-chip:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1.5px solid var(--color-light-gray);
    border-radius: 20px;
    font-family: var(--font-condensed);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-secondary);
    text-decoration: none;
    background: white;
    overflow: hidden;
    min-width: 0;
    transition: background 0.2s ease;
}

.country-chip:hover:not(.is-disabled):not(.is-current) {
    background: #f8f8f8;
}

.country-chip.is-current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    font-weight: 600;
}

.country-chip.is-current .chip-count {
    color: white;
    background: var(--color-primary-dark);
}

.country-chip.is-disabled {
    color: #cccccc;
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.chip-flag {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.chip-flag--placeholder {
    border: 1.5px solid var(--color-light-gray);
    background: #f5f5f5;
    display: inline-block;
}

.chip-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.chip-count {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 500;
    color: #999;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 2px 6px;
    line-height: 1.4;
}

/* ============================================
   RWD — < 900px: full-width, 4 kolumny
   ============================================ */

@media (max-width: 899px) {
    .country-chips-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .filter-dropdown--countries {
        min-width: 0;
        max-width: 100%;
    }
}

/* ============================================
   RWD — < 768px: full-width, 3 kolumny
   ============================================ */

@media (max-width: 767px) {
    .country-chips-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   RWD — < 570px: nagłówek pionowo, 2 kolumny
   ============================================ */

@media (max-width: 569px) {
    .country-dropdown-header {
        flex-direction: column;
        align-items: stretch;
    }

    .country-dropdown-all-link {
        width: 100%;
    }

    .country-chips-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .country-continent-label {
        width: 26px;
    }

    .country-continent-text {
        font-size: 9px;
        letter-spacing: 1px;
    }

    .country-chip {
        font-size: 14px;
        padding: 5px 7px;
    }

    .country-subregion-title {
        font-size: 9px;
    }
}

/* ============================================
   RWD — < 425px: 1 kolumna
   ============================================ */

@media (max-width: 424px) {
    .country-chips-grid {
        grid-template-columns: 1fr;
    }
}