/* Equal breathing room above and below actual notices, without reserving an
   empty slot when Magento has no messages. */
body .page.messages:has(.message) {
    padding-block: 32px;
}
body .page.messages .messages { margin-block: 0 !important; }
body .page.messages .message:last-child { margin-bottom: 0 !important; }
@media (max-width: 767px) {
    body .page.messages:has(.message) { padding-block: 20px; }
}
/* Magento can render notices outside .page-main, inside a Knockout scope.
   Cover that real placement as well as inline and dynamically added notices. */
body .page.messages .message,
body .messages .message,
body .message.success,
body .message.error,
body .message.warning,
body .message.notice,
body .message.info {
    border-radius: 10px !important;
    overflow: hidden;
}

/* Magento confirm/alert dialogs are mounted outside the page content.
   Scope to these dialogs; never restyle payment-provider frames or widgets. */
body .modal-popup.confirm .modal-inner-wrap,
body .modal-popup.alert .modal-inner-wrap {
    border-radius: var(--megango-radius, 5px);
    overflow: hidden;
}
body .modal-popup.confirm .modal-header,
body .modal-popup.alert .modal-header { padding: 24px 24px 12px; }
body .modal-popup.confirm .modal-content,
body .modal-popup.alert .modal-content {
    padding: 16px 24px; border: 0; background: transparent; box-shadow: none;
    color: #191919; font-size: 16px; line-height: 1.5;
}
body .modal-popup.confirm .modal-footer,
body .modal-popup.alert .modal-footer {
    display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px;
    padding: 12px 24px 24px; border: 0;
}
body .modal-popup.confirm .modal-footer button,
body .modal-popup.alert .modal-footer button {
    box-sizing: border-box; min-height: 44px; padding: 12px 20px; margin: 0;
    border: 1px solid var(--megango-orange, #ea5455);
    border-radius: var(--megango-radius, 5px);
    background: transparent; color: var(--megango-orange, #ea5455);
    font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1.25;
    text-transform: none; letter-spacing: normal; box-shadow: none; transform: none;
    transition: background-color .15s, border-color .15s, color .15s;
}
body .modal-popup.confirm .modal-footer button span,
body .modal-popup.alert .modal-footer button span { font: inherit; text-transform: none; }
body .modal-popup.confirm .modal-footer button.action-primary,
body .modal-popup.alert .modal-footer button.action-primary,
body .modal-popup.confirm .modal-footer button:hover,
body .modal-popup.alert .modal-footer button:hover {
    background: var(--megango-orange, #ea5455); color: #fff;
}
body .modal-popup.confirm .modal-footer button.action-primary:hover,
body .modal-popup.alert .modal-footer button.action-primary:hover {
    background: #191919; border-color: #191919; color: #fff;
}
body .modal-popup.confirm .modal-footer button:focus-visible,
body .modal-popup.alert .modal-footer button:focus-visible {
    outline: 2px solid var(--megango-orange, #ea5455); outline-offset: 3px;
}

/* The minicart lives inside a very high header stacking context. Close it in
   JavaScript, then keep this one destructive confirmation and its overlay
   above the header until Magento has finished the close transition. */
body.megango-minicart-confirm-open .modals-overlay {
    z-index: 100000 !important;
}
body .modal-popup.confirm.minicart-remove-confirm {
    z-index: 100001 !important;
}
body .modal-popup.confirm.minicart-remove-confirm .modal-inner-wrap {
    width: calc(100% - 32px); max-width: 520px; margin: clamp(24px, 10vh, 80px) auto;
}

/* B15: three independent fixed widgets can otherwise cover checkout actions,
   catalogue pagination, or the product buy box. Keep transactional screens
   clear, suppress transient sales/chat previews on shopping pages, and retain
   the single compact contact widget only where there is room for it. */
body.checkout-cart-index #zipchat-shadow-host,
body.checkout-cart-index [id^="gb-widget-"],
body.checkout-cart-index .notify-slider-wrapper.content-products,
body.checkout-index-index #zipchat-shadow-host,
body.checkout-index-index [id^="gb-widget-"],
body.checkout-index-index .notify-slider-wrapper.content-products,
body._has-modal #zipchat-shadow-host,
body._has-modal [id^="gb-widget-"],
body._has-modal .notify-slider-wrapper.content-products,
body.catalog-product-view #zipchat-shadow-host,
body.catalog-product-view .notify-slider-wrapper.content-products,
body.catalog-category-view #zipchat-shadow-host,
body.catalog-category-view .notify-slider-wrapper.content-products {
    display: none !important;
}

@media (max-width: 1199px) {
    body.catalog-product-view [id^="gb-widget-"],
    body.catalog-category-view [id^="gb-widget-"] {
        display: none !important;
    }
}

@media (max-width: 767px) {
    body .modal-popup.confirm .modal-footer button,
    body .modal-popup.alert .modal-footer button { flex: 1 1 100px; }
}
