/* ─── Tokens ──────────────────────────────────── */
:root {
  --bg: #F5F0E8; --surface: #fff; --surface-2: #FAF7F2;
  --ink: #1C1916; --ink-soft: #3D3830; --ink-muted: #7A7268; --ink-faint: #C8C1B8;
  --accent: #C9A96B; --accent-dark: #9E7A3A; --accent-light: #F3EAD8;
  --border: #E4DDD3; --border-soft: #EDE8E0;
  --serif: 'Noto Sans Arabic', Arial, Tahoma, serif;
  --sans: 'Noto Sans Arabic', Arial, Tahoma, system-ui, sans-serif;
  --ease: cubic-bezier(.22,1,.36,1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  height: 100%;
}
body {
  min-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--sans); -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  background: var(--bg);
  color: var(--ink);
}
img { display: block; max-width: 100%; background: transparent; color: transparent; }
button { cursor: pointer; font-family: var(--sans); border: none; background: none; -webkit-tap-highlight-color: transparent; }
input, select, textarea { -webkit-appearance: none; appearance: none; font-family: var(--sans); }
a { text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

/* ─── Full-viewport page ──────────────────────── */
#page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: visible;
}
@media (min-width: 720px) {
  #page { flex-direction: row; height: 100dvh; overflow: hidden; position: static; }
}

/* ─── Mobile topbar ───────────────────────────── */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem; height: 54px; flex-shrink: 0;
  background: transparent;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 30;
}
@media (min-width: 720px) { #topbar { display: none; } }
.back-link {
  display: flex; align-items: center; gap: .35rem;
  font-size: .88rem; font-weight: 600; color: var(--ink);
  padding: .5rem 0; transition: color .15s;
  text-shadow: 0 1px 4px rgba(255,255,255,.5);
}
.back-link:hover { color: var(--ink-soft); }
.back-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.top-logo img { height: 32px; width: auto; object-fit: contain; }
.top-logo-txt { font-family: var(--serif); font-size: 1.05rem; letter-spacing: .12em; color: var(--ink); }
.cart-btn {
  position: relative; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,.15); color: #fff;
  transition: background .15s;
}
.cart-btn:hover { background: rgba(0,0,0,.88); }
.cart-btn i { width: 20px; height: 20px; pointer-events: none; }
.badge {
  position: absolute; top: 1px; right: 1px;
  min-width: 17px; height: 17px; border-radius: 99px; padding: 0 3px;
  background: var(--accent-dark); color: #fff;
  font-size: .58rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

/* ─── Gallery panel ───────────────────────────── */
#gallery {
  position: relative;
  width: 100%;
  height: 70vh;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg);
  z-index: 0;
  touch-action: pan-x pan-y;
}
@media (min-width: 720px) {
  #gallery {
    flex: 1 1 0;
    min-width: 0;
    height: 100dvh !important;
    max-height: none;
  }
}

/* Slides strip — CSS Scroll Snap (works natively on iOS Safari) */
#slides {
  display: flex;
  direction: ltr;
  width: 100%;
  height: 100%;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  will-change: scroll-position;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x pan-y;
  cursor: grab;
  margin-bottom: 1px;
}
#slides::-webkit-scrollbar { display: none; }
#slides.grabbing { cursor: grabbing; }

.slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.slide img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  -webkit-user-drag: none;
  display: block;
}
@media (min-width: 720px) {
  .slide img {
    object-fit: contain;
    object-position: center;
  }
}

/* Shimmer skeleton for product image slides */
@keyframes slide-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.slide-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    90deg,
    #F5F0E8 0%,
    #ede6d6 40%,
    #f9f4ea 50%,
    #ede6d6 60%,
    #F5F0E8 100%
  );
  background-size: 1200px 100%;
  animation: slide-shimmer 1.4s infinite linear;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
/* Remove shimmer class once loaded — ::before disappears */


/* Navigation Arrows - Desktop only */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: background .2s, transform .1s;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  border: none;
}
@media (min-width: 720px) {
  .slider-nav {
    display: flex;
  }
}
.slider-nav:hover {
  background: rgba(255,255,255,.9);
  transform: translateY(-50%) scale(1.05);
}
.slider-nav:active {
  transform: translateY(-50%) scale(.95);
}
.slider-nav svg {
  width: 20px;
  height: 20px;
  stroke: var(--ink);
  stroke-width: 2.5;
}
.nav-prev {
  left: 12px;
}
.nav-next {
  right: 12px;
}

