
/* ==================== Country Selector Wrapper ==================== */
.verta-country-selector-wrapper {
    display: inline-block;
    left: 0;
    z-index: 100;
}

[dir="rtl"] .verta-country-selector-wrapper {
    left: auto;
    right: 0;
}




/* ==================== Country Flag ==================== */
.verta-country-flag {
    font-size: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.verta-country-flag img {
    width: 20px !important;
    height: auto;
    border-radius: 50%;
}

/* ==================== Country Code Display ==================== */
.verta-country-code {
    direction: ltr;
}


/* ==================== Dropdown Arrow ==================== */
.verta-dropdown-arrow {
    font-size: 10px;
    color: var(--verta-text-secondary);
    transition: transform 0.2s ease;
    margin-left: auto;
    line-height: 1;
}

[dir="rtl"] .verta-dropdown-arrow {
    margin-left: 0;
    margin-right: auto;
}

[dir="ltr"] .verta-dropdown-arrow {
    margin-left: 0;
    margin-right: auto;
}

.verta-country-dropdown.active ~ .verta-country-checkout-selector .verta-dropdown-arrow {
    transform: rotate(180deg);
}


/* ==================== Country Dropdown Menu ==================== */
.verta-country-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    min-width: 250px;
    max-height: 300px;
    background: var(--verta-bg);
    border: 2px solid var(--verta-border);
    border-radius: var(--verta-input-border-radius);
    box-shadow: 0 10px 25px -5px var(--verta-shadow-lg);
    z-index: 99999;
    display: none;
    flex-direction: column;
    animation: vertaDropdownSlide 0.2s ease;
}



[dir="ltr"] .verta-country-dropdown {
    left: auto;
    right: 0;
}

[dir="rtl"] .verta-country-dropdown {
    right: auto;
    left: 0;
}

@keyframes vertaDropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.verta-country-dropdown.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 768px) {
    .verta-country-dropdown {
        min-width: 230px;
        max-width: calc(100vw - 40px);
    }
}


/* ==================== Country Search Input ==================== */
.verta-country-search {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 5% !important;
    border: none !important;
    border-bottom: 2px solid var(--verta-border) !important;
    background: var(--verta-bg-secondary);
    border-radius: var(--verta-input-border-radius) var(--verta-input-border-radius) 0 0 !important;
    color: var(--verta-text) !important;
    font-size: 14px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    direction: rtl !important;
}

.verta-country-search:focus {
    background: var(--verta-bg);
    border-bottom-color: var(--verta-primary);
}

.verta-country-search::placeholder {
    color: var(--verta-text-secondary);
}


/* ==================== Country List Container ==================== */
.verta-country-list {
    flex: 1;
    overflow-y: auto;
    max-height: 250px;
}


/* ==================== Country Section ==================== */
.verta-country-section {
    margin: 0;
}

.verta-section-title {
    position: sticky;
    top: 0;
    padding: 10px 16px;
    background: var(--verta-bg-secondary);
    font-size: 11px;
    font-weight: 600;
    color: var(--verta-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}


/* ==================== Country Option Item ==================== */
.verta-country-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 5%;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
}

.verta-country-option:hover {
    background: var(--verta-bg-secondary);
}

.verta-country-option .verta-country-flag {
    flex-shrink: 0;
}

.verta-country-option .verta-country-name {
    flex: 1;
    font-size: 14px;
    color: var(--verta-text);
}

.verta-country-option .verta-country-code {
    font-size: 13px;
    direction: ltr;
    color: var(--verta-text-secondary);
}


/* ==================== Custom Scrollbar ==================== */
.verta-country-list::-webkit-scrollbar {
    width: 6px;
}

.verta-country-list::-webkit-scrollbar-track {
    background: var(--verta-bg-secondary);
}

.verta-country-list::-webkit-scrollbar-thumb {
    background: var(--verta-border);
    border-radius: 3px;
}

.verta-country-list::-webkit-scrollbar-thumb:hover {
    background: var(--verta-text-secondary);
}


/* ==================== Fixed Country Code Display (غیرفعال بودن انتخاب) ==================== */
.verta-country-code-display {
    position: absolute;
    display: flex;
    align-items: center;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
}

[dir="rtl"] .verta-country-code-display {
    left: auto;
    right: 0;
}

.verta-fixed-country-input {
    width: 80px !important;
    text-align: center;
    cursor: not-allowed;
    direction: ltr;
    background: var(--verta-bg-secondary);
    border: 1px solid var(--verta-border);
    border-radius: var(--verta-radius-sm);
    padding: 12px 8px;
    font-weight: 500;
}


/* ==================== Readonly Mode ==================== */
.verta-readonly-mode input,
.verta-country-checkout-selector.verta-readonly {
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    pointer-events: none !important;
}


/* ==================== Dark Mode Support ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --verta-text: #f9fafb;
        --verta-text-secondary: #9ca3af;
        --verta-border: #374151;
        --verta-bg: #1f2937;
        --verta-bg-secondary: #111827;
    }
}


/* ==================== Focus Styles (برای Accessibility) ==================== */
.verta-country-checkout-selector:focus-visible {
    outline: 2px solid var(--verta-primary);
    outline-offset: 2px;
}

.verta-country-option:focus-visible {
    background: var(--verta-bg-secondary);
    outline: 2px solid var(--verta-primary);
    outline-offset: -2px;
}

/* حذف outline برای موس، نگه‌داشتن برای کیبورد */
.verta-country-checkout-selector:focus:not(:focus-visible) {
    outline: none;
}