/* ==========================================================================
   Demo layer only — cart panel, checkout dialog, toast, language switch, local search results.
   Same language as the PDP: #FFFFFF / #111111 / #F5F5F5 / #E5E5E5, hairlines, small-caps labels, square corners.
   ========================================================================== */

html.uc-lock { overflow: hidden; }

/* tokens for components that live outside .pdp */
.uc-cart, .uc-modal, .uc-toast {
  --ink: #111111; --line: #e5e5e5; --mute: #6b6b6b; --soft: #8a8a8a; --plate: #f5f5f5;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

/* ---------- toast ---------- */
.uc-toast {
  position: fixed; z-index: 2147483000;
  inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100vw - 32px);
  top: calc(var(--header-h, 64px) + 16px);
  padding: 14px 22px; background: #111; color: #fff; font-size: 13px; line-height: 1.35; text-align: center;
  opacity: 0; transform: translateY(-10px); pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.uc-toast.is-on { opacity: 1; transform: none; }

/* ---------- cart panel ---------- */
.uc-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.4); opacity: 0; transition: opacity 0.25s; }
.uc-scrim.is-on { opacity: 1; }
.uc-scrim[hidden], .uc-cart[hidden] { display: none; }
.uc-cart {
  position: fixed; z-index: 61; inset-block: 0; inset-inline-end: 0;
  width: min(440px, 100vw); display: flex; flex-direction: column;
  background: #fff; color: var(--ink);
  transform: translateX(100%); transition: transform 0.35s var(--ease);
}
[dir="rtl"] .uc-cart { transform: translateX(-100%); }
.uc-cart.is-on { transform: none; }
.uc-cart__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 14px 24px; border-bottom: 1px solid var(--line); }
[dir="rtl"] .uc-cart__head { padding: 14px 24px 14px 20px; }
.uc-cart__head h2 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
[lang="ar"] .uc-cart__head h2 { letter-spacing: 0; text-transform: none; font-size: 14px; }
.uc-x { width: 44px; height: 44px; border: 1px solid var(--ink); background: #fff; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; transition: background-color 0.3s, color 0.3s; }
.uc-x:hover { background: var(--ink); color: #fff; }
.uc-cart__body { flex: 1; overflow-y: auto; padding: 4px 24px; }
.uc-empty { margin: 48px 0; color: var(--mute); font-size: 15px; text-align: center; }
.uc-lines { list-style: none; margin: 0; padding: 0; }
.uc-line { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.uc-line img { width: 72px; height: 90px; object-fit: contain; background: var(--plate); mix-blend-mode: multiply; }
.uc-line__name { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.uc-line__var { margin: 4px 0 0; font-size: 12px; color: var(--mute); }
.uc-line__price { margin: 0; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.uc-line__ctl { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.uc-line__qty { display: inline-flex; align-items: center; border: 1px solid var(--ink); height: 40px; }
.uc-line__qty--static { border: 0; height: auto; font-size: 12px; color: var(--mute); }
.uc-line__qty button { width: 40px; height: 100%; border: 0; background: #fff; color: var(--ink); font-size: 16px; cursor: pointer; transition: background-color 0.25s, color 0.25s; }
.uc-line__qty button:hover { background: var(--ink); color: #fff; }
.uc-line__qty span { min-width: 28px; text-align: center; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.uc-line__rm { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--mute); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 40px; }
.uc-line__rm:hover { color: var(--ink); }
.uc-cart__foot { padding: 20px 24px 24px; border-top: 1px solid var(--ink); display: flex; flex-direction: column; gap: 14px; }
.uc-cart__sum { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; }
.uc-cart__sum b { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.uc-note { margin: 0; font-size: 12px; color: var(--mute); text-align: center; }
.uc-cart .pdp-cta[disabled] { background: var(--plate); border-color: var(--line); color: var(--soft); }

/* ---------- checkout (simulated) ---------- */
dialog.uc-modal { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; color: var(--ink); }
dialog.uc-modal[open] { display: flex; align-items: center; justify-content: center; }
dialog.uc-modal::backdrop { background: rgba(0, 0, 0, 0.5); }
.uc-modal__panel { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff; padding: 0 24px 24px; display: flex; flex-direction: column; gap: 6px; }
.uc-modal__panel .uc-cart__head { margin-inline: -24px; padding-inline: 24px 20px; }
[dir="rtl"] .uc-modal__panel .uc-cart__head { padding-inline: 20px 24px; }
.uc-modal__body { margin: 14px 0 14px; font-size: 14px; line-height: 1.6; color: #333; }
.uc-modal .uc-cart__sum { padding: 16px 0 0; }

/* ---------- header extras ---------- */
.uc-lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 40px; padding: 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: var(--foreground); }
.uc-lang a[lang="ar"] { letter-spacing: 0; font-size: 14px; }
.uc-lang a:hover { text-decoration: underline; text-underline-offset: 4px; }
[data-wishlist-btn].is-on svg { fill: currentColor; }
#mobile-drawer[open] > div { animation: ucFade 0.28s ease both; }
@keyframes ucFade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- local search results (replace the API-backed list; images contained, never cropped) ---------- */
.uc-hit { display: block; width: 240px; flex: none; color: inherit; text-decoration: none; }
.uc-hit__img { display: block; aspect-ratio: 4 / 5; background: #f5f5f5; overflow: hidden; }
.uc-hit__img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform 1s cubic-bezier(0.2, 0.7, 0.1, 1); }
.uc-hit:hover .uc-hit__img img { transform: scale(1.03); }
.uc-hit__name { display: block; margin-top: 12px; font-size: 14px; font-weight: 500; }
.uc-hit__price { display: block; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .uc-cart, .uc-scrim, .uc-toast, .uc-hit__img img { transition: none; }
  #mobile-drawer[open] > div { animation: none; }
}

/* ---------- cart panel → cart page link, cart page lines ---------- */
.uc-viewcart { display: block; padding: 12px 0 0; text-align: center; color: #111; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; }
.uc-lines--page { list-style: none; margin: 0; padding: 0; border-top: 1px solid #111; }
.uc-line--page { display: grid; grid-template-columns: 96px minmax(0, 1fr) 168px 192px; align-items: start; gap: 24px; padding: 28px 0; border-bottom: 1px solid #e5e5e5; }
.uc-line--page .uc-line__img { display: block; background: var(--plate); }
.uc-line--page img { width: 96px; height: 120px; object-fit: contain; mix-blend-mode: multiply; }
.uc-line--page .uc-line__name { font-size: 15px; }
.uc-line--page .uc-line__unit { margin: 8px 0 0; font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.uc-line--page .uc-line__rm { margin-top: 10px; min-height: 0; }
.uc-line--page .uc-line__price { text-align: end; font-size: 16px; font-weight: 600; }
.uc-line__qtycell { display: flex; }
@media (max-width: 767px) {
  .uc-line--page { grid-template-columns: 80px minmax(0, 1fr) auto; gap: 14px 16px; padding: 20px 0; }
  .uc-line--page img { width: 80px; height: 100px; }
  .uc-line--page .uc-line__qtycell { grid-column: 2; grid-row: 2; }
  .uc-line--page .uc-line__price { grid-column: 3; grid-row: 1; }
}
.uc-line__unit { margin: 4px 0 0; }

/* free-shipping progress (drawer + page) */
.uc-ship { padding: 16px 24px 18px; border-bottom: 1px solid var(--line); }
.uc-ship:empty { display: none; }
.uc-ship--page { margin: 20px 0 0; padding: 18px 20px; border: 1px solid #111; }
.uc-ship__msg { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.04em; color: var(--ink); }
.uc-ship__msg b { font-weight: 600; font-variant-numeric: tabular-nums; }
.uc-ship__bar { height: 4px; background: #e5e5e5; }
.uc-ship__bar i { display: block; height: 100%; background: #000; transition: width 0.5s cubic-bezier(0.2, 0.7, 0.1, 1); }

/* drawer polish */
.uc-cart__count { font-weight: 500; color: var(--mute); letter-spacing: 0.04em; margin-inline-start: 6px; }
.uc-cart__ship-note { margin: 0; font-size: 12px; color: var(--mute); }
.uc-empty { padding: 56px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.uc-empty p { margin: 0; font-size: 15px; color: var(--mute); }
.uc-empty .pdp-cta { width: auto; padding-inline: 28px; }
/* ---------- header dropdown panels (native popovers positioned by demo.js) ---------- */
header .uc-dropmenu[popover] { position: fixed; margin: 0; overflow: visible; }
header .uc-dropmenu:not(:popover-open) { display: none; }
