/**
 * Stores Popup Fix - Centers all popups (M, E, RA)
 */

/* Fix Make Offer Modal */
#makeOfferModal,
#make-offer-modal,
.make-offer-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    bottom: auto !important;
    right: auto !important;
    max-width: 500px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
}

/* Fix Enquiry Modal */
#enquiryModal,
#inquiry-modal,
#inquiryModal,
.enquiry-modal,
.inquiry-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    bottom: auto !important;
    right: auto !important;
    max-width: 500px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
}

/* Fix Request Auction Modal */
#auctionModal,
#auction-modal,
.auction-modal,
.ra-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    bottom: auto !important;
    right: auto !important;
    max-width: 500px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
}

/* Fix modal overlay */
.modal-backdrop,
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 9998 !important;
}

/* Fix modal content */
.modal-content {
    position: relative !important;
    background: #1f2937 !important;
    border: 2px solid #6366f1 !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

/* Ensure proper z-index */
.modal,
[class*="modal"] {
    z-index: 9999 !important;
}

/* Fix form styling inside modals */
.modal-content form {
    margin: 0 !important;
}

.modal-content input,
.modal-content textarea,
.modal-content select {
    width: 100% !important;
    margin-bottom: 1rem !important;
    padding: 0.75rem !important;
    background: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: white !important;
    border-radius: 6px !important;
}

.modal-content label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    color: #d1d5db !important;
}

.modal-content h3,
.modal-content h4 {
    color: white !important;
    margin-bottom: 1.5rem !important;
}

/* Fix button styling */
.modal-content button {
    padding: 0.75rem 1.5rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.2s !important;
}

.modal-content button[type="submit"],
.modal-content .btn-primary {
    background: #6366f1 !important;
    color: white !important;
}

.modal-content button[type="submit"]:hover,
.modal-content .btn-primary:hover {
    background: #4f46e5 !important;
}

.modal-content button[type="button"],
.modal-content .btn-secondary {
    background: #4b5563 !important;
    color: white !important;
}

.modal-content button[type="button"]:hover,
.modal-content .btn-secondary:hover {
    background: #374151 !important;
}

/* Remove any bottom positioning */
[style*="bottom: 0"],
[style*="bottom:0"] {
    bottom: auto !important;
}

/* Mobile responsive */
@media (max-width: 640px) {
    #makeOfferModal,
    #enquiryModal,
    #auctionModal,
    .modal-content {
        width: 95% !important;
        padding: 1.5rem !important;
    }
}