/* Dot indicators - moved up for better visibility */
#dots {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  gap: 10px;
  z-index: 10;
  direction: ltr;
  align-items: center;
  padding: 6px 12px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 99px;
}
@media (max-width: 719px) {
  #dots {
    bottom: 22px;
    gap: 8px;
    padding: 5px 10px;
  }
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all .25s ease;
  flex-shrink: 0;
}
.dot.on {
  background: #fff;
  width: 24px;
  border-radius: 99px;
  transform: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Desktop floating back + cart */
.flt-back {
  position: absolute; top: 1.1rem; right: 1.1rem; z-index: 20;
  display: none; align-items: center; gap: .4rem;
  padding: .5rem .95rem; border-radius: 99px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: .82rem; font-weight: 600; color: var(--ink-soft);
  box-shadow: 0 2px 14px rgba(0,0,0,.2); transition: background .15s, color .15s;
}
.flt-back:hover { background: #fff; color: var(--ink); }
.flt-back svg { width: 17px; height: 17px; flex-shrink: 0; }
@media (min-width: 720px) { .flt-back { display: flex; } }

.flt-cart {
  position: absolute; top: 1.1rem; left: 1.1rem; z-index: 20;
  display: none; width: 44px; height: 44px; border-radius: 50%;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 14px rgba(0,0,0,.2); color: var(--ink); transition: background .15s;
}
.flt-cart:hover { background: #fff; }
.flt-cart i { width: 20px; height: 20px; pointer-events: none; }
.flt-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; border-radius: 99px; padding: 0 3px;
  background: var(--accent-dark); color: #fff;
  font-size: .58rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
@media (min-width: 720px) { .flt-cart { display: flex; } }

/* ─── Info panel ──────────────────────────────── */
#info {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 28px rgba(28,25,22,.13);
  margin-top: -16px;
  z-index: 10;
  overflow: visible;
  padding-bottom: 90px;
}
@media (min-width: 720px) {
  #info {
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    width: 400px;
    flex-shrink: 0;
    max-height: 100dvh;
    border-radius: 0;
    margin-top: 0;
    box-shadow: -6px 0 28px rgba(0,0,0,.07);
    border-right: 1px solid var(--border-soft);
    transition: none;
    padding-bottom: 0;
  }
}
#info::-webkit-scrollbar { display: none; }
#info { scrollbar-width: none; }

.info-inner {
  padding: 1rem 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
@media (min-width: 720px) { .info-inner { padding: 2rem 1.6rem 2rem; gap: .85rem; } }

/* Name + category row */
@media (max-width: 719px) {
  .name-cat-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
  }
  .name-cat-row .p-name { flex: 1; }
  .name-cat-row .p-cat  { flex-shrink: 0; padding-top: .15rem; text-align: end; }
}

.p-cat {
  font-size: .64rem; font-weight: 700; letter-spacing: .3em;
  text-transform: uppercase; color: var(--accent-dark);
}
.p-name {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 700; line-height: 1.22; color: var(--ink);
}
.p-price {
  font-size: 1.3rem; font-weight: 700;
  color: var(--accent-dark); letter-spacing: .01em;
}
.p-desc { font-size: .88rem; color: var(--ink-soft); line-height: 1.85; }

.sz.sz-highlight {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(201,169,107,.45) !important;
  animation: sz-pulse 0.55s ease 2;
}
@keyframes sz-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(201,169,107,.7); }
  60%  { box-shadow: 0 0 0 7px rgba(201,169,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,169,107,0); }
}

/* Section label */
.lbl {
  font-size: .64rem; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-muted); margin-bottom: .5rem;
}

