/* ============================================
   PVFWC - Frontend Styles (WC Blocks + dark theme)
   ============================================ */

.iti {
    width: 100%;
    display: block;
}

.iti__tel-input {
    width: 100%;
}

.iti--allow-dropdown input[type=tel],
.iti--has-country-selector input[type=tel] {
    width: 100%;
}

.pvfwc-error-msg {
    margin-top: 8px;
    margin-bottom: 8px;
}

.pvfwc-error-msg.wc-block-components-notice-banner {
    margin-top: 12px;
}

/* --- WooCommerce Blocks + Elementor reset conflicts --- */

.wc-block-components-text-input .iti,
.woocommerce-address-fields .iti,
.woocommerce-MyAccount-content .iti {
    width: 100%;
}

/* Elementor reset forces button { display:inline-block; pink border; padding }.
   Restore intl-tel-input flex layout for the country control. */
.iti button.iti__selected-country,
.wc-block-components-text-input .iti button.iti__selected-country,
.woocommerce form .iti button.iti__selected-country {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.iti .iti__selected-country-primary {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    gap: 4px;
    padding: 0 8px 0 12px !important;
    flex: 0 0 auto !important;
}

.iti .iti__selected-dial-code {
    display: block !important;
    height: auto !important;
    line-height: inherit !important;
    margin-left: 6px !important;
    margin-right: 0 !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    white-space: nowrap;
    flex: 0 0 auto !important;
}

.iti .iti__arrow {
    border-top-color: #aaa !important;
}

.iti .iti__country-container {
    z-index: 2;
}

/* Subtle separator between country prefix and number */
.iti button.iti__selected-country::after {
    content: "";
    display: block;
    width: 1px;
    height: 18px;
    margin: 0 6px 0 8px;
    background: rgba(255, 255, 255, 0.2);
    flex: 0 0 auto;
}

/* Theme uses padding: 0 12px !important on block inputs — that kills iti's
   padding-left for the flag/dial prefix. Match prefix width tightly. */
.wc-block-components-text-input input.iti__tel-input[type="tel"],
.wc-block-components-text-input input.iti__tel-input,
.ce-redesign .wc-block-components-text-input input.iti__tel-input {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-right: 12px !important;
    padding-left: 108px !important;
    font-size: 16px !important;
}

/* Dark dropdown to match checkout.
   WC Blocks sets .wc-block-components-text-input { line-height: 0 } — that
   inherits into the dropdown and collapses country names to 0 height. */
.iti__country-selector,
.wc-block-components-text-input .iti__country-selector {
    background: #1a1a1a !important;
    color: #fff !important;
    border: 1px solid #3a3a3a !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    font-size: 14px !important;
}

.iti__search-input-wrapper {
    position: relative !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    line-height: 1.35 !important;
}

/* Theme: .ce-redesign .wc-block-components-text-input input { padding: 0 12px }
   beats .iti__search-input — use higher specificity + leave room for the icon. */
.iti__search-input,
.wc-block-components-text-input .iti__search-input,
.ce-redesign .wc-block-components-text-input .iti__search-input,
.ce-redesign .wc-block-components-text-input input.iti__search-input {
    background: #111 !important;
    color: #fff !important;
    border: 1px solid #3a3a3a !important;
    border-radius: 4px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 36px 0 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    line-height: 36px !important;
    font-size: 14px !important;
}

.iti__search-input::placeholder,
.ce-redesign .wc-block-components-text-input .iti__search-input::placeholder {
    color: #888 !important;
    opacity: 1 !important;
}

.iti__search-input:focus,
.ce-redesign .wc-block-components-text-input .iti__search-input:focus {
    outline: 2px solid var(--ce-accent, #c33) !important;
    border-color: var(--ce-accent, #c33) !important;
}

/* Hide search icon — theme padding fights iti's absolute icon layout. */
.iti__search-icon,
.iti__search-input-wrapper .iti__search-icon {
    display: none !important;
}

/* Elementor reset styles buttons pink — neutralize clear/close controls */
.iti button.iti__search-clear,
.iti .iti__search-clear,
.iti__country-selector button.iti__search-clear,
.iti__search-input-wrapper button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 0 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: #aaa !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    line-height: 1 !important;
}

.iti .iti__search-clear.iti__hide {
    display: none !important;
}

.iti button.iti__search-clear:hover,
.iti .iti__search-clear:hover {
    color: #fff !important;
    background: #2a2a2a !important;
}

.iti__country-list,
.iti .iti__country-list {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    scrollbar-width: thin;
    scrollbar-color: #555 #1a1a1a;
}

.iti__country-list::-webkit-scrollbar {
    width: 8px;
    height: 0;
}

.iti__country-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.iti__country-list::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.iti__country,
.wc-block-components-text-input .iti__country {
    display: flex !important;
    align-items: center !important;
    color: #fff !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
    min-height: 36px !important;
    height: auto !important;
}

.iti__country-name,
.wc-block-components-text-input .iti__country-name {
    display: block !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: #fff !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    height: auto !important;
    min-height: 1.2em !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.iti__country:hover,
.iti__country.iti__highlight {
    background: #2a2a2a !important;
    color: #fff !important;
}

.iti__country.iti__active {
    background: #222 !important;
}

.iti__divider {
    border-bottom-color: #3a3a3a !important;
}

.iti__dial-code,
.iti__country-name .iti__dial-code {
    color: #aaa !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
}
