/* ============================================
   COMPACT ADDRESS MODAL - OPTIMIZED STYLES
   Matches guest checkout field consolidation
   ============================================ */

/* Compact modal variant */
.address-modal-compact {
    max-width: 520px;
}

.modal-body-compact {
    padding: 20px;
}

/* Tighter spacing for cleaner look */
.modal-body-compact .modal-form-group {
    margin-bottom: 16px;
}

.modal-body-compact .modal-form-grid {
    margin-bottom: 0;
}

/* Textarea for Address Line 1 */
.modal-textarea {
    resize: vertical;
    min-height: 70px;
    line-height: 1.5;
    font-family: inherit;
}

/* Optional label styling */
.optional-label {
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 400;
}

/* Form hint */
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6B7280;
}

/* Auto-filled state */
.modal-form-control.auto-filled {
    background-color: #F0FDF4;
    border-color: #86EFAC;
}

/* Modal form group - tighter spacing */
.modal-body-compact .modal-form-group {
    margin-bottom: 14px; /* Reduced from 16px */
}

.modal-body-compact .modal-form-grid {
    margin-bottom: 0; /* Remove extra margin */
}

/* Compact modal on mobile - full screen */
@media (max-width: 768px) {
    .address-modal-compact {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 20px 20px 0 0;
        margin-top: auto;
    }
    
    .modal-overlay.active {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-body-compact {
        padding: 16px;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
    }
    
    .modal-footer {
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 1px solid #E5E7EB;
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
}

/* Adjust select dropdown in compact modal */
.address-modal-compact select.modal-form-control {
    padding: 10px 12px;
}

/* Grid spacing */
.modal-body-compact .modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

/* Single column on very small screens */
@media (max-width: 480px) {
    .modal-body-compact .modal-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Pin code field - highlight */
#modalPinCode {
    font-weight: 600;
}

#modalPinCode:focus {
    border-color: #AFBD77;
    box-shadow: 0 0 0 3px rgba(175, 189, 119, 0.1);
}

/* State field readonly styling */
#modalState[readonly] {
    background-color: #F9FAFB;
    color: #6B7280;
    cursor: not-allowed;
}

/* City dropdown with auto-filled state */
#modalCity option[value=""] {
    color: #9CA3AF;
    font-style: italic;
}

/* Address type with emojis */
.address-modal-compact select[name="address_type"] option {
    font-size: 14px;
}

/* Better label styling */
.modal-body-compact label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #1F2937;
}

.modal-body-compact label.required::after {
    content: ' *';
    color: #DC2626;
}

/* Form control consistency */
.modal-body-compact .modal-form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-body-compact .modal-form-control:focus {
    outline: none;
    border-color: #8B7355;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

/* Delivery address label */
.modal-body-compact label:has(+ textarea) {
    font-size: 14px;
}