/* Size buttons */
.sz-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.sz {
  position: relative; overflow: hidden;
  min-width: 46px; padding: .44rem .95rem;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: .85rem; font-weight: 500;
  background: var(--surface); color: var(--ink);
  transition: border-color .08s, background .08s, color .08s, transform .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
}
.sz:hover:not(.sz-na):not(.sz-on) { border-color: var(--ink-soft); background: var(--bg); }
.sz.sz-on,
.sz.sz-on:focus,
.sz.sz-on:active,
.sz.sz-on:hover {
  background: var(--ink) !important;
  color: #fff !important;
  border-color: var(--ink) !important;
  box-shadow: 0 2px 12px rgba(28,25,22,.22);
  transform: scale(1.06);
}
.sz.sz-na {
  color: var(--ink-faint); border-color: var(--border-soft);
  cursor: not-allowed; pointer-events: none;
}
.sz.sz-na::before,
.sz.sz-na::after {
  content: ''; position: absolute;
  top: 50%; left: 5%; width: 90%; height: 1.5px;
  background: var(--ink-faint); transform-origin: center;
}
.sz.sz-na::before { transform: translateY(-50%) rotate(18deg); }
.sz.sz-na::after  { transform: translateY(-50%) rotate(-18deg); }

/* Qty */
.qty-ctrl {
  display: flex; align-items: center; overflow: hidden;
  border: 1.5px solid var(--border); border-radius: 7px; direction: ltr;
  width: fit-content;
}
.qb {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 600; color: var(--ink-muted);
  background: var(--surface); transition: background .12s, color .12s;
}
.qb:hover { background: var(--bg); color: var(--ink); }
.qv {
  min-width: 44px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: .92rem; font-weight: 700; color: var(--ink);
  background: var(--surface-2);
  border-left: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft);
}

/* Status note */
.s-note { font-size: .78rem; color: var(--ink-muted); font-style: italic; text-align: center; }

/* Action buttons */
.actions { display: flex; flex-direction: column; gap: .45rem; margin-top: .2rem; }

/* ─── Mobile fixed bottom action bar ─────────── */
@media (max-width: 719px) {
  /* Hide the inline .actions inside the info panel on mobile */
  #info .actions { display: none; }

  /* Fixed bar at bottom of screen */
  #mobileActions {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    background: var(--surface);
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -4px 20px rgba(28,25,22,.12);
    padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: .45rem;
  }
}
@media (min-width: 720px) {
  #mobileActions { display: none; }
}
.btn-add {
  width: 100%; min-height: 2.85rem;
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  background: var(--ink); color: #fff;
  font-size: .9rem; font-weight: 600; letter-spacing: .05em;
  border-radius: 99px; box-shadow: 0 4px 18px rgba(28,25,22,.2);
  transition: background .18s, transform .12s, box-shadow .18s;
  -webkit-tap-highlight-color: transparent;
}
.btn-add:hover:not(:disabled) { background: #2a2722; transform: translateY(-1px); }
.btn-add:active:not(:disabled) { transform: scale(.98); }
.btn-add:disabled { opacity: .35; cursor: not-allowed; }
.btn-add svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-order {
  width: 100%; min-height: 2.85rem;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #9E7A3A 0%, #C9A96B 45%, #E8C87A 65%, #9E7A3A 100%);
  background-size: 200% 100%;
  color: #1C1916;
  font-size: .9rem; font-weight: 700; letter-spacing: .08em;
  border-radius: 99px;
  box-shadow: 0 4px 20px rgba(201,169,107,.45), 0 1px 3px rgba(0,0,0,.18);
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
  transition: background-position .4s var(--ease), transform .12s, box-shadow .18s;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid rgba(255,255,255,.15);
}
.btn-order:hover:not(:disabled) {
  background-position: 100% 0;
  box-shadow: 0 6px 28px rgba(201,169,107,.6), 0 2px 6px rgba(0,0,0,.2);
  transform: translateY(-1px);
}
.btn-order:active:not(:disabled) { transform: scale(.98); }
.btn-order:disabled { opacity: .35; cursor: not-allowed; }

.badge.badge-pop, .flt-badge.badge-pop {
  animation: badge-pop .35s var(--ease);
}
@keyframes badge-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.55); }
  100% { transform: scale(1); }
}

