/**
 * Visual tweaks for intl-tel-input on top of WooCommerce/aGREGOS checkout fields.
 *
 * Goals:
 *  - The wrapper takes the full width of the WC form-row.
 *  - The flag/dial-code area is flush with the input (no double border).
 *  - Heights match other inputs in the form.
 */

.iti {
    display: block;
    width: 100%;
}

/* Make the inner input fill the wrapper height/width.
   Match the rest of the WC inputs (42px tall, 16px rounded). */
.iti input.input-text,
.iti input[type="tel"],
.iti input[type="text"] {
    width: 100% !important;
    height: 42px;
    padding-top: 8px;
    padding-bottom: 8px;
    box-sizing: border-box;
    border-radius: 16px;
}

/* Match other inputs' rounded corners on the input side */
.iti--separate-dial-code .iti__selected-flag {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
}

.iti--separate-dial-code input.input-text,
.iti--separate-dial-code input[type="tel"] {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* When dropdown is disabled (shipping = Cuba locked), make it visually static */
.iti--allow-dropdown:not(.iti) .iti__selected-flag {
    cursor: default;
}

.iti[data-locked="true"] .iti__selected-flag,
.iti.iti--locked .iti__selected-flag {
    cursor: default;
    pointer-events: none;
}

/* Dropdown z-index above WC's overlay/modals */
.iti__dropdown-content,
.iti__country-list {
    z-index: 100020;
}

/* Tighter look on mobile */
@media (max-width: 640px) {
    .iti input.input-text,
    .iti input[type="tel"] {
        height: 42px;
    }
}

/* ── Select2 (WooCommerce country / state) — match input look ────────── */
.woocommerce-checkout .select2-container--default .select2-selection--single,
.woocommerce-account .select2-container--default .select2-selection--single,
.woocommerce form .form-row .select2-container--default .select2-selection--single,
.woocommerce form .form-row .select2-container--woocommerce .select2-selection--single {
    height: 42px;
    border: 1px solid rgb(107, 114, 128);
    border-radius: 16px;
    background-color: #ffffff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.woocommerce form .form-row .select2-container--default .select2-selection--single .select2-selection__rendered,
.woocommerce form .form-row .select2-container--woocommerce .select2-selection--single .select2-selection__rendered {
    height: 42px;
    line-height: 42px;
    font-size: 14px;
    padding-left: 12px;
    padding-right: 28px;
    color: rgb(17, 24, 39);
}

.woocommerce form .form-row .select2-container--default .select2-selection--single .select2-selection__arrow,
.woocommerce form .form-row .select2-container--woocommerce .select2-selection--single .select2-selection__arrow {
    height: 40px;
    top: 0;
    right: 6px;
}

/* Focus / open state */
.woocommerce form .form-row .select2-container--default.select2-container--focus .select2-selection--single,
.woocommerce form .form-row .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--agregos-color-primary, #2271b1);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* The dropdown panel — round corners + match input */
.select2-container--default .select2-dropdown {
    border: 1px solid rgb(107, 114, 128);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid rgb(229, 231, 235);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
}
