/**
 * Desire Address Manager Styles - Minimal (inherits theme styling)
 */

/* Hide Avada greeting bar on checkout (same as My Account page) */
.woocommerce-checkout .avada-myaccount-user {
	display: none;
}

.desire-address-manager {
    margin-bottom: 30px;
}

/* Address Options */
.desire-address-options {
    margin-bottom: 15px;
}

.desire-address-option {
    display: block;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
}

.desire-address-option input[type="radio"] {
    margin-right: 10px;
}

.desire-default-address-display {
    display: block;
    margin-top: 5px;
    opacity: 0.8;
}

/* New Address Wrapper */
.desire-new-address-wrapper {
    margin-top: 15px;
    padding-top: 15px;
}

/* Address Input - inherit WooCommerce input styling */
.desire-address-input-wrapper {
    margin-bottom: 15px;
}

.desire-address-autocomplete {
    width: 100%;
}

/* Google Maps container */
.desire-address-map {
    width: 100%;
    height: 250px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

/* Registration form specific - ensure proper stacking */
.desire-registration-address .desire-address-map {
    margin-bottom: 20px;
}

.desire-registration-address {
    margin-bottom: 20px;
}

/* Save Default Checkbox */
.desire-save-default {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.desire-save-default input[type="checkbox"] {
    margin-right: 10px;
}

/* Ensure Google dropdown appears above other elements */
.pac-container {
    z-index: 10000;
}

@media (max-width: 768px) {
    .desire-address-map {
        height: 200px;
    }
}

/* Hide WooCommerce address fields (filled by Google Maps) */
.desire-hidden-field,
#billing_country_field,
#shipping_country_field {
    display: none !important;
}

/* Account page specific */
.desire-account-address {
    margin-bottom: 20px;
}

.desire-current-default {
    padding: 10px;
    background: var(--awb-color2, #f0f7fc);
    border-left: 3px solid var(--link_color, #0073aa);
    margin-bottom: 15px;
}
/* Spacing between billing and shipping sections */
#desire-address-manager-billing {
    margin-bottom: 30px;
}

#desire-address-manager-shipping {
    margin-top: 20px;
}
/* Unit/Complex field */
.desire-unit-wrapper {
    margin: 15px 0;
}

.desire-unit-wrapper label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.desire-unit-wrapper input {
    width: 100%;
}

/* ==========================================
   Checkout — Phone/Email Validation Styles
   Matches the validation patterns from profile
   and edit-address pages.
   ========================================== */

/* intl-tel-input wraps phone input in .iti with display:inline-block,
   causing it to sit on the same line as the label. Force to block. */
.woocommerce-billing-fields .iti,
.woocommerce-shipping-fields .iti {
	display: block;
	width: 100%;
}

/* Suppress Avada's "Please enter correct details" ::after on phone & email fields */
.woocommerce-checkout #billing_phone_field::after,
.woocommerce-checkout #billing_email_field::after,
.woocommerce-checkout #shipping_phone_field::after {
	display: none !important;
	content: none !important;
}

/* Invalid border — same red as profile/edit-address validation */
.woocommerce-checkout .form-row.woocommerce-invalid input[type="tel"],
.woocommerce-checkout .form-row.woocommerce-invalid input[type="email"] {
	border-color: var(--desire-invalid-border, #e0284f) !important;
	box-shadow: 0 0 1.5px 1px var(--desire-invalid-shadow, rgba(224,40,79,.65)) !important;
}

/* Phone/email error message text */
.woocommerce-checkout .desire-phone-error,
.woocommerce-checkout .desire-email-error {
	display: block;
	margin-top: 4px;
	font-size: 0.85em;
	color: var(--desire-invalid-border, #e0284f);
}

/* Ensure form submit button is always accessible */
.desire-registration-form .desire-form-full-width {
    position: relative;
    z-index: 1;
}

.desire-registration-form p.submit,
.desire-registration-form .woocommerce-form-row.form-row:last-of-type {
    position: relative;
    z-index: 10;
}

/* ==========================================
   Registration Form Specific Fixes
   ========================================== */

/* Container for address manager in registration forms */
.desire-registration-form .desire-form-full-width {
    overflow: visible;
    position: relative;
}

/* Address manager container */
.desire-registration-form .desire-address-manager {
    width: 100%;
    overflow: hidden;
}

/* Map container - constrain within parent */
.desire-registration-form .desire-address-map {
    width: 100%;
    height: 200px;
    max-height: 200px;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: var(--form_border_radius, 4px);
}

/* Ensure shipping section doesn't cause overflow */
.desire-registration-form #desire-shipping-address-section {
    overflow: hidden;
}

/* Input wrapper */
.desire-registration-form .desire-address-input-wrapper {
    margin-bottom: 15px;
}

/* Unit wrapper */
.desire-registration-form .desire-unit-wrapper {
    margin-bottom: 15px;
}

/* Prefilled address box */
.desire-registration-form .desire-prefilled-address {
    margin-bottom: 15px;
}

/* Force the form grid to contain children properly */
.desire-registration-form .desire-form-fields {
    overflow: visible;
}

/* Submit button area - ensure it's always visible */
.desire-registration-form > p.woocommerce-form-row,
.desire-registration-form > p.submit {
    clear: both;
    position: relative;
    z-index: 100;
    margin-top: 30px;
}