/* ─── Loading ─────────────────────────────────── */
#loading {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; background: var(--bg); z-index: 999;
}
.spin {
  width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ───────────────────────────────────── */
#toasts {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; width: max-content; max-width: calc(100vw - 2rem);
}
.toast {
  background: var(--ink); color: #fff;
  padding: .75rem 1.4rem; border-radius: 99px;
  font-size: .84rem; font-weight: 500;
  box-shadow: 0 8px 28px rgba(28,25,22,.22);
  opacity: 0; transform: translateY(-10px) scale(.96);
  transition: all .3s; text-align: center;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: #c0392b; }
.toast.ok  { background: #1da851; }

/* ─── Cart sidebar ────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(28,25,22,.5); z-index: 1400;
  opacity: 0; visibility: hidden;
  transition: opacity .32s, visibility .32s;
  backdrop-filter: blur(2px);
}
.overlay.open { opacity: 1; visibility: visible; }
#cartOverlay {
  position: fixed; inset: 0;
  background: rgba(28,25,22,.5); z-index: 1400;
  opacity: 0; visibility: hidden;
  transition: opacity .32s, visibility .32s;
  backdrop-filter: blur(2px);
}
#cartOverlay.open { opacity: 1; visibility: visible; }
.sidebar {
  position: fixed; top: 0; right: 0;
  width: min(420px, 100vw); height: 100%;
  background: var(--surface); z-index: 1500;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .36s cubic-bezier(.22,1,.36,1);
  box-shadow: -8px 0 40px rgba(28,25,22,.17);
}
.sidebar.open { transform: translateX(0); }
#cartSidebar {
  position: fixed; top: 0; right: 0;
  width: min(420px, 100vw); height: 100%;
  background: var(--surface); z-index: 1500;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .36s cubic-bezier(.22,1,.36,1);
  box-shadow: -8px 0 40px rgba(28,25,22,.17);
}
#cartSidebar.open { transform: translateX(0); }
.cart-head {
  background: linear-gradient(160deg, #1a1714 0%, #2d2924 100%);
  padding: 1.05rem 1.15rem .95rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: space-between;
  color: #fff; flex-shrink: 0;
}
.cart-head h2 { font-size: 1rem; font-weight: 600; }
.ix {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; transition: background .18s;
}
.ix:hover { background: rgba(255,255,255,.2); }
.ix i { width: 16px; height: 16px; pointer-events: none; }
.fields-wrap { padding: .75rem 1.1rem .65rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cfields { display: flex; flex-direction: column; gap: .4rem; }
.cfields input {
  padding: .68rem .9rem; border: 1.5px solid var(--border);
  border-radius: 7px; background: var(--bg);
  font-size: .84rem; color: var(--ink); direction: rtl;
  transition: border-color .18s; outline: none; font-family: var(--sans); width: 100%;
}
.cfields input:focus { border-color: var(--ink-soft); }
.cfields input::placeholder { color: var(--ink-faint); }
.cart-body { flex: 1; overflow-y: auto; padding: .65rem 1.1rem; display: flex; flex-direction: column; }
.cart-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .65rem; color: var(--ink-muted); padding: 2rem 0; font-size: .88rem;
}
.cart-empty i { width: 36px; height: 36px; opacity: .3; }
.ci { display: flex; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--border-soft); direction: rtl; }
.ci-img { width: 54px; height: 68px; object-fit: cover; border-radius: 7px; flex-shrink: 0; }
.ci-det { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .24rem; }
.ci-name { font-size: .82rem; font-weight: 600; color: var(--ink); }
.ci-sz   { font-size: .7rem; color: var(--ink-muted); }
.ci-bot  { display: flex; align-items: center; justify-content: space-between; gap: .35rem; margin-top: auto; }
.ci-pr   { font-size: .78rem; font-weight: 700; color: var(--accent-dark); }
.ci-qty  { display: flex; align-items: center; border: 1px solid var(--border-soft); border-radius: 6px; overflow: hidden; }
.cqb { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: .88rem; color: var(--ink-muted); background: var(--surface); }
.cqb:hover { background: var(--bg); color: var(--ink); }
.cqv { min-width: 24px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: .74rem; font-weight: 600; background: var(--surface-2); border-left: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); }
.ci-rm {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: #fde8e8; color: #c0392b;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.ci-rm:hover { background: #c0392b; color: #fff; }
.ci-rm svg { width: 14px; height: 14px; }
.cart-foot {
  padding: .8rem 1.1rem; border-top: 1px solid var(--border); flex-shrink: 0;
  display: flex; flex-direction: column; gap: .45rem;
}
.cart-tot { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; font-weight: 600; direction: rtl; }
#totP { color: var(--accent-dark); font-size: .96rem; }
.wa-btn {
  width: 100%; padding: .85rem; background: #25d366; color: #fff;
  font-size: .86rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  border-radius: 12px; box-shadow: 0 4px 18px rgba(37,211,102,.28);
  transition: background .18s, transform .12s; font-family: var(--sans);
}
.wa-btn:hover { background: #1fbe5c; transform: translateY(-1px); }
.wa-btn:active { transform: scale(.98); }

.order-btn {
  width: 100%; padding: .85rem; color: #1C1916;
  font-size: .88rem; font-weight: 700; letter-spacing: .06em;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #9E7A3A 0%, #C9A96B 45%, #E8C87A 65%, #9E7A3A 100%);
  background-size: 200% 100%;
  box-shadow: 0 4px 20px rgba(201,169,107,.4), inset 0 1px 0 rgba(255,255,255,.2);
  text-shadow: 0 1px 0 rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.12);
  transition: background-position .4s var(--ease), transform .12s, box-shadow .18s;
  font-family: var(--sans);
}
.order-btn:hover { background-position: 100% 0; box-shadow: 0 6px 28px rgba(201,169,107,.55); transform: translateY(-1px); }
.order-btn:active { transform: scale(.98); }

/* Better Back button visibility */
.back-link {
  display: flex; align-items: center; gap: .4rem;
  background: var(--ink) !important; color: #fff !important;
  border-radius: 99px; padding: 0.5rem 1.1rem !important;
  font-size: .84rem; font-weight: 600; text-shadow: none !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
  transition: background .15s, color .15s, transform .1s; z-index: 20;
}
.flt-back {
  background: var(--ink) !important; color: #fff !important;
  border-radius: 99px; padding: 0.5rem 1.1rem !important;
  font-size: .84rem; font-weight: 600; text-shadow: none !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
  transition: background .15s, color .15s, transform .1s;
}
.back-link svg, .flt-back svg {
  width: 17px; height: 17px; flex-shrink: 0; stroke: #fff !important;
}
.back-link:hover, .flt-back:hover {
  background: var(--ink-soft) !important; color: #fff !important; transform: translateY(-1px);
}
.back-link:active, .flt-back:active { transform: scale(0.96); }

/* Fix iOS Auto-Zoom on cart inputs inside product view */
input[type="text"], 
input[type="tel"], 
.checkout-fields input,
.cfields input,
#cartSidebar input {
    font-size: 16px !important;
}

/* ─── Mobile scroll fix ───────────────────────── */
@media (max-width: 719px) {
  html {
    height: 100% !important;
    overflow: visible !important;
  }
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #productView {
    height: auto !important;
    min-height: unset !important;
    overflow: visible !important;
  }
  #page {
    height: auto !important;
    min-height: unset !important;
    overflow: visible !important;
  }
  #info {
    height: auto !important;
    overflow: visible !important;
  }
}


