.mhweb-form-group { 
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    max-width: 500px !important;
    padding: 18px 0 !important;
    border-bottom: 1px solid #eee !important;
    font-size: 1.1em !important;
}
.mhweb-form-group:last-child {
    border-bottom: none !important;
}
.mhweb-form-label {
    font-weight: 600 !important;
    color: #222 !important;
}
.mhweb-form-input {
    width: 70px !important;
    padding: 6px 10px !important;
    font-size: 1em !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    text-align: center !important;
    background: #fafafa !important;
}
#mhweb-form {
    max-width: 520px !important;
    margin: 0 auto !important;
    padding-top: 10px !important;
    margin-top: 0.75em !important;
}
#mhweb-form input[type="text"],
#mhweb-form input[type="email"],
#mhweb-form input[type="tel"],
#mhweb-form textarea {
    width: 100% !important;
    margin-bottom: 12px !important;
    padding: 8px 10px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    font-size: 1em !important;
}
#mhweb-form textarea {
    resize: vertical !important;
    min-height: 60px !important;
    font-family: inherit !important;
}
.mhweb-send-button-wrapper{
    text-align: center !important;
}
#mhweb-form button[type="submit"] {
    margin-top: 16px !important;
    padding: 10px 24px !important;
    background: #222 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 1.1em !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}
#mhweb-form button[type="submit"]:hover {
    background: #444 !important;
}
#mhweb-form button[type="submit"]:disabled,
#mhweb-form button[type="submit"][disabled],
#mhweb-submit:disabled,
#mhweb-submit[disabled],
.button:disabled,
.button[disabled] {
    background: #ccc !important;
    color: #666 !important;
    border-color: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    pointer-events: none !important;
    box-shadow: none !important;
}
#mhweb-form button[type="submit"]:disabled:hover,
#mhweb-submit:disabled:hover,
.button:disabled:hover {
    background: #ccc !important;
    color: #666 !important;
}
#mhweb-submit.disabled,
.button.disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    pointer-events: none !important;
}
#mhweb-custom-flavors .mhweb-custom-row {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}
.mhweb-custom-name {
    flex: 1 !important;
    padding: 6px 8px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
}
.mhweb-custom-qty {
    width: 80px !important;
    padding: 6px 8px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    text-align: center !important;
}
.mhweb-remove-custom {
    background: #e74c3c !important;
    color: #fff !important;
    border: none !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}
#mhweb-form input:focus,
#mhweb-form button:focus,
#mhweb-custom-flavors .mhweb-custom-name:focus,
#mhweb-custom-flavors .mhweb-custom-qty:focus {
    outline: 3px solid rgba(100,150,255,0.25) !important;
    outline-offset: 2px !important;
}

/* Hide any textual label rendered near mh_qty shortcodes (targets labels for the visible inputs) */
label[for^="mhweb-visible-qty-"] {
    display: none !important;
}

/* Visible qty input styling — compact, aligned, and consistent with form theme */
.mhweb-visible-qty {
    width: 70px !important;
    padding: 6px 10px !important;
    font-size: 1rem !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    text-align: center !important;
    background: #fafafa !important;
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    margin-top: 10px !important; /* added top spacing */
}

/* Remove spinner arrows on some browsers for cleaner look (Safari compatible) */
.mhweb-visible-qty::-webkit-outer-spin-button,
.mhweb-visible-qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
}
.mhweb-visible-qty[type=number] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Small responsive tweak if many boxes are inline */
.mhweb-visible-qty + .mhweb-visible-qty {
    margin-left: 8px !important;
}

/* keep focus styles consistent */
.mhweb-visible-qty:focus {
    outline: 3px solid rgba(100,150,255,0.25) !important;
    outline-offset: 2px !important;
}

/* result / notice styles for AJAX responses */
#mhweb-result {
    display: block !important;
    margin-top: 12px !important;
    padding: 10px 12px !important;
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease !important;
}

/* success / error states */
#mhweb-result.mhweb-result--success {
    text-align: center !important;
    color: #1a7f37 !important;
}

#mhweb-result.mhweb-result--error {
    background: #fdecea !important;
    text-align: center !important;
    color: #b3362b !important;
}

/* neutral / sending state */
#mhweb-result.mhweb-result--info {
    color: #333 !important;
    text-align: center !important;
}

/* uniform boxes, preserve whole image (may show gaps) */
.uagb-ifb-image-content {
    width: 300px !important;
    height: 300px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    margin: auto !important;
    border-radius: 29px !important;
}
.uagb-ifb-image-content img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* no cropping */
    object-position: center center !important;
    max-width: none !important;
}

