/**
 * Modeo Account - Address Edit Styles
 * 
 * Brand-aligned styles for WooCommerce address forms
 */

/* ========================================
   WOOCOMMERCE ADDRESS FIELDS WRAPPER
   ======================================== */

.woocommerce-address-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   WOOCOMMERCE FORM FIELDS
   ======================================== */

.woocommerce-address-fields .form-row {
    margin-bottom: 0;
    width: 100%;
    float: none;
    clear: both;
}

/* All fields on full width - unified layout */
.woocommerce-address-fields .form-row-first,
.woocommerce-address-fields .form-row-last,
.woocommerce-address-fields .form-row-wide {
    width: 100%;
    float: none;
    margin-right: 0;
    margin-left: 0;
    clear: both;
}

/* Form field inputs styling */
.woocommerce-address-fields .form-row label {
    display: block;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.woocommerce-address-fields .form-row .required {
    color: #cc1616;
    margin-left: 4px;
}

.woocommerce-address-fields .form-row input.input-text,
.woocommerce-address-fields .form-row textarea,
.woocommerce-address-fields .form-row select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.woocommerce-address-fields .form-row input.input-text:focus,
.woocommerce-address-fields .form-row textarea:focus,
.woocommerce-address-fields .form-row select:focus {
    outline: none;
    border-color: #cc1616;
    box-shadow: 0 0 0 3px rgba(204, 22, 22, 0.1);
}

.woocommerce-address-fields .form-row textarea {
    min-height: 100px;
    resize: vertical;
}

/* ========================================
   SELECT2 DROPDOWN OVERRIDE (Country/State)
   ======================================== */

.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    height: auto !important;
    padding: 12px 16px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    transition: all 0.2s ease;
}

.select2-container--focus .select2-selection--single,
.select2-container--open .select2-selection--single {
    border-color: #cc1616 !important;
    box-shadow: 0 0 0 3px rgba(204, 22, 22, 0.1) !important;
}

.select2-container .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.5 !important;
    color: #1f2937 !important;
}

.select2-container .select2-selection__arrow {
    height: 100% !important;
    right: 8px !important;
}

/* Dropdown menu */
.select2-dropdown {
    border: 2px solid #cc1616 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.select2-results__option {
    padding: 10px 16px !important;
    font-size: 0.95rem !important;
}

.select2-results__option--highlighted {
    background-color: #cc1616 !important;
    color: #ffffff !important;
}

/* ========================================
   CHECKBOX STYLING
   ======================================== */

.woocommerce-address-fields input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #cc1616;
}

.woocommerce-address-fields label.checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* ========================================
   VALIDATION STATES
   ======================================== */

.woocommerce-address-fields .woocommerce-invalid input,
.woocommerce-address-fields .woocommerce-invalid select,
.woocommerce-address-fields .woocommerce-invalid textarea,
.woocommerce-address-fields .woocommerce-invalid .select2-selection {
    border-color: #dc2626 !important;
}

.woocommerce-address-fields .woocommerce-validated input,
.woocommerce-address-fields .woocommerce-validated select,
.woocommerce-address-fields .woocommerce-validated textarea {
    border-color: #16a34a !important;
}

/* ========================================
   FORM FIELD ERRORS
   ======================================== */

.woocommerce-address-fields .form-row .woocommerce-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: #dc2626;
}

.woocommerce-address-fields .form-row .woocommerce-error::before {
    display: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 767px) {
    .woocommerce-address-fields {
        gap: 16px;
    }

    .woocommerce-address-fields .form-row input.input-text,
    .woocommerce-address-fields .form-row textarea,
    .woocommerce-address-fields .form-row select {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* ========================================
   EDIT ADDRESS HEADER & ACTIONS
   ======================================== */

.modeokids-edit-address,
.modeo-edit-address {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.edit-address-header {
    padding: 24px;
    background: linear-gradient(135deg, rgba(204, 22, 22, 0.04) 0%, rgba(248, 113, 113, 0.02) 100%);
    border-radius: 16px;
    border: 1px solid rgba(204, 22, 22, 0.1);
}

.edit-address-header .section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.edit-address-header .section-heading .material-icons {
    font-size: 28px;
    color: #cc1616;
}

.edit-address-description {
    color: #6b7280;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.form-section {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Ensure form fields wrapper has proper spacing */
.form-section .woocommerce-address-fields {
    margin-top: 8px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(204, 22, 22, 0.08);
}

.form-section-title .material-icons {
    font-size: 22px;
    color: #cc1616;
}

.form-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.form-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.form-actions .button.btn-primary {
    background: #cc1616;
    color: #fff;
    box-shadow: 0 4px 15px rgba(204, 22, 22, 0.3);
}

.form-actions .button.btn-primary:hover {
    background: #b91414;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(204, 22, 22, 0.4);
}

.form-actions .button.btn-secondary,
.modeokids-button-back-to-addresses,
.modeo-button-back-to-addresses {
    background: transparent;
    color: #cc1616;
    border: 2px solid #cc1616;
}

.form-actions .button.btn-secondary:hover,
.modeokids-button-back-to-addresses:hover,
.modeo-button-back-to-addresses:hover {
    background: #cc1616;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 22, 22, 0.25);
}

.form-actions .button .material-icons {
    font-size: 20px;
}

@media (max-width: 767px) {
    .form-actions {
        flex-direction: column;
    }

    .form-actions .button {
        width: 100%;
        justify-content: center;
    }

    .edit-address-header {
        padding: 20px;
    }

    .edit-address-header .section-heading {
        font-size: 1.25rem;
    }

    .form-section {
        padding: 20px;
    }
}