/**
 * International Phone Number Validator - Styles
 */

/* Country selector styling */
.phone-country-select {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.phone-country-select:required {
    border-color: #d9534f;
}

.phone-country-select:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.phone-country-select:valid:not(:placeholder-shown) {
    border-color: #28a745;
}

.phone-country-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Phone input styling */
input[type="tel"] {
    width: 100%;
}

/* Invalid phone state */
input.phone-invalid {
    border-color: #dc3545 !important;
    background-color: #fff5f5;
}

input.phone-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Country select error message */
.phone-country-error {
    display: none;
    color: #dc3545;
    font-size: 13px;
    margin-top: 6px;
    margin-bottom: 8px;
    padding: 8px 0;
}

.phone-country-error[style*="display: block"] {
    display: block !important;
}

/* Live phone preview — shows the exact number that will be saved even if React resets the input */
.phone-number-preview {
    font-size: 12px;
    color: #28a745;
    margin-top: 4px;
    padding: 1.5rem;
    background: #f0fff4;
    border: 1px solid #c3e6cb;
    border-radius: 3px;
    display: none; /* shown via JS when a valid number is entered */
}
.phone-number-preview::before {
    content: "📱 Se guardará: ";
    font-weight: 600;
}

/* Phone info section in order details */
.phone-info-section {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-left: 4px solid #007cba;
    border-radius: 3px;
}

.phone-info-section h3 {
    margin-top: 0;
    color: #333;
}

.phone-info-section p {
    margin: 5px 0;
    color: #666;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .phone-country-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    input[type="tel"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}
