/* ===========================
   Phone Input with Country Code
   Shared component across all forms
   =========================== */

.phone-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    direction: ltr;
}

/* Country code trigger */
.phone-code-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 48px;
    cursor: pointer;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    user-select: none;
}

.phone-code-trigger .fi {
    width: 22px;
    border-radius: 2px;
    flex-shrink: 0;
}

.phone-code-dial {
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
}

.phone-code-arrow {
    width: 10px;
    height: 10px;
    opacity: 0.6;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.phone-input-wrapper.open .phone-code-arrow {
    transform: rotate(180deg);
}

/* Phone number input */
.phone-number-input {
    flex: 1;
    min-width: 0;
    height: 48px;
    background: transparent;
    border: none;
    padding: 12px 16px;
    font-size: 12px;
    color: #fff;
    outline: none;
}

.phone-number-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Dropdown container */
.phone-code-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 4px 0 0;
    background: #0d1035;
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    z-index: 10;
    display: none;
    overflow: hidden;
}

.phone-input-wrapper.open .phone-code-dropdown {
    display: block;
}

/* Search input */
.phone-code-search {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #fff;
    outline: none;
}

.phone-code-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Dropdown list */
.phone-code-list {
    padding: 0;
    margin: 0;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.phone-code-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.phone-code-list li:hover {
    background: rgba(255, 255, 255, 0.1);
}

.phone-code-list li .fi {
    width: 22px;
    border-radius: 2px;
    flex-shrink: 0;
}

.phone-code-list li .phone-list-dial {
    opacity: 0.5;
    margin-inline-start: auto;
    font-size: 11px;
}

.phone-code-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 12px;
    padding: 0 !important;
    pointer-events: none;
}

.phone-code-list::-webkit-scrollbar {
    width: 4px;
}

.phone-code-list::-webkit-scrollbar-track {
    background: transparent;
}

.phone-code-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Validation error */
.phone-number-input.invalid {
    color: #f23030;
}

/* .phone-input-wrapper:has(.phone-number-input.invalid) {
    outline: 2px solid #f23030;
    border-radius: 6px;
} */

/* RTL: reverse dropdown content in Arabic mode */
[lang="ar-SA"] .phone-code-dropdown {
    direction: rtl;
}

/* Contact-us form override (45px height) */
.contact-form-field .phone-code-trigger {
    height: 45px;
}

.contact-form-field .phone-number-input {
    height: 45px;
    padding: 11px 15px;
}

.contact-form-field .phone-number-input::placeholder {
    color: #fff;
}
