/**
 * Tunisia Address Dropdowns v3.0 - Styles
 */

/* Dropdown styling to match PrestaShop theme */
select[id$="_gouvernorat"],
select[id$="_delegation"],
select[id$="_localite"] {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 35px;
    cursor: pointer;
}

select[id$="_gouvernorat"]:focus,
select[id$="_delegation"]:focus,
select[id$="_localite"]:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

select[id$="_gouvernorat"]:disabled,
select[id$="_delegation"]:disabled,
select[id$="_localite"]:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loading state placeholder */
select[id$="_delegation"]:disabled option:first-child,
select[id$="_localite"]:disabled option:first-child {
    color: #6c757d;
    font-style: italic;
}

/* Ensure hidden inputs don't take space */
input[name$="_original"] {
    display: none !important;
}

/* Match form-control class if present */
select.form-control {
    height: auto;
}

/* Postal code auto-fill highlight */
input[name="postcode"],
input#field-postcode {
    transition: background-color 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    select[id$="_gouvernorat"],
    select[id$="_delegation"],
    select[id$="_localite"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}
