/* ==========================================================================
   JMD INDUSTRIES - FLOATING CONTACT & MODAL FORMS STYLING
   ========================================================================== */

/* ----------------- Right-Side Sticky Contact Widget ----------------- */
.jmd-sticky-contact {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jmd-sticky-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: #ffffff !important;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 22px;
}

.jmd-sticky-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.jmd-sticky-btn.jmd-btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.jmd-sticky-btn.jmd-btn-email {
    background: linear-gradient(135deg, #5B0B0C 0%, #8B1E21 100%);
}

.jmd-sticky-btn.jmd-btn-call {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

/* Tooltip Labels */
.jmd-sticky-label {
    position: absolute;
    right: 65px;
    background: rgba(20, 20, 20, 0.92);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.25s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-family: inherit;
}

.jmd-sticky-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(20, 20, 20, 0.92);
}

.jmd-sticky-btn:hover .jmd-sticky-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Subtle Pulse Animation */
@keyframes jmdPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.jmd-sticky-btn.jmd-btn-whatsapp {
    animation: jmdPulse 2.5s infinite;
}

/* ----------------- Modal Backdrops & Dialogs ----------------- */
.jmd-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.68);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.jmd-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.jmd-modal-dialog {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 540px;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transform: scale(0.92) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.jmd-modal-backdrop.active .jmd-modal-dialog {
    transform: scale(1) translateY(0);
}

/* Close Button */
.jmd-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.jmd-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

/* Modal Headers */
.jmd-modal-header {
    padding: 24px 28px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 16px;
}

.jmd-header-whatsapp {
    background: linear-gradient(135deg, #1fa855 0%, #075e54 100%);
}

.jmd-header-primary {
    background: linear-gradient(135deg, #5B0B0C 0%, #3e0708 100%);
}

.jmd-header-icon {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.15);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.jmd-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: #ffffff;
}

.jmd-modal-header p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.88);
}

/* Modal Forms */
.jmd-modal-form {
    padding: 24px 28px 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.jmd-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.jmd-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.jmd-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #333333;
}

.jmd-form-group label .req {
    color: #dc2626;
}

.jmd-form-group input,
.jmd-form-group select,
.jmd-form-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background-color: #f9fafb;
    transition: all 0.2s ease;
    outline: none;
}

.jmd-form-group input:focus,
.jmd-form-group select:focus,
.jmd-form-group textarea:focus {
    border-color: #5B0B0C;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(91, 11, 12, 0.12);
}

.jmd-header-whatsapp + form .jmd-form-group input:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.jmd-form-group textarea {
    resize: vertical;
    min-height: 75px;
}

/* Submit Buttons */
.jmd-modal-submit-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
}

.jmd-modal-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.jmd-modal-submit-btn:active {
    transform: translateY(0);
}

.jmd-modal-submit-btn.jmd-btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.jmd-modal-submit-btn.jmd-btn-primary {
    background: linear-gradient(135deg, #5B0B0C 0%, #8B1E21 100%);
}

/* Honeypot Spam Protection */
.jmd-hp {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
}

/* ----------------- Universal Success Modal ----------------- */
.jmd-success-dialog {
    max-width: 440px;
    text-align: center;
    border-radius: 18px;
}

.jmd-success-dialog .jmd-modal-close {
    color: #6b7280;
    background: #f3f4f6;
}

.jmd-success-dialog .jmd-modal-close:hover {
    background: #e5e7eb;
}

.jmd-success-content {
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.jmd-success-icon {
    font-size: 64px;
    color: #10b981;
    margin-bottom: 18px;
    animation: jmdIconPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes jmdIconPop {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.jmd-success-title {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 10px;
}

.jmd-success-text {
    font-size: 15px;
    line-height: 1.5;
    color: #4b5563;
    margin: 0 0 24px;
}

.jmd-btn-close-success {
    background: #5B0B0C;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 36px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.jmd-btn-close-success:hover {
    background: #771012;
}

/* Inline alerts for forms */
.form-response-msg.success {
    color: #065f46;
    background: #d1fae5;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #a7f3d0;
}

.form-response-msg.error {
    color: #991b1b;
    background: #fee2e2;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

/* Button Loader & States */
.btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:disabled,
.jmd-modal-submit-btn:disabled,
.jmd-submit-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    pointer-events: none;
}

/* ----------------- Responsive Breakpoints ----------------- */
@media (max-width: 768px) {
    .jmd-sticky-contact {
        right: 14px;
        bottom: 18px;
        top: auto;
        transform: none;
        gap: 10px;
    }

    .jmd-sticky-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .jmd-sticky-label {
        display: none; /* Hide labels on mobile to avoid screen crowding */
    }

    .jmd-modal-dialog {
        max-width: 95%;
        margin: auto;
    }

    .jmd-form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .jmd-modal-header {
        padding: 18px 20px;
    }

    .jmd-modal-form {
        padding: 18px 20px 22px;
        gap: 12px;
    }

    .jmd-header-icon {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .jmd-modal-header h3 {
        font-size: 18px;
    }
}
