/* Shared widgets: photo lightbox, searchable select, small helpers.
   No :has() / color-mix() on purpose - guests' older phones don't support them. */

.u-dim { opacity: .6; }
.ml8 { margin-left: 8px; }
.ml24 { margin-left: 24px; }

/* ── Lightbox ─────────────────────────────────────────────── */
.lb-thumb { display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; background-color: var(--cream2); background-size: cover; background-position: center; position: relative; }
.lb-thumb:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.lb-thumb:hover { filter: brightness(.94); }
.lb-thumb .lb-count { position: absolute; right: 8px; bottom: 8px; background: rgba(11,11,12,.7); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; }

.lb { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 3000; background: rgba(11,11,12,.94); display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 56px 64px; }
.lb[hidden] { display: none; }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; max-width: 100%; max-height: 100%; min-height: 80px; min-width: 80px; }
.lb-img { display: block; max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #111; }
.lb-img.is-loading { opacity: .25; }
.lb-cap { color: #f2f2f2; font-size: 14px; line-height: 1.5; text-align: center; margin-top: 14px; max-width: 720px; }
.lb-count { color: #bdbdc2; font-size: 12px; margin-top: 6px; letter-spacing: .04em; }
.lb-btn { position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-close { top: 14px; right: 14px; font-size: 28px; }
.lb-prev { left: 12px; top: 50%; margin-top: -23px; }
.lb-next { right: 12px; top: 50%; margin-top: -23px; }
.lb-single .lb-prev, .lb-single .lb-next { display: none; }
@media (max-width: 640px) {
  .lb { padding: 56px 8px 24px; }
  .lb-img { max-height: calc(100vh - 170px); }
  .lb-prev, .lb-next { top: auto; bottom: 14px; margin-top: 0; }
  .lb-prev { left: 14px; }
  .lb-next { right: 14px; }
}

/* ── Searchable select ────────────────────────────────────── */
.combo { position: relative; }
.combo-input { width: 100%; padding-right: 34px; }
.combo-caret { position: absolute; right: 12px; top: 50%; margin-top: -4px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--muted); pointer-events: none; }
.combo-list { position: absolute; z-index: 60; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.combo-list[hidden] { display: none; }
.combo-opt { padding: 9px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.combo-opt.is-active, .combo-opt:hover { background: var(--cream2); }
.combo-opt[aria-selected="true"] { font-weight: 700; }
.combo-opt mark { background: transparent; color: var(--gold2); font-weight: 700; }
.combo-empty { padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* ── Supplier store ───────────────────────────────────────── */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pcard-media { position: relative; aspect-ratio: 4 / 3; background: var(--cream2); }
.pcard-media .lb-thumb { height: 100%; width: 100%; aspect-ratio: auto; }
.pcard-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 12px; }
.pcard-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard-more { position: absolute; left: 8px; bottom: 8px; background: rgba(11,11,12,.7); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; pointer-events: none; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.qty button { width: 34px; height: 34px; border: 0; background: var(--cream); font-size: 18px; line-height: 1; cursor: pointer; }
.qty button:hover { background: var(--cream2); }
.qty input { width: 44px; text-align: center; border: 0; font: inherit; font-size: 14px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.store-cart { position: sticky; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(11,11,12,.08); padding: 12px 16px; margin: 24px -16px 0; }
.pimg { position: relative; display: inline-block; margin: 0 8px 8px 0; }
.pimg img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; display: block; border: 2px solid transparent; }
.pimg.is-cover img { border-color: var(--gold); }
.pimg form { display: inline; }
.pimg-actions { display: flex; gap: 6px; margin-top: 4px; font-size: 11px; }
.u-block { display: block; color: inherit; text-decoration: none; }
