/* =========================================================
   SOLITAIRE 2 · the home page shelf (js/shelf.js). The cabinet photo fills the screen under the header; each product
   stands on its shelf; a tap zooms the cabinet onto it and opens its card (a bottom sheet on phones, a side card on
   computers).
   ========================================================= */
.sh { --sh-edge: #C9B3A3; --sh-ease: cubic-bezier(.6, 0, .2, 1); position: relative; background: var(--sh-edge); overflow: hidden; }
.sh-hint { position: absolute; z-index: 3; left: 50%; top: 12px; transform: translateX(-50%); margin: 0; padding: 7px 14px; border-radius: 999px;
  background: rgba(27, 20, 22, .55); color: #fff; font-size: 12.5px; white-space: nowrap; pointer-events: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: opacity .4s ease; }
.sh.zoomed .sh-hint { opacity: 0; }
.sh-view { position: relative; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.sh-scene { position: absolute; top: 0; left: 0; transform-origin: 0 0; transition: transform .75s var(--sh-ease); will-change: transform; }
.sh-scene.now { transition: none; }
.sh-bg { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* a piece: its base on the shelf line (top = the line), its height a share of the cabinet's height */
.sh-item { position: absolute; transform: translate(-50%, -100%); padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in;
  -webkit-tap-highlight-color: transparent; transition: filter .4s ease, opacity .4s ease; }
.sh-item img { display: block; height: 100%; width: auto; pointer-events: none;
  filter: drop-shadow(0 3px 2px rgba(40, 20, 10, .35)) drop-shadow(0 10px 14px rgba(40, 20, 10, .18)); }
.sh-item:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 6px; }
@media (hover: hover) { .sh:not(.zoomed) .sh-item:hover { filter: brightness(1.08); } }
.sh.zoomed .sh-item:not(.on) { opacity: .55; filter: saturate(.7); }
.sh.zoomed .sh-item.on { cursor: default; }

/* the small price tags on the shelf edge (computers only: on a phone they would be too small to read) */
.sh-tag { position: absolute; transform: translate(-50%, 6px); display: none; padding: 3px 8px 4px; border-radius: 4px; text-align: center;
  font-size: 11px; line-height: 1.25; color: #4A2A22; background: rgba(255, 250, 242, .92); box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
  border: 1px solid rgba(176, 141, 87, .55); white-space: nowrap; pointer-events: none; transition: opacity .4s ease; }
.sh-tag b { display: block; font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: .04em; color: #761C2C; }
.sh[data-layout="d"] .sh-tag { display: block; opacity: 0; transform: translate(-50%, 2px); transition: opacity .25s ease, transform .25s ease; }
.sh[data-layout="d"]:not(.zoomed) .sh-item:hover + .sh-tag, .sh[data-layout="d"]:not(.zoomed) .sh-item:focus-visible + .sh-tag { opacity: 1; transform: translate(-50%, 8px); }
.sh.zoomed .sh-tag { opacity: 0; }

/* the card of the piece in focus */
.sh-panel { position: absolute; z-index: 4; left: 10px; right: 10px; bottom: 10px; padding: 16px 16px 14px; border-radius: 20px;
  background: rgba(255, 251, 246, .94); color: var(--ink); box-shadow: 0 18px 50px rgba(30, 10, 10, .28);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transform: translateY(24px); transition: opacity .35s ease, transform .45s var(--sh-ease); }
.sh-panel.in { opacity: 1; transform: none; }
.sh-panel[hidden] { display: none; }
.sh-panel.swap > :not(.sh-top) { animation: shIn .5s var(--sh-ease) both; }
@keyframes shIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sh-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px -4px 0 0; }
html[dir="rtl"] .sh-top { margin: -4px 0 0 -4px; }
.sh-x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(27, 20, 22, .07); color: var(--ink); cursor: pointer; }
.sh-x svg, .sh-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sh-kind { display: block; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: #8A6B5E; }
html[lang="ar"] .sh-kind { letter-spacing: 0; font-size: 12.5px; }
.sh-name { margin: 2px 0 4px; font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.1; color: #761C2C; }
.sh-short { margin: 0 0 10px; font-size: 13.5px; line-height: 1.55; color: rgba(27, 20, 22, .72);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sh-photos { display: flex; gap: 8px; margin: 0 0 12px; }
.sh-photos a { flex: 0 0 64px; height: 80px; border-radius: 10px; overflow: hidden; background: #EFE6DA; }
.sh-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-buy { display: flex; align-items: center; gap: 8px; }
.sh-price { margin-inline-end: auto; font-size: 18px; font-weight: 600; white-space: nowrap; }
.sh-add, .sh-order { height: 42px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: transform .15s, background .2s; }
.sh-add { border: 1px solid rgba(118, 28, 44, .35); background: transparent; color: #761C2C; }
.sh-order { border: 0; background: #761C2C; color: #fff; }
.sh-add:active, .sh-order:active { transform: scale(.96); }
.sh-add:disabled, .sh-order:disabled { opacity: .45; cursor: not-allowed; }
@media (hover: hover) { .sh-add:hover:not(:disabled) { background: rgba(118, 28, 44, .07); } .sh-order:hover:not(:disabled) { background: #5E1522; } }
.sh-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(27, 20, 22, .08); }
.sh-nav button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(27, 20, 22, .12); background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.sh-more { font-size: 13.5px; color: #761C2C; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
/* the arrows point the way the pieces move (left to right in both languages) */
html[dir="rtl"] .sh-nav { flex-direction: row-reverse; }

@media (max-width: 359px) { .sh-add { padding: 0 12px; } .sh-order { padding: 0 12px; } .sh-name { font-size: 24px; } }

/* computers: the card sits on the right of the cabinet */
.sh[data-layout="d"] .sh-panel { left: auto; right: 4%; top: 50%; bottom: auto; width: 380px; transform: translate(24px, -50%); }
.sh[data-layout="d"] .sh-panel.in { transform: translate(0, -50%); }
.sh[data-layout="d"] .sh-short { -webkit-line-clamp: 4; }
.sh[data-layout="d"] .sh-photos a { flex-basis: 96px; height: 120px; }
.sh[data-layout="d"] .sh-hint { top: 18px; font-size: 13.5px; }

@media (prefers-reduced-motion: reduce) {
  .sh-scene, .sh-panel, .sh-item { transition: none; }
  .sh-panel.swap > :not(.sh-top) { animation: none; }
}
