/* ==========================================================================
   intl-tel-input v25 - modern WhatsApp / Stripe / iOS-style overrides
   Loaded after intlTelInput.min.css (see enqueue_scripts.php) so it wins.
   Scoped to .iti so the rest of the theme's inputs are untouched.
   ========================================================================== */

.iti {
    /* Theme tokens */
    --th-accent: #2563eb;            /* focus / selected accent          */
    --th-accent-soft: rgba(37, 99, 235, .15);
    --th-text: #1f2330;
    --th-muted: #8b93a7;
    --th-border: #e3e6ee;
    --th-surface: #ffffff;
    --th-hover: #f4f6fb;
    --th-radius: 12px;
    --th-radius-lg: 16px;
    --th-shadow: 0 10px 30px rgba(20, 23, 38, .12), 0 2px 6px rgba(20, 23, 38, .06);

    /* Drive the library's own variables so flag/arrow/search match the theme */
    --iti-border-color: var(--th-border);
    --iti-dropdown-bg: var(--th-surface);
    --iti-hover-color: var(--th-hover);
    --iti-arrow-color: var(--th-muted);
    --iti-dialcode-color: var(--th-muted);
    --iti-search-icon-color: var(--th-muted);

    display: block;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Input field + country button (the resting control)
   -------------------------------------------------------------------------- */
.iti .iti__tel-input,
.iti input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
    height: 48px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 16px;            /* 16px avoids iOS zoom-on-focus */
    line-height: 1.4;
    color: var(--th-text);
    background: var(--th-surface);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius);
    box-shadow: 0 1px 2px rgba(20, 23, 38, .05);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.iti .iti__tel-input::placeholder,
.iti input[type="tel"]::placeholder {
    color: var(--th-muted);
}

.iti .iti__tel-input:hover,
.iti input[type="tel"]:hover {
    border-color: #cdd3e1;
}

/* Subtle focus border + soft accent ring */
.iti .iti__tel-input:focus,
.iti input[type="tel"]:focus {
    border-color: var(--th-accent);
    box-shadow: 0 0 0 3px var(--th-accent-soft);
}

/* The flag + dial-code button on the left */
.iti__selected-country {
    border-top-left-radius: var(--th-radius);
    border-bottom-left-radius: var(--th-radius);
    transition: background-color .15s ease;
}
.iti__selected-country:hover,
.iti__selected-country-primary:hover {
    /* background-color: var(--th-hover); */
}
.iti__selected-country:focus-visible {
    /* outline: 2px solid var(--th-accent);
    outline-offset: -2px; */
    outline:none !important;
}
.iti__selected-dial-code {
    color: var(--th-text);
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Dropdown panel
   -------------------------------------------------------------------------- */
.iti__dropdown-content {
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    background: var(--th-surface);
    box-shadow: var(--th-shadow);
    overflow: hidden;
    padding: 6px;
    margin-top: 8px;
}

/* Search bar inside the dropdown */
.iti__search-input-wrapper {
    padding: 2px 2px 8px;
}
.iti__search-input {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    border: 1px solid var(--th-border);
    border-radius: 10px;
    background: var(--th-hover);
    font-size: 15px;
    color: var(--th-text);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.iti__search-input:focus {
    outline: none;
    background: var(--th-surface);
    border-color: var(--th-accent);
    box-shadow: 0 0 0 3px var(--th-accent-soft);
}

/* --------------------------------------------------------------------------
   Country list - performance-friendly scrolling + clean rows
   -------------------------------------------------------------------------- */
.iti__country-list {
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;   /* momentum scroll on iOS            */
    overscroll-behavior: contain;        /* don't scroll the page behind it   */
    scrollbar-width: thin;
    scrollbar-color: #cdd3e1 transparent;
}
.iti__country-list::-webkit-scrollbar { width: 8px; }
.iti__country-list::-webkit-scrollbar-thumb {
    background: #d7dbe6;
    border-radius: 8px;
}

.iti__country {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 36px 9px 12px;          /* right room for the checkmark      */
    border-radius: 10px;
    color: var(--th-text);
    cursor: pointer;
    transition: background-color .12s ease;
}
.iti__country-name { font-size: 15px; }
.iti__dial-code {
    margin-left: auto;
    color: var(--th-muted);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* Hover + keyboard-navigation highlight (.iti__highlight is set by the lib) */
.iti__country:hover,
.iti__country.iti__highlight {
    background-color: var(--th-hover);
}

/* Selected country: tinted row + accent checkmark on the right */
.iti__country[aria-selected="true"] {
    background-color: var(--th-accent-soft);
}
.iti__country[aria-selected="true"] .iti__country-name { font-weight: 600; }
.iti__country[aria-selected="true"]::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 5px;
    height: 10px;
    border: solid var(--th-accent);
    border-width: 0 2px 2px 0;
    transform: translateY(-62%) rotate(45deg);
}

.iti__no-results {
    padding: 14px 12px;
    color: var(--th-muted);
    font-size: 14px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Validation error (set by intl-tel-input-init.js)
   -------------------------------------------------------------------------- */
.iti-invalid.iti__tel-input,
input[type="tel"].iti-invalid {
    border-color: #e5484d !important;
    box-shadow: 0 0 0 3px rgba(229, 72, 77, .15) !important;
}
.iti-error-msg {
    display: block;
    margin-top: 6px;
    color: #e5484d;
    font-size: 13px;
    line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Responsive: on small/touch screens v25 shows a fullscreen popup
   (useFullscreenPopup default). Make it feel like a native sheet.
   -------------------------------------------------------------------------- */
.iti--fullscreen-popup .iti__dropdown-content {
    border-radius: 0;
    margin-top: 0;
    padding: 12px;
    box-shadow: none;
}
.iti--fullscreen-popup .iti__country-list {
    max-height: none;
    flex: 1;
}
.iti--fullscreen-popup .iti__country { padding-top: 12px; padding-bottom: 12px; }

@media (max-width: 480px) {
    .iti .iti__tel-input,
    .iti input[type="tel"] { height: 46px; }
}
