/* ==========================================================================
   Opt-in modal layout, used with js/modal-helper.js (MeshModal.trap).
   Nothing here applies unless a host adds the classes:
     <div class="modal-overlay mesh-modal-overlay">          the dimmer
       <div class="modal-content mesh-modal" role="dialog">   the dialog
         <div class="modal-header">...</div>                  stays put
         <div class="modal-body">...</div>                    the only part that scrolls
         <div class="mesh-modal-footer">...</div>             optional, always visible
   Load after css/style.css so these win ties with .modal-content.
   ========================================================================== */

/* The dimmer must sit above the WhatsApp widget and the cookie banner (both 9999). */
.mesh-modal-overlay {
    z-index: 10000;
    padding: 0.5rem;
    box-sizing: border-box;
}

.mesh-modal {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    overflow: hidden;
}

.mesh-modal:focus {
    outline: none;
}

.mesh-modal .modal-header {
    flex: 0 0 auto;
    gap: 0.75rem;
    background: #fff;
}

.mesh-modal .modal-header h3 {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.mesh-modal .modal-close {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mesh-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.mesh-modal-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 0.75rem 1.25rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 -6px 14px rgba(0, 0, 0, 0.06);
}