/* ─── productView is the scroll container in overlay mode ──── */
#productView {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* ─── Cart item styles (matching main.css classes used by store.js / product.js) ─── */
.cart-item {
  display: flex;
  gap: .8rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--border-soft);
  direction: rtl;
  align-items: flex-start;
}
.cart-item-sold-out { opacity: .55; }
.cart-item-img {
  width: 58px; height: 74px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.cart-item-details {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: .22rem;
}
.cart-item-name {
  font-size: .84rem; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.cart-item-sold-out-badge {
  font-size: .6rem; font-weight: 700; letter-spacing: .05em;
  background: #c0392b; color: #fff;
  padding: .15rem .45rem; border-radius: 4px;
}
.cart-item-meta { font-size: .72rem; color: var(--ink-muted); }
.cart-item-bottom {
  display: flex; align-items: center;
  justify-content: space-between; gap: .35rem;
  margin-top: .3rem;
}
.cart-item-price { font-size: .82rem; font-weight: 700; color: var(--accent-dark); }

/* Qty controls inside cart */
.cart-qty-controls {
  display: flex; align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 6px; overflow: hidden;
}
.cart-qty-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: var(--ink-muted);
  background: var(--surface); transition: background .12s, color .12s;
}
.cart-qty-btn:hover { background: var(--bg); color: var(--ink); }
.cart-qty-val {
  min-width: 26px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: .76rem; font-weight: 700; color: var(--ink);
  background: var(--surface-2);
  border-left: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
}

/* Remove button */
.cart-remove {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: #fde8e8; color: #c0392b;
  transition: background .15s, color .15s;
}
.cart-remove:hover { background: #c0392b; color: #fff; }
.cart-remove svg { width: 14px; height: 14px; pointer-events: none; }

/* Cart empty state */
.cart-empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .65rem; color: var(--ink-muted);
  padding: 3rem 0; font-size: .88rem; text-align: center;
}
.cart-empty-state i { width: 38px; height: 38px; opacity: .25; }

/* Cart body scrollable area */
.cart-body {
  flex: 1; overflow-y: auto; padding: .5rem 1.1rem;
  display: flex; flex-direction: column;
  -webkit-overflow-scrolling: touch;
}
.cart-body::-webkit-scrollbar { width: 4px; }
.cart-body::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 99px; }

