/* Basket editor: search, categories, product cards, basket dock. */
/* ---------- search & products ---------- */
.search {
  display: flex; align-items: center; gap: var(--s2); background: var(--surface); border-radius: var(--r-pill);
  padding: 0 var(--s4); min-height: 54px; box-shadow: var(--shadow), inset 0 0 0 2px transparent; transition: box-shadow .2s;
}
.search:focus-within { box-shadow: var(--shadow), inset 0 0 0 2px var(--purple-300); }
.search svg { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 16px; padding: 14px 0; }
.search .clear { border: 0; background: var(--lilac-50); border-radius: 50%; width: 28px; height: 28px; font-weight: 800; color: var(--purple); }
.cats { display: flex; gap: var(--s2); overflow-x: auto; padding: 2px; margin: 0 -2px; }
.cats::-webkit-scrollbar { display: none; }
.cat { border: 0; flex: none; border-radius: var(--r-pill); padding: 8px 14px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 700; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.cat[aria-pressed="true"] { background: var(--purple); color: #fff; box-shadow: none; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.tile { border: 0; background: var(--surface); border-radius: var(--r); padding: var(--s3) 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--shadow); min-width: 0; position: relative; }
.tile .e { font-size: 34px; line-height: 1.1; filter: drop-shadow(0 5px 5px rgba(0,0,0,.12)); }
.tile .l { font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .in { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--purple); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }

.plist { display: grid; gap: var(--s2); }
.pcard { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: var(--s3); display: flex; align-items: center; gap: var(--s3); }
.pcard .img { width: 56px; height: 56px; border-radius: 14px; background: var(--lilac-50); display: grid; place-items: center; font-size: 32px; flex: none; }
.pcard .meta { flex: 1; min-width: 0; }
.pcard .nm { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
/* brand · size: wraps to a second line rather than hiding the size behind a long company name */
.pcard .br { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; overflow-wrap: anywhere; }
.pcard .pr { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.pcard .pr b { color: var(--ink); }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--lilac-50); border-radius: var(--r-pill); padding: 3px; flex: none; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); color: var(--purple); font-size: 20px; font-weight: 800; line-height: 1; box-shadow: 0 1px 3px rgba(60,30,140,.12); }
.stepper .q { min-width: 24px; text-align: center; font-weight: 800; }
.add-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--purple); color: #fff; font-size: 24px; font-weight: 800; flex: none; box-shadow: 0 6px 14px rgba(101, 37, 245, .3); }
.add-btn:active { transform: scale(.92); }
.empty-res { text-align: center; color: var(--ink-2); padding: var(--s6) 0; }

/* ---------- basket dock ---------- */
.dock {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); width: 100%; max-width: 440px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: var(--s3) max(16px, env(safe-area-inset-right, 0px)) var(--s3) max(16px, env(safe-area-inset-left, 0px));
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -10px 24px rgba(60, 30, 140, .08);
}
.dock .bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s2); }
.dock .bar b { font-size: 16px; }
.dock .thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: var(--s2); }
.dock .thumbs::-webkit-scrollbar { display: none; }
.dock .th { flex: none; position: relative; width: 46px; height: 46px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 24px; }
.dock .th small { position: absolute; bottom: -4px; inset-inline-end: -4px; background: var(--ink); color: #fff; font-size: 10.5px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.bump { animation: bump .35s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* Generic name in the UI language above the Hebrew product name (ar/ru/en) */
.pcard .term { font-size: 12px; font-weight: 700; color: var(--purple); line-height: 1.2; }
/* Arabic glyphs are taller than Hebrew/Latin: more line height so clamped labels are not clipped */
html[lang="ar"] .tile .l { line-height: 1.5; display: block; -webkit-line-clamp: unset; overflow: visible; }

/* Basket summary: the bar opens every line with +/- (ui.dockOpen) */
.dock .bar { width: 100%; border: 0; background: none; padding: 0; text-align: start; }
.dock .bar:disabled { cursor: default; }
.dock-edit { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--purple); flex: none; }
.dock-edit .chev svg { width: 16px; height: 16px; transition: transform .15s; }
.dock-edit .chev.up svg { transform: rotate(180deg); }
.dock-list { list-style: none; margin: 0 0 var(--s2); padding: 0; max-height: 42vh; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.dock-list .dl { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--r-sm); padding: 8px 10px; box-shadow: var(--shadow); }
.dock-list .e { font-size: 22px; flex: none; }
.dock-list .d { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dock-list .term { font-size: 11.5px; font-weight: 700; color: var(--purple); }
.dock-list .nm { font-size: 13.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.dock-list .stepper { flex: none; }

/* sizes and packs of one product (productCard) */
.pcard .sizes, .choice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.choice-row .q { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.pcard .size, .choice-row .size { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: var(--r-pill);
  padding: 3px 10px; font: inherit; font-size: 12.5px; line-height: 1.4; cursor: pointer; min-height: 28px; }
.pcard .size[aria-pressed="true"], .choice-row .size[aria-pressed="true"] { border-color: var(--purple); background: var(--lilac-50); color: var(--purple-600); font-weight: 700; }