/* Specific selector for the billing phone input */
input[type="tel"]#billing_phone.input-text.wooccm-required-field {
    margin-left: 35px !important;
}

/* Main container for the phone input */
.iti {
    width: 100%;
    position: relative;
    display: block;
}

/* Flag container styling */
.iti__flag-container {
    position: absolute;
    top: 0;
    bottom: 0;
    padding: 0;
    z-index: 1 !important;
}

/* Selected flag area */
.iti__selected-flag {
    position: relative;
    z-index: 1;
    padding: 0 6px 0 8px;
    height: 100%;
    display: flex;
    align-items: center;
    background-color: #f7f7f7 !important;
    border-right: 1px solid #ddd;
}

/* Phone input general styles */
.wc-phone-input {
    padding-left: 52px !important;
    width: 100% !important;
    font-size: 14px !important;
    position: relative;
    z-index: 0 !important;
}

/* Country dropdown */
.iti__country-list {
    position: absolute;
    z-index: 2;
    padding: 0;
    margin: 0 0 0 -1px;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.2);
    background-color: white;
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: scroll;
    width: 260px;
}

/* Error message styling */
.phone-error {
    color: #e2401c;
    display: block;
    margin-top: 0.5em;
    font-size: 0.875em;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .iti__country-list {
        width: 250px;
    }
    
    .wc-phone-input {
        font-size: 16px !important;
    }
}

/* Valid/Invalid state indicators */
.wc-phone-input.valid {
    border-color: #7ad03a;
}

.wc-phone-input.invalid {
    border-color: #e2401c;
}

/* Ensure proper stacking of elements */
.iti__flag-container,
.iti__selected-flag,
.iti__country-list {
    background-color: white;
}

/* Style for the selected dial code */
.iti__selected-dial-code {
    color: #333;
    font-weight: normal;
    padding-left: 5px;
}