.phacon-quotation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.phacon-quotation-modal[style*="display: flex"] {
    background: transparent;
}

.phacon-quotation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.phacon-quotation-modal-content {
    position: relative;
    background: white;
    max-width: 600px;
    width: 90%;
    min-width: 300px;
    height: auto;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 10000;
    animation: phacon-modal-fadeIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes phacon-modal-fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.phacon-quotation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.phacon-quotation-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #004169;
}

.phacon-quotation-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.phacon-quotation-modal-close:hover {
    color: #000;
}

.phacon-quotation-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    display: block;
    min-height: 300px;
    background: white;
}

.phacon-quotation-modal-body #phacon-quotation-form-container {
    width: 100%;
    min-height: 100px;
}

/* Ensure WPForms displays properly inside modal */
.phacon-quotation-modal-body .wpforms-container,
.phacon-quotation-modal-body .wpforms-container-full {
    width: 100% !important;
    max-width: 100% !important;
}

.phacon-quotation-modal-body .wpforms-form,
.phacon-quotation-modal-body form.wpforms-form {
    width: 100% !important;
    max-width: 100% !important;
}

.phacon-quotation-modal-body .wpforms-field,
.phacon-quotation-modal-body .wpforms-field-row {
    width: 100% !important;
}

.phacon-quotation-modal-body .wpforms-field-container {
    width: 100% !important;
}

.phacon-quotation-modal-body input,
.phacon-quotation-modal-body textarea,
.phacon-quotation-modal-body select,
.phacon-quotation-modal-body .wpforms-field input,
.phacon-quotation-modal-body .wpforms-field textarea,
.phacon-quotation-modal-body .wpforms-field select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Hide CSS variable text if it appears */
.phacon-quotation-modal-body .wpforms-form::before,
.phacon-quotation-modal-body .wpforms-container::before,
.phacon-quotation-modal-body .wpforms-form::after {
    display: none !important;
    content: none !important;
}

/* Ensure WPForms renders properly */
.phacon-quotation-modal-body .wpforms-form {
    display: block !important;
}

.phacon-quotation-modal-body .wpforms-field-row {
    display: grid !important;
    width: 100% !important;
}

.phacon-quotation-modal-body .wpforms-field-row-wide {
    grid-column: 1 / -1 !important;
}

@media (max-width: 768px) {
    .phacon-quotation-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .phacon-quotation-modal-header h3 {
        font-size: 1.25rem;
    }

    .phacon-quotation-modal-body {
        padding: 15px;
    }
}
