/*! ms-swipe 1.0.0 | 2026-11-17 | ms-swipe.css | MarketShuk swipe drawer | built from src/ms-swipe.css, readable on purpose */
/* ms-swipe · styles for the standalone swipe deck (see ms-swipe.js).

   Isolation rules followed in this file
   · every selector starts with .mssw-drawer and every class on our elements starts with mssw- (state flags is-* are
     only ever used together with a .mssw- class);
   · component rules have specificity (0,2,0) or more, so a host rule such as `button {}` or `.x button {}` cannot
     win; `.mssw-drawer *` resets what element selectors of a host page usually touch;
   · no !important, no @keyframes, no global selectors, custom properties live on .mssw-drawer and never on :root;
   · colours: only the site palette, read from the host tokens (--paper, --ink, ...) with the MarketShuk values as
     fallback, so the host's high-contrast mode recolours the drawer too;
   · no `inset`, no flexbox `gap`, no `aspect-ratio`, no logical inset properties (iOS 14.0 lacks them); `dvh` and
     `:focus-visible` are used only as progressive enhancement over a working fallback. */

.mssw-drawer {
  --mssw-paper: var(--paper, #FAF8F3);
  --mssw-paper-2: var(--paper-2, #F1EDE4);
  --mssw-ink: var(--ink, #1E1B16);
  --mssw-ink-2: var(--ink-2, #5C554B);
  --mssw-line: var(--line, #E3DCCF);
  --mssw-olive: var(--olive, #5B6B3A);
  --mssw-olive-soft: var(--olive-soft, #E9EDDD);
  --mssw-ease: cubic-bezier(.2, .7, .2, 1);

  box-sizing: border-box;
  /* Sticky, not relative: when the host column itself is taller than the screen (the host "large text" mode zooms the
     body), the drawer stays at the bottom edge of the screen instead of sliding under it. Otherwise it changes nothing. */
  position: relative; position: -webkit-sticky; position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-direction: column;
  float: none; margin: 0; width: auto; min-width: 0; max-width: none;
  /* About a third of the screen. Content may push it taller (large text), it is never clipped. */
  min-height: 250px;
  min-height: calc(clamp(250px, 36vh, 330px) + env(safe-area-inset-bottom, 0px));
  max-height: calc(100vh - var(--mssw-top, 104px));
  padding: 0 12px 10px;
  padding: 0 max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  overflow: hidden;
  background: var(--mssw-paper);
  color: var(--mssw-ink);
  border: 0; border-top: 1px solid var(--mssw-line); border-radius: 0;
  box-shadow: 0 -6px 18px rgba(30, 27, 22, .10);
  font-family: inherit; font-size: 16px; font-weight: 400; font-style: normal; line-height: 1.4;
  letter-spacing: normal; text-transform: none; text-indent: 0; text-shadow: none; text-align: right; white-space: normal; word-spacing: normal;
  direction: rtl;
  cursor: auto; visibility: visible; opacity: 1; transform: none;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  /* Touches on the drawer never pan or zoom the page: no chat scroll, no rubber band, no pull to refresh. */
  touch-action: none;
  overscroll-behavior: contain;
}
@supports (height: 1dvh) {
  .mssw-drawer {
    min-height: calc(clamp(250px, 36dvh, 330px) + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - var(--mssw-top, 104px));
  }
}
.mssw-drawer.is-expanded { height: 420px; height: clamp(420px, 68vh, 620px); }
@supports (height: 1dvh) { .mssw-drawer.is-expanded { height: clamp(420px, 68dvh, 620px); } }
.mssw-drawer.is-full { height: 100%; min-height: 0; max-height: none; border-top: 0; box-shadow: none; padding-top: 10px; }
/* Last resort when the content is taller than the screen (text at 200% on a small phone): the drawer itself scrolls. */
.mssw-drawer.is-overflow { overflow-y: auto; touch-action: pan-y; }
/* The script trims the height when the drawer would stick out of its mount (a host header taller than --mssw-top). */

/* Reset: neutralises element selectors of the host page (button, h2, h3, p, img, svg, small, strong, b, span). */
.mssw-drawer *, .mssw-drawer *::before, .mssw-drawer *::after { box-sizing: border-box; }
.mssw-drawer * {
  margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0;
  width: auto; height: auto; min-width: 0; min-height: 0; max-width: none; max-height: none; float: none; position: static;
  background: none; box-shadow: none; text-shadow: none;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; text-decoration: none; text-align: inherit; text-indent: 0;
  white-space: inherit; vertical-align: baseline; opacity: 1; visibility: inherit; transform: none; transition: none; animation: none;
  -webkit-appearance: none; appearance: none;
}
/* Our four kinds of button, above any `.something button {}` rule of the host. */
.mssw-drawer .mssw-handle, .mssw-drawer .mssw-x, .mssw-drawer .mssw-qty, .mssw-drawer .mssw-btn {
  margin: 0; padding: 0; border: 0; float: none; min-width: 0; box-shadow: none; text-decoration: none; text-transform: none; letter-spacing: normal;
  font-family: inherit; font-style: normal; -webkit-appearance: none; appearance: none; -webkit-user-select: none; user-select: none;
}
.mssw-drawer [hidden] { display: none; }
.mssw-drawer .mssw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.mssw-drawer .mssw-ic { display: block; flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }

/* Focus: visible for keyboard users. :focus-visible where the browser has it; elsewhere the script adds is-kbd on
   the first key press inside the drawer. Each selector is its own rule: an unknown pseudo-class voids a whole list. */
.mssw-drawer:focus { outline: 0; }
.mssw-drawer :focus-visible { outline: 2px solid var(--mssw-olive); outline-offset: 2px; }
.mssw-drawer.is-kbd :focus { outline: 2px solid var(--mssw-olive); outline-offset: 2px; }

/* Handle. The grip is a border, so it survives forced colours. The hit area reaches down over the title row. */
.mssw-drawer .mssw-handle { position: relative; z-index: 1; flex: none; display: block; width: 100%; height: 14px; background: transparent; cursor: pointer; }
.mssw-drawer .mssw-handle::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 44px; }
.mssw-drawer .mssw-grip { display: block; width: 44px; height: 0; margin: 5px auto 0; border-top: 4px solid var(--mssw-line); border-radius: 999px; }

/* Title row: title over the counter on the right, status badge, close button fixed at the left. The badge drops to
   a second line only when it truly cannot fit (very large text). */
.mssw-drawer .mssw-head { position: relative; flex: none; display: flex; flex-wrap: wrap; align-items: center; min-height: 38px; padding-left: 40px; }
.mssw-drawer .mssw-title { flex: 1 1 4.5em; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; }
.mssw-drawer .mssw-title-t { max-width: 100%; font-size: 1em; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mssw-drawer .mssw-count { font-size: .8125em; line-height: 1.3; color: var(--mssw-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mssw-drawer .mssw-status { flex: 0 1 auto; max-width: 100%; margin: 2px 8px 2px 0; padding: 2px 10px; border: 1px solid transparent; border-radius: 999px; background: var(--mssw-olive-soft); color: var(--mssw-ink); font-size: .8125em; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; text-align: center; }
.mssw-drawer .mssw-status:empty { display: none; }
/* Close: a 32px circle inside a 44px target that reaches into the drawer padding. */
.mssw-drawer .mssw-x { position: absolute; top: 50%; left: -6px; z-index: 2; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-top: -22px; background: transparent; cursor: pointer; }
/* The target is a square; the focus ring goes on the visible circle. */
.mssw-drawer .mssw-x:focus { outline: 0; }
.mssw-drawer .mssw-x:focus-visible { outline: 0; }
.mssw-drawer .mssw-x:focus-visible .mssw-x-i { outline: 2px solid var(--mssw-olive); outline-offset: 2px; }
.mssw-drawer.is-kbd .mssw-x:focus .mssw-x-i { outline: 2px solid var(--mssw-olive); outline-offset: 2px; }
.mssw-drawer .mssw-x-i { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--mssw-line); border-radius: 999px; background: var(--mssw-paper); }
.mssw-drawer .mssw-x .mssw-ic { width: 16px; height: 16px; }
.mssw-drawer .mssw-x:active .mssw-x-i { background: var(--mssw-paper-2); }

/* Deck. The top card is in the flow, so its content decides the height; the cards under it only fill the same box. */
.mssw-drawer .mssw-deck { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; min-height: auto; margin-top: 6px; padding-bottom: 8px; }
.mssw-drawer .mssw-card {
  position: absolute; top: 0; right: 0; bottom: 8px; left: 0;
  display: grid; grid-template-columns: 42% minmax(0, 1fr);
  border: 1px solid var(--mssw-line); border-radius: 12px;
  background: var(--mssw-paper); overflow: hidden;
  box-shadow: 0 1px 2px rgba(30, 27, 22, .06);
  transform-origin: 50% 140%;
  transition: transform 240ms var(--mssw-ease), opacity 240ms var(--mssw-ease);
  -webkit-user-select: none; user-select: none;
}
.mssw-drawer .mssw-card.is-top { position: relative; top: auto; right: auto; bottom: auto; left: auto; flex: 1 1 auto; z-index: 3; box-shadow: 0 2px 8px rgba(30, 27, 22, .12), 0 1px 2px rgba(30, 27, 22, .06); cursor: grab; }
/* The two cards underneath peek out by 4px each. Horizontal scale only, so their lower edge stays inside the deck
   whatever the card height; an opaque band hides the half lines of text that would show in that strip. */
.mssw-drawer .mssw-card.is-next { z-index: 2; transform: translateY(4px) scaleX(.96); }
.mssw-drawer .mssw-card.is-third { z-index: 1; transform: translateY(8px) scaleX(.92); }
.mssw-drawer .mssw-card.is-next::after, .mssw-drawer .mssw-card.is-third::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; z-index: 3; height: 10px; background: var(--mssw-paper); }
/* will-change only while a card actually moves: the layer is released as soon as the class goes. */
.mssw-drawer .mssw-card.is-drag { transition: none; will-change: transform; cursor: grabbing; }
.mssw-drawer .mssw-card.is-fly { z-index: 4; pointer-events: none; will-change: transform, opacity; }
.mssw-drawer .mssw-card:focus { outline: 0; }
.mssw-drawer .mssw-card:focus-visible { outline: 2px solid var(--mssw-olive); outline-offset: 2px; }
.mssw-drawer.is-kbd .mssw-card:focus { outline: 2px solid var(--mssw-olive); outline-offset: 2px; }

.mssw-drawer .mssw-img { position: relative; overflow: hidden; background: var(--mssw-paper-2); }
.mssw-drawer .mssw-photo { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.mssw-drawer .mssw-ph { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; font-size: .8125em; color: var(--mssw-ink-2); }
.mssw-drawer .mssw-incart, .mssw-drawer .mssw-out { position: absolute; right: 6px; max-width: calc(100% - 12px); padding: 2px 8px; border: 1px solid transparent; border-radius: 999px; font-size: .75em; font-weight: 600; line-height: 1.3; }
.mssw-drawer .mssw-incart { bottom: 6px; background: var(--mssw-olive-soft); color: var(--mssw-ink); }
.mssw-drawer .mssw-incart:empty { display: none; }
.mssw-drawer .mssw-out { top: 6px; background: var(--mssw-paper); color: var(--mssw-ink-2); border-color: var(--mssw-line); }

.mssw-drawer .mssw-info { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 8px 12px; overflow: hidden; }
.mssw-drawer .mssw-name { max-width: 100%; font-size: 1.0625em; font-weight: 700; line-height: 1.25; letter-spacing: -0.012em; overflow-wrap: anywhere; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mssw-drawer .mssw-price { max-width: 100%; overflow-wrap: anywhere; margin-top: 3px; font-size: 1em; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.mssw-drawer .mssw-unit { display: inline; font-size: .8125em; font-weight: 500; color: var(--mssw-ink-2); }
/* Quantity pill: 32px tall to the eye, 44px to the finger. */
.mssw-drawer .mssw-qty {
  position: relative; flex: none; display: inline-flex; align-items: center; max-width: 100%;
  margin-top: 5px; min-height: 32px; padding: 4px 10px;
  border: 1px solid var(--mssw-line); border-radius: 999px; background: var(--mssw-paper);
  font-size: .8125em; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere;
  cursor: pointer;
}
.mssw-drawer .mssw-qty::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; min-width: 44px; margin-top: -22px; }
.mssw-drawer .mssw-qty.is-static { cursor: inherit; border-color: transparent; padding-right: 0; padding-left: 0; min-height: 0; }
.mssw-drawer .mssw-qty.is-static::after { content: none; }
.mssw-drawer .mssw-qty .mssw-ic { width: 12px; height: 12px; margin-right: 6px; color: var(--mssw-ink-2); }
.mssw-drawer .mssw-qty:active { background: var(--mssw-paper-2); }
.mssw-drawer .mssw-detail { display: none; }

.mssw-drawer .mssw-stamp { position: absolute; top: 8px; z-index: 2; padding: 2px 10px; border: 2px solid transparent; border-radius: 8px; font-weight: 800; font-size: 1.125em; line-height: 1.3; opacity: 0; pointer-events: none; }
.mssw-drawer .mssw-stamp-add { left: 8px; background: var(--mssw-olive); color: var(--mssw-paper); transform: rotate(-8deg); }
.mssw-drawer .mssw-stamp-skip { right: 8px; background: var(--mssw-paper); color: var(--mssw-ink-2); border-color: var(--mssw-ink-2); transform: rotate(8deg); }

/* Enlarged drawer and full mode: the whole card, photo on top, text below. The text block scrolls when it is long. */
.mssw-drawer.is-expanded .mssw-deck, .mssw-drawer.is-full .mssw-deck { min-height: 0; }
.mssw-drawer.is-expanded .mssw-card, .mssw-drawer.is-full .mssw-card { display: flex; flex-direction: column; }
.mssw-drawer.is-expanded .mssw-card.is-top, .mssw-drawer.is-full .mssw-card.is-top { min-height: 0; }
.mssw-drawer.is-expanded .mssw-img, .mssw-drawer.is-full .mssw-img { flex: 1 0 38%; min-height: 110px; }
.mssw-drawer.is-expanded .mssw-info, .mssw-drawer.is-full .mssw-info { flex: 0 1 auto; display: block; padding: 10px 14px 12px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mssw-drawer.is-expanded .mssw-info.is-scroll, .mssw-drawer.is-full .mssw-info.is-scroll { touch-action: pan-y; }
.mssw-drawer.is-expanded .mssw-name, .mssw-drawer.is-full .mssw-name { font-size: 1.25em; -webkit-line-clamp: 3; }
.mssw-drawer.is-expanded .mssw-qty, .mssw-drawer.is-full .mssw-qty { margin-top: 8px; }
.mssw-drawer.is-expanded .mssw-detail, .mssw-drawer.is-full .mssw-detail { display: block; margin-top: 8px; font-size: .875em; line-height: 1.45; color: var(--mssw-ink-2); -webkit-user-select: none; user-select: none; }
.mssw-drawer .mssw-p { margin: 0 0 4px; }
.mssw-drawer .mssw-b { display: inline; color: var(--mssw-olive); font-weight: 700; }

.mssw-drawer .mssw-end { position: absolute; top: 0; right: 0; bottom: 8px; left: 0; z-index: 0; display: flex; flex-direction: column; justify-content: center; padding: 12px 16px; border: 1px dashed var(--mssw-line); border-radius: 12px; }
.mssw-drawer .mssw-end[hidden] { display: none; }
.mssw-drawer .mssw-end-t { display: block; font-size: 1.0625em; font-weight: 800; line-height: 1.3; }
.mssw-drawer .mssw-end-row { display: flex; flex-wrap: wrap; margin: 4px -4px -4px; }
.mssw-drawer .mssw-end-row .mssw-btn { margin: 4px; }
/* With no card left the closing panel takes the place of the top card in the flow and keeps the height. */
.mssw-drawer .mssw-end:not([hidden]) { position: relative; top: auto; right: auto; bottom: auto; left: auto; flex: 1 1 auto; min-height: 118px; }

.mssw-drawer .mssw-ctl { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); grid-gap: 8px; gap: 8px; }
.mssw-drawer .mssw-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 6px 12px; border: 1px solid var(--mssw-line); border-radius: 10px; background: var(--mssw-paper); color: var(--mssw-ink); font-size: 1em; font-weight: 600; line-height: 1.2; text-align: center; white-space: normal; cursor: pointer; transition: background-color 120ms var(--mssw-ease); }
.mssw-drawer .mssw-btn:active { background: var(--mssw-paper-2); }
.mssw-drawer .mssw-btn.is-primary { background: var(--mssw-ink); border-color: var(--mssw-ink); color: var(--mssw-paper); }
.mssw-drawer .mssw-btn.is-primary:active { background: var(--mssw-ink-2); border-color: var(--mssw-ink-2); }
.mssw-drawer .mssw-btn[disabled] { opacity: .4; cursor: default; }
.mssw-drawer .mssw-btn.is-sm { min-height: 44px; font-size: .875em; }
.mssw-drawer .mssw-add .mssw-ic { margin-left: 8px; }
.mssw-drawer .mssw-skip .mssw-ic { margin-right: 8px; }
.mssw-drawer .mssw-undo { padding: 0; }

/* Narrow phones (320 to 359 px): a little less padding so the three columns of the title row still fit. */
@media (max-width: 359px) {
  .mssw-drawer .mssw-info { padding: 8px 10px; }
  .mssw-drawer .mssw-status { padding: 2px 8px; margin-right: 6px; }
}

/* Landscape phones: the screen is short, so the buttons move beside the card instead of under it. */
@media (orientation: landscape) and (max-height: 480px) {
  .mssw-drawer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(184px, 30%); grid-template-rows: auto auto minmax(0, 1fr); min-height: 186px; min-height: calc(186px + env(safe-area-inset-bottom, 0px)); max-height: calc(100vh - var(--mssw-top, 104px)); padding-bottom: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .mssw-drawer.is-expanded { height: calc(100vh - var(--mssw-top, 104px)); }
  .mssw-drawer .mssw-handle, .mssw-drawer .mssw-head { grid-column: 1 / -1; }
  .mssw-drawer .mssw-deck { grid-column: 1; grid-row: 3; min-height: 121px; margin-top: 4px; padding-bottom: 6px; }
  .mssw-drawer .mssw-card { bottom: 6px; }
  .mssw-drawer .mssw-ctl { grid-column: 2; grid-row: 3; align-self: center; margin: 4px 8px 6px 0; grid-template-columns: 46px minmax(0, 1fr); }
  .mssw-drawer .mssw-add { grid-column: 1 / -1; }
  .mssw-drawer .mssw-card { grid-template-columns: 36% minmax(0, 1fr); }
  .mssw-drawer .mssw-info { padding: 6px 10px; }
  .mssw-drawer .mssw-name { font-size: 1em; }
  .mssw-drawer .mssw-price { font-size: .9375em; margin-top: 2px; }
  .mssw-drawer .mssw-qty { margin-top: 3px; }
  .mssw-drawer .mssw-end:not([hidden]) { min-height: 96px; }
  /* Enlarged in landscape: the photo stays beside the text, the text block scrolls. */
  .mssw-drawer.is-expanded .mssw-card, .mssw-drawer.is-full .mssw-card { display: grid; grid-template-rows: minmax(0, 1fr); }
  .mssw-drawer.is-expanded .mssw-img, .mssw-drawer.is-full .mssw-img { min-height: 0; }
  .mssw-drawer.is-expanded .mssw-info, .mssw-drawer.is-full .mssw-info { padding: 8px 12px; }
  .mssw-drawer.is-expanded .mssw-name, .mssw-drawer.is-full .mssw-name { font-size: 1.0625em; }
  .mssw-drawer.is-full { max-height: none; }
}
@supports (height: 1dvh) {
  @media (orientation: landscape) and (max-height: 480px) {
    .mssw-drawer { max-height: calc(100dvh - var(--mssw-top, 104px)); }
    .mssw-drawer.is-expanded { height: calc(100dvh - var(--mssw-top, 104px)); }
    .mssw-drawer.is-full { max-height: none; }
  }
}

/* Nothing animates for people who asked for that. The script checks the same preference before a card flies. */
@media (prefers-reduced-motion: reduce) {
  .mssw-drawer .mssw-card, .mssw-drawer .mssw-btn { transition: none; }
}

/* Forced colours (Windows high contrast): keep edges and states visible with system colours. */
@media (forced-colors: active) {
  .mssw-drawer .mssw-btn, .mssw-drawer .mssw-qty, .mssw-drawer .mssw-x-i, .mssw-drawer .mssw-card { border-color: ButtonBorder; }
  .mssw-drawer .mssw-btn[disabled] { opacity: 1; color: GrayText; border-color: GrayText; }
  .mssw-drawer .mssw-status, .mssw-drawer .mssw-incart, .mssw-drawer .mssw-stamp, .mssw-drawer .mssw-out { border-color: CanvasText; }
  .mssw-drawer :focus-visible { outline-color: Highlight; }
}