/* Checkout fields */
.checkout-fields {
  display: flex; flex-direction: column; gap: .4rem;
}
.checkout-fields input[type="tel"] { direction: ltr; text-align: right; }
.checkout-fields input {
  padding: .68rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 16px; /* prevents iOS zoom */
  color: var(--ink);
  direction: rtl;
  outline: none;
  font-family: var(--sans);
  width: 100%;
  transition: border-color .18s;
}
.checkout-fields input:focus { border-color: var(--ink-soft); }
.checkout-fields input::placeholder { color: var(--ink-faint); }

/* Cart foot (contains fields) */
.cart-foot {
  padding: .75rem 1.1rem .65rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Cart total row */
.cart-total-row {
  display: flex; justify-content: space-between;
  align-items: center; font-size: .9rem; font-weight: 600;
  direction: rtl; margin-bottom: .65rem;
}
#cartTotal { color: var(--accent-dark); font-size: .96rem; }

/* Cart count label */
.cart-count-label { font-weight: 400; font-size: .9rem; color: rgba(255,255,255,.6); }

/* Checkout bottom area */
.cart-checkout-bottom {
  padding: .75rem 1.1rem calc(.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); flex-shrink: 0;
  display: flex; flex-direction: column; gap: .5rem;
}

/* WhatsApp button */
.whatsapp-btn {
  width: 100%; padding: .82rem;
  background: #25d366; color: #fff;
  font-size: .88rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(37,211,102,.28);
  transition: background .18s, transform .12s;
  font-family: var(--sans);
}
.whatsapp-btn:hover { background: #1fbe5c; transform: translateY(-1px); }
.whatsapp-btn:active { transform: scale(.98); }
.whatsapp-btn svg { flex-shrink: 0; }

/* Telegram / order button */
.telegram-btn {
  width: 100%; padding: .82rem;
  color: #1C1916;
  font-size: .88rem; font-weight: 700; letter-spacing: .06em;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #9E7A3A 0%, #C9A96B 45%, #E8C87A 65%, #9E7A3A 100%);
  background-size: 200% 100%;
  box-shadow: 0 4px 18px rgba(201,169,107,.4);
  text-shadow: 0 1px 0 rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.12);
  transition: background-position .4s var(--ease), transform .12s;
  font-family: var(--sans);
}
.telegram-btn:hover { background-position: 100% 0; transform: translateY(-1px); }
.telegram-btn:active { transform: scale(.98); }
.telegram-btn:disabled { opacity: .4; cursor: not-allowed; }

/* icon-btn (close button in cart header) */
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff;
  transition: background .18s;
}
.icon-btn:hover { background: rgba(255,255,255,.22); }
.icon-btn i { width: 16px; height: 16px; pointer-events: none; }

/* Status Badge in Detail View */
.status-badge-detail {
  position: absolute;
  top: 4rem;
  right: 1.5rem;
  z-index: 100;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 100px;
  padding: 4px 12px;
  color: #fff;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (max-width: 480px) {
  .status-badge-detail {
    top: 3.2rem;
    right: 0.8rem;
    font-size: 0.55rem;
    padding: 3px 7px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  }
}