.dropdown-scroll-anchor {
    scroll-margin-top: var(--dropdown-scroll-offset, 88px);
}

@media (max-width: 768px) {
    .dropdown-scroll-anchor {
        scroll-margin-top: var(--dropdown-scroll-offset-mobile, 88px);
    }
}

/* Float above content-scroller so overflow:auto does not clip the menu */
.status-dropdown .dropdown-menu.dropdown-menu-floating {
    position: fixed;
    z-index: 1090;
    display: block;
    margin: 0;
    right: auto;
}

.status-dropdown.zone-dropdown .dropdown-menu,
.status-dropdown.modern-country-dropdown .dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.status-dropdown.zone-dropdown .dropdown-menu li.zone-search-row,
.status-dropdown.modern-country-dropdown .dropdown-menu li.country-search-row {
    padding: 8px 12px;
    cursor: default;
    border-bottom: 1px solid #e2e8f0;
}

.status-dropdown.zone-dropdown .dropdown-menu li.zone-search-row:hover,
.status-dropdown.modern-country-dropdown .dropdown-menu li.country-search-row:hover {
    background: transparent;
    color: inherit;
}

.status-dropdown.zone-dropdown .dropdown-menu .zone-search-input,
.status-dropdown.modern-country-dropdown .dropdown-menu .country-search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 0.5px solid #d4d4d4;
    border-radius: 5px;
    font-family: "Open Sans", sans-serif;
    background: transparent;
}

.status-dropdown.zone-dropdown .dropdown-menu .zone-search-input::placeholder,
.status-dropdown.modern-country-dropdown .dropdown-menu .country-search-input::placeholder {
    color: #8390a2;
}

.status-dropdown.zone-dropdown .dropdown-menu .zone-search-input:focus,
.status-dropdown.modern-country-dropdown .dropdown-menu .country-search-input:focus {
    border-color: #8d193c;
    box-shadow: none !important;
    outline: none !important;
    background: transparent;
}

.status-dropdown.zone-dropdown .dropdown-menu::-webkit-scrollbar,
.status-dropdown.modern-country-dropdown .dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.status-dropdown.zone-dropdown .dropdown-menu::-webkit-scrollbar-track,
.status-dropdown.modern-country-dropdown .dropdown-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.status-dropdown.zone-dropdown .dropdown-menu::-webkit-scrollbar-thumb,
.status-dropdown.modern-country-dropdown .dropdown-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.status-dropdown.zone-dropdown .dropdown-menu::-webkit-scrollbar-thumb:hover,
.status-dropdown.modern-country-dropdown .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Portaled to document.body (modals use transform, which breaks position:fixed inside them) */
ul.dropdown-menu.checkout-floating-menu-portal {
    position: fixed;
    z-index: 1090;
    display: block;
    margin: 0;
    right: auto;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

ul.dropdown-menu.checkout-floating-menu-portal li.zone-search-row,
ul.dropdown-menu.checkout-floating-menu-portal li.country-search-row {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 16px 12px 8px;
    cursor: default;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    pointer-events: auto;
}

ul.dropdown-menu.checkout-floating-menu-portal li.zone-search-row:hover,
ul.dropdown-menu.checkout-floating-menu-portal li.country-search-row:hover {
    background: #fff;
    color: inherit;
}

ul.dropdown-menu.checkout-floating-menu-portal .zone-search-input,
ul.dropdown-menu.checkout-floating-menu-portal .country-search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 0.5px solid #d4d4d4;
    border-radius: 5px;
    font-family: "Open Sans", sans-serif;
    background: #fff;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-user-select: text;
    user-select: text;
}

/* Zone dropdown trigger — same design on main checkout and inside shipping modals */
.status-dropdown.zone-dropdown {
    position: relative;
    width: 100%;
}

.status-dropdown.zone-dropdown .dropdown-btn {
    width: 100%;
    height: 52px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0px 1px 2px rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    color: #364153;
    font-family: "Open Sans", sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.005em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    outline: 0;
    -webkit-appearance: none;
    appearance: none;
}

.add-shipping-modal .status-dropdown.zone-dropdown .dropdown-btn,
.modal .status-dropdown.zone-dropdown .dropdown-btn {
    width: 100%;
    height: 52px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0px 1px 2px rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    color: #364153;
}

.status-dropdown.zone-dropdown .dropdown-btn:hover {
    border-color: #94a3b8;
}

.status-dropdown.zone-dropdown .dropdown-btn:focus,
.status-dropdown.zone-dropdown .dropdown-btn:focus-visible,
.status-dropdown.zone-dropdown .dropdown-btn.active,
.status-dropdown.modern-country-dropdown .dropdown-btn:focus,
.status-dropdown.modern-country-dropdown .dropdown-btn:focus-visible,
.status-dropdown.modern-country-dropdown .dropdown-btn.active {
    outline: 0;
    border-color: var(--themeColor, #8d193c);
    box-shadow: 0 0 0 3px rgba(162, 27, 71, 0.12);
}

.status-dropdown.zone-dropdown .dropdown-btn .selected {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.status-dropdown.zone-dropdown .dropdown-btn .selected-text {
    flex: 1;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "Open Sans", sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #364153;
}

html[dir="rtl"] .status-dropdown.zone-dropdown .dropdown-btn .selected-text {
    text-align: right;
}

.status-dropdown.zone-dropdown .dropdown-btn .arrow {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 8px;
    background-image: url("../images/cheveron-bottom.svg");
    background-repeat: no-repeat;
    background-size: 1.25rem;
    background-position: center;
    transition: transform 0.2s ease-in-out;
}

html[dir="rtl"] .status-dropdown.zone-dropdown .dropdown-btn .arrow {
    margin-left: 0;
    margin-right: 8px;
}

.status-dropdown.zone-dropdown .dropdown-btn.active .arrow,
.status-dropdown.zone-dropdown.open .arrow {
    transform: rotate(180deg);
}

/* Zone menu list — main page and portaled (modal) */
.status-dropdown.zone-dropdown .dropdown-menu,
ul.dropdown-menu.checkout-floating-menu-portal {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    padding: 0 0 8px;
    list-style: none;
}

.status-dropdown.zone-dropdown .dropdown-menu li[data-zone-value],
ul.dropdown-menu.checkout-floating-menu-portal li[data-zone-value] {
    padding: 12px 18px;
    font-size: 14px;
    font-family: "Open Sans", sans-serif;
    color: #364153;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.status-dropdown.zone-dropdown .dropdown-menu li[data-zone-value]:hover,
ul.dropdown-menu.checkout-floating-menu-portal li[data-zone-value]:hover {
    background: #8e1b3e;
    color: #ffffff;
}

.status-dropdown.zone-dropdown .dropdown-menu li.loading-countries,
.status-dropdown.zone-dropdown .dropdown-menu li.error-countries,
ul.dropdown-menu.checkout-floating-menu-portal li.loading-countries,
ul.dropdown-menu.checkout-floating-menu-portal li.error-countries {
    color: #64748b;
    font-style: italic;
    cursor: default;
}

.status-dropdown.zone-dropdown .dropdown-menu li.loading-countries:hover,
.status-dropdown.zone-dropdown .dropdown-menu li.error-countries:hover,
ul.dropdown-menu.checkout-floating-menu-portal li.loading-countries:hover,
ul.dropdown-menu.checkout-floating-menu-portal li.error-countries:hover {
    background: transparent;
    color: #64748b;
}
