/* EffortMart dialog component (shop).
   ONE look for every popup: header (title left, 40px close button right, hairline under), scrolling body, sticky footer.
   Phone (<= 767px): bottom sheet with 12px top corners that covers the bottom nav. Desktop: centred dialog, 8px radius.
   Backdrop is a flat slate wash (no blur). Open and close take 150ms (fade + 8px rise on desktop, slide up on phones).
   Reduced motion: no movement, no fade.

   Markup:
     <div class="dlg" id="x" role="dialog" aria-modal="true" aria-labelledby="xTitle" hidden>
       <div class="dlg-backdrop" data-dlg-close></div>
       <div class="dlg-panel" style="--dlg-w:420px">
         <div class="dlg-head"><h2 class="dlg-title" id="xTitle">Title</h2><button class="dlg-x" data-dlg-close aria-label="Close">...</button></div>
         <div class="dlg-body">...</div>
         <div class="dlg-foot">...</div>
       </div>
     </div>
   Open with EmDialog.open(el), close with EmDialog.close(el) (em-assets/js/layout/dialog.js). The same script gives the older
   page sheets (address picker, order summary, product sheets, zoom, wishlist modals, filters) focus handling, Esc and scroll lock. */

:root {
  --dlg-backdrop: rgba(15, 23, 42, .45);
  --dlg-shadow: 0 8px 24px rgba(15, 23, 42, .14);
  --dlg-radius: 8px;
  --dlg-sheet-radius: 12px;
  --dlg-dur: 150ms;
  --dlg-ease: cubic-bezier(.2, 0, 0, 1);
  --dlg-z: 10050;
  --dlg-ink: #0F172A;
  --dlg-text: #334155;
  --dlg-mute: #64748B;
  --dlg-line: #E2E8F0;
  --dlg-line-strong: #CBD5E1;
  --dlg-soft: #F8FAFC;
  --dlg-brand: #E97C43;
  --dlg-brand-strong: #C45A2A;
  --dlg-brand-deep: #973B14;
  --dlg-bad: #B91C1C;
  --dlg-ok: #15803D;
}

/* scroll lock: set by dialog.js while any dialog is open */
html.dlg-lock, html.dlg-lock body { overflow: hidden !important; }

.dlg[hidden] { display: none !important; }
.dlg { position: fixed; inset: 0; z-index: var(--dlg-z); display: flex; align-items: center; justify-content: center; padding: 16px; font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--dlg-text); }
.dlg-backdrop { position: absolute; inset: 0; background: var(--dlg-backdrop); backdrop-filter: none; -webkit-backdrop-filter: none; animation: dlgFade var(--dlg-dur) linear both; }
.dlg-panel { position: relative; display: flex; flex-direction: column; width: min(var(--dlg-w, 480px), 100%); max-height: min(90vh, 760px); overflow: hidden; border-radius: var(--dlg-radius); background: #fff; box-shadow: var(--dlg-shadow); animation: dlgIn var(--dlg-dur) var(--dlg-ease) both; }
.dlg.is-closing .dlg-backdrop { opacity: 0; transition: opacity var(--dlg-dur) linear; animation: none; }
.dlg.is-closing .dlg-panel { opacity: 0; transform: translateY(8px); transition: opacity var(--dlg-dur) linear, transform var(--dlg-dur) var(--dlg-ease); animation: none; }

.dlg-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--dlg-line); background: #fff; }
.dlg-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--dlg-ink); }
.dlg-sub { margin: 2px 0 0; font-size: 13px; font-weight: 400; color: var(--dlg-mute); }
.dlg-x { flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--dlg-mute); font-size: 18px; line-height: 1; cursor: pointer; }
.dlg-x:hover { background: var(--dlg-soft); color: var(--dlg-ink); }
.dlg-x svg { width: 18px; height: 18px; }
.dlg-body { flex: 1 1 auto; min-height: 0; padding: 20px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.dlg-foot { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--dlg-line); background: #fff; }
.dlg-foot > .dlg-btn { flex: 1 1 0; }
.dlg-foot[hidden] { display: none; }

/* buttons: 40px (44px on phones) */
.dlg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 1px solid var(--dlg-line-strong); border-radius: 6px; background: #fff; color: var(--dlg-ink); font: 600 14px/1 inherit; font-family: inherit; text-decoration: none; cursor: pointer; box-shadow: none; }
.dlg-btn:hover { background: var(--dlg-soft); color: var(--dlg-ink); }
.dlg-btn.is-primary { border-color: var(--dlg-brand); background: var(--dlg-brand); color: #fff; }
.dlg-btn.is-primary:hover { border-color: var(--dlg-brand-strong); background: var(--dlg-brand-strong); color: #fff; }
.dlg-btn:disabled, .dlg-btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.dlg-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.dlg-btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: dlgSpin .7s linear infinite; }
.dlg-link { padding: 0; border: 0; background: none; color: var(--dlg-brand-strong); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dlg-link:hover { color: var(--dlg-brand-deep); }
.dlg-btn:focus-visible, .dlg-x:focus-visible, .dlg-link:focus-visible { outline: 2px solid var(--dlg-brand); outline-offset: 2px; }

/* one-line message under a field / at the top of a body */
.dlg-note { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--dlg-line); border-radius: 6px; background: var(--dlg-soft); font-size: 13px; line-height: 1.45; color: var(--dlg-text); }
.dlg-note.is-error { border-color: #FECACA; background: #FEF2F2; color: var(--dlg-bad); }
.dlg-note.is-ok { border-color: #BBF7D0; background: #F0FDF4; color: var(--dlg-ok); }
.dlg-note[hidden] { display: none; }

/* phone: bottom sheet that sits above the bottom nav */
@media (max-width: 767px) {
  .dlg { align-items: flex-end; padding: 0; }
  .dlg-panel { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: var(--dlg-sheet-radius) var(--dlg-sheet-radius) 0 0; animation-name: dlgUp; }
  .dlg.is-closing .dlg-panel { transform: translateY(100%); opacity: 1; }
  .dlg-head { padding-left: 16px; padding-right: 4px; }
  .dlg-body { padding: 16px; }
  .dlg-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .dlg-btn { min-height: 44px; }
  .dlg.is-full .dlg-panel { height: 100%; max-height: 100%; border-radius: 0; }
}

@keyframes dlgFade { from { opacity: 0; } }
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes dlgUp { from { transform: translateY(100%); } }
@keyframes dlgSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .dlg-backdrop, .dlg-panel, .dlg.is-closing .dlg-backdrop, .dlg.is-closing .dlg-panel { animation: none !important; transition: none !important; }
  .dlg-btn.is-loading::after { animation-duration: 1.6s; }
}