@media (max-width: 899px) {
    /* Center the form container and make it comfortably narrow on mobile */
    #mhweb-form {
        width: calc(100% - 32px) !important;
        max-width: 480px !important;
        margin: 0 auto !important;
        padding-top: 12px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Stack rows and remove horizontal spacing */
    .mhweb-form-group {
        display: block !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid #eee !important;
        max-width: 100% !important;
    }

    /* Hide visual labels (inputs keep aria-label) to save space */
    .mhweb-form-label {
        display: none !important;
    }

    /* Make text/email inputs full width */
    #mhweb-form input[type="text"],
    #mhweb-form input[type="email"],
    #mhweb-form input[type="tel"] {
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 0 12px 0 !important;
        padding: 10px 12px !important;
    }

    /* Center quantity boxes under image and make them consistent size */
    .mhweb-form-input,
    .mhweb-visible-qty {
        display: block !important;
        width: 64px !important;
        margin: 8px auto 0 auto !important;
        text-align: center !important;
    }

    /* Make submit button full width and centered */
    #mhweb-form button[type="submit"] {
        display: block !important;
        width: calc(100% - 0px) !important;
        max-width: none !important;
        margin: 14px auto 0 auto !important;
        padding: 12px 14px !important;
        box-sizing: border-box !important;
    }

    /* Slightly reduce focus outline on small screens */
    #mhweb-form input:focus,
    #mhweb-form button:focus,
    #mhweb-form input[type="tel"]:focus,
    .mhweb-visible-qty:focus {
        outline-offset: 1px !important;
        outline: 3px solid rgba(100,150,255,0.18) !important;
    }
}

/* Modal styles - Order Modal */
.mhweb-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 999999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    display: none !important;
}

.mhweb-modal-overlay.mhweb-modal-show {
    display: flex !important;
}

.mhweb-modal-content {
    background: #fff !important;
    border-radius: 8px !important;
    max-width: 600px !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    position: relative !important;
}

.mhweb-modal-header {
    padding: 20px 24px 0 24px !important;
    border-bottom: 1px solid #eee !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.mhweb-modal-header h3 {
    margin: 0 0 16px 0 !important;
    font-size: 1.3em !important;
    color: #333 !important;
}

.mhweb-modal-close {
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    cursor: pointer !important;
    color: #666 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
}

.mhweb-modal-close:hover {
    background: #f0f0f0 !important;
    color: #333 !important;
}

.mhweb-modal-body {
    padding: 24px !important;
}

.mhweb-modal-form-section {
    margin-bottom: 24px !important;
}

.mhweb-modal-form-section h4 {
    margin: 0 0 16px 0 !important;
    font-size: 1.1em !important;
    color: #333 !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 8px !important;
}

.mhweb-modal-form-section:last-child {
    margin-bottom: 0 !important;
}

#mhweb-modal-form input[type="text"],
#mhweb-modal-form input[type="email"],
#mhweb-modal-form input[type="tel"],
#mhweb-modal-form input[type="date"],
#mhweb-modal-form textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    margin-bottom: 12px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
}
#mhweb-modal-form textarea {
    resize: vertical !important;
    min-height: 70px !important;
    font-family: inherit !important;
}

.mhweb-modal-flavors {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
}

.mhweb-modal-flavor-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.mhweb-modal-flavor-row:last-child {
    border-bottom: none !important;
}

.mhweb-modal-flavor-label {
    font-weight: 500 !important;
    color: #333 !important;
    margin: 0 !important;
}

.mhweb-modal-qty-input {
    width: 70px !important;
    padding: 6px 10px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    text-align: center !important;
    font-size: 1rem !important;
    margin: 0 !important;
    background: #fafafa !important;
}

.mhweb-modal-footer {
    border-top: 1px solid #eee !important;
    padding: 16px 0 0 0 !important;
    display: flex !important;
    gap: 12px !important;
    justify-content: flex-end !important;
}

.mhweb-modal-close-btn {
    background: #f0f0f0 !important;
    color: #333 !important;
    padding: 10px 20px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}

.mhweb-modal-close-btn:hover {
    background: #e0e0e0 !important;
}

#mhweb-modal-submit {
    background: #222 !important;
    color: #fff !important;
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 1rem !important;
}

#mhweb-modal-submit:hover {
    background: #444 !important;
}

#mhweb-modal-submit:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

#mhweb-modal-result {
    margin-top: 16px !important;
    padding: 10px 12px !important;
    border-radius: 6px !important;
    font-size: 0.95rem !important;
    text-align: center !important;
}

#mhweb-modal-result.mhweb-result--success {
    background: #e6f7ea !important;
    color: #1a7f37 !important;
    border: 1px solid rgba(26,127,55,0.12) !important;
}

#mhweb-modal-result.mhweb-result--error {
    background: #fdecea !important;
    color: #b3362b !important;
    border: 1px solid rgba(179,54,43,0.12) !important;
}

#mhweb-modal-result.mhweb-result--info {
    background: #f5f7fa !important;
    color: #333 !important;
    border: 1px solid rgba(0,0,0,0.04) !important;
}

/* Mobile adjustments for modal */
@media (max-width: 899px) {
    .mhweb-modal-overlay {
        padding: 10px !important;
    }
    
    .mhweb-modal-content {
        max-height: 95vh !important;
    }
    
    .mhweb-modal-body {
        padding: 16px !important;
    }
    
    .mhweb-modal-header {
        padding: 16px 20px 0 20px !important;
    }
    
    .mhweb-modal-flavors {
        gap: 8px !important;
    }
    
    .mhweb-modal-flavor-row {
        padding: 8px 0 !important;
    }
    
    .mhweb-modal-qty-input {
        width: 60px !important;
    }
    
    .mhweb-modal-footer {
        flex-direction: column-reverse !important;
        gap: 8px !important;
    }
    
    .mhweb-modal-close-btn,
    #mhweb-modal-submit {
        width: 100% !important;
        text-align: center !important;
    }
}