/* ============================================================
   Storefront stylesheet — mobile-first, app-like experience
   Palette : ink #101828 / surface #f5f6fa / primary #5b3df5
             CTA tangerine gradient #ff6b2c → #ff3d68
   Fonts   : Alexandria (display) + IBM Plex Sans Arabic (body)
   ============================================================ */

:root {
  --ink: #101828;
  --ink-2: #475467;
  --line: #e7e9f2;
  --surface: #f5f6fa;
  --card: #ffffff;
  --primary: #5b3df5;
  --primary-soft: #efeaff;
  --cta1: #ff6b2c;
  --cta2: #ff3d68;
  --green: #12b76a;
  --radius: 18px;
  --shadow: 0 8px 28px rgba(16, 24, 40, .09);
  --font-display: 'Alexandria', sans-serif;
  --font-body: 'IBM Plex Sans Arabic', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.65;
  padding-bottom: 90px; /* room for the mobile bottom nav */
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.35; }

/* ---------- Tap feedback: no oversized browser flash, just a subtle
   contained press exactly the size of the element ---------- */
button, a, select, .opt-chip, .qty-btn, .cat-chip, .p-thumb, .sum-remove {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;             /* also removes the 300ms tap delay */
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
.opt-chip:focus:not(:focus-visible) { outline: none; }
button:active, .opt-chip:active, .qty-btn:active,
.cat-chip:active, .btn-add-sim:active, .sum-remove:active {
  transform: scale(.96);
  transition: transform .08s ease;
}
.btn-order:active { transform: scale(.98); }

/* ---------- Announcement bar ---------- */
.announce-bar {
  background: linear-gradient(90deg, #101828, #2a1d63);
  color: #fff; font-size: .8rem; padding: 8px 14px;
  text-align: center; overflow: hidden; white-space: nowrap;
}
.announce-bar span { display: inline-block; animation: marquee 14s linear infinite; }
@keyframes marquee { 0% {transform: translateX(-30%);} 100% {transform: translateX(30%);} }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #8b6bff);
  border-radius: 13px; font-size: 1.2rem;
  box-shadow: 0 6px 14px rgba(91,61,245,.35);
}
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; }
.header-actions { display: flex; gap: 8px; }
.hdr-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); transition: .2s;
}
.hdr-btn:active { transform: scale(.92); background: var(--primary-soft); }

.page { max-width: 1100px; margin: 0 auto; padding: 14px 14px 40px; }

/* ---------- Slider ---------- */
.slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.slider-track { display: flex; transition: transform .55s cubic-bezier(.7,0,.3,1); }
.slide {
  flex: 0 0 100%; min-height: 200px; background-size: cover; background-position: center;
  display: flex; align-items: flex-end; position: relative;
}
.slide::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,12,30,.75), transparent 60%);
}
.slide-overlay { position: relative; padding: 22px; color: #fff; }
.slide-overlay h2 { font-size: 1.35rem; font-weight: 900; }
.slide-overlay p { font-size: .85rem; opacity: .9; }
.slider-dots {
  position: absolute; bottom: 10px; left: 14px; display: flex; gap: 5px;
}
.slider-dots i {
  width: 7px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.45);
  transition: .3s;
}
.slider-dots i.on { width: 20px; background: #fff; }

/* Static hero when no sliders exist */
.hero-static {
  background:
    radial-gradient(600px 300px at 80% -20%, rgba(139,107,255,.5), transparent),
    linear-gradient(135deg, #101828, #2a1d63);
  color: #fff; border-radius: var(--radius); padding: 44px 22px; text-align: center;
  box-shadow: var(--shadow);
}
.hero-static h1 { font-size: 1.7rem; font-weight: 900; margin-bottom: 6px; }
.hero-static p { opacity: .85; font-size: .92rem; margin-bottom: 18px; }
.btn-hero {
  display: inline-block; padding: 12px 30px; border-radius: 99px;
  background: linear-gradient(90deg, var(--cta1), var(--cta2));
  color: #fff; font-weight: 700; box-shadow: 0 10px 22px rgba(255,80,80,.4);
}

/* ---------- Search ---------- */
.search-box {
  margin: 14px 0 4px; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; color: var(--ink-2);
}
.search-box input { border: 0; outline: 0; flex: 1; font-family: inherit; font-size: .95rem; background: none; }

/* ---------- Sections ---------- */
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-size: 1.2rem; font-weight: 900; position: relative; padding-right: 14px; }
.section-head h2::before {
  content: ''; position: absolute; right: 0; top: 6px; bottom: 6px; width: 5px;
  border-radius: 6px; background: linear-gradient(var(--cta1), var(--cta2));
}
.section-count { font-size: .78rem; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }

/* ---------- Categories ---------- */
.cats-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.cats-row::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 99px;
  padding: 9px 16px; font-size: .87rem; font-weight: 600; transition: .2s;
}
.cat-chip .cat-ico { font-size: 1rem; }
.cat-chip.active, .cat-chip:active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 8px 18px rgba(91,61,245,.35);
}

/* ---------- Product cards grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); transition: .25s; display: flex; flex-direction: column;
}
.card:active { transform: scale(.97); }
.card-img { position: relative; aspect-ratio: 1; overflow: hidden; background: #eef0f6; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
.card:hover .card-img img { transform: scale(1.06); }
.card-off {
  position: absolute; top: 10px; right: 10px; font-size: .7rem; font-weight: 800;
  background: linear-gradient(90deg, var(--cta1), var(--cta2)); color: #fff;
  border-radius: 99px; padding: 4px 10px; box-shadow: 0 4px 10px rgba(255,60,90,.4);
}
.card-badge {
  position: absolute; bottom: 10px; right: 10px; font-size: .68rem; font-weight: 700;
  background: rgba(16,24,40,.8); color: #fff; backdrop-filter: blur(4px);
  border-radius: 8px; padding: 3px 9px;
}
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-cat { font-size: .68rem; color: var(--primary); font-weight: 700; }
.card-title {
  font-size: .88rem; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.card-price-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.card-price { font-weight: 900; color: var(--ink); font-size: 1rem; font-family: var(--font-display); }
.card-old { font-size: .75rem; color: #98a2b3; }
.card-cta {
  margin-top: 8px; text-align: center; font-size: .82rem; font-weight: 800;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 11px; padding: 9px; transition: .2s;
}
.card:hover .card-cta { background: var(--primary); color: #fff; }

/* ---------- Trust ---------- */
.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 30px; }
.trust {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px;
}
.trust span { font-size: 1.5rem; }
.trust b { font-size: .78rem; }
.trust small { font-size: .66rem; color: var(--ink-2); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-2); }
.empty-ico { font-size: 3rem; margin-bottom: 8px; }
.btn-ghost {
  display: inline-block; margin-top: 14px; padding: 10px 26px; border-radius: 99px;
  border: 1.5px solid var(--primary); color: var(--primary); font-weight: 700; font-size: .88rem;
}

/* ============================================================
   PRODUCT LANDING PAGE
   ============================================================ */
.product-landing { display: flex; flex-direction: column; gap: 18px; }

.p-main-wrap {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.p-main-img { width: 100%; aspect-ratio: 1; object-fit: cover; animation: imgIn .5s ease; }
@keyframes imgIn { from { opacity: 0; transform: scale(1.03);} to { opacity: 1; transform: none;} }
.p-off-badge {
  position: absolute; top: 14px; right: 14px; font-weight: 900; font-size: .8rem;
  background: linear-gradient(90deg, var(--cta1), var(--cta2)); color: #fff;
  padding: 7px 14px; border-radius: 99px; box-shadow: 0 6px 16px rgba(255,60,90,.45);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.07);} }
.p-badge {
  position: absolute; top: 14px; left: 14px; font-size: .72rem; font-weight: 700;
  background: rgba(16,24,40,.85); color: #fff; border-radius: 9px; padding: 5px 11px;
}
.p-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.p-thumbs::-webkit-scrollbar { display: none; }
.p-thumb {
  flex: 0 0 64px; height: 64px; border-radius: 12px; overflow: hidden;
  border: 2px solid transparent; opacity: .65; transition: .2s;
}
.p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.p-thumb.active { border-color: var(--primary); opacity: 1; }

.p-info { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.p-cat { font-size: .72rem; font-weight: 800; color: var(--primary); background: var(--primary-soft); border-radius: 99px; padding: 4px 12px; }
.p-title { font-size: 1.35rem; font-weight: 900; margin: 10px 0 6px; }
.p-price-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.p-price { font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; color: var(--ink); }
.p-old { color: #98a2b3; font-size: .95rem; }
.p-save { font-size: .72rem; font-weight: 800; color: #b42318; background: #fee4e2; border-radius: 99px; padding: 4px 11px; }
.p-short { color: var(--ink-2); font-size: .92rem; margin-bottom: 12px; }
.p-perks { display: flex; gap: 8px; flex-wrap: wrap; }
.p-perks span {
  font-size: .72rem; font-weight: 600; background: #ecfdf3; color: #067647;
  border-radius: 99px; padding: 5px 11px;
}

/* Variant options */
.p-opt { margin-top: 16px; }
.p-opt > label { display: block; font-weight: 800; font-size: .86rem; margin-bottom: 8px; }
.opt-row { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-chip {
  padding: 9px 18px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 700; font-size: .85rem; transition: .18s;
  display: flex; align-items: center; gap: 7px;
}
.opt-chip .dot { width: 15px; height: 15px; border-radius: 99px; border: 1px solid rgba(0,0,0,.15); }
.opt-chip.active {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary);
  box-shadow: 0 4px 12px rgba(91,61,245,.2);
}
.qty-box {
  display: inline-flex; align-items: center; gap: 18px;
  border: 1.5px solid var(--line); border-radius: 13px; padding: 6px 10px; background: #fff;
}
.qty-box button {
  width: 34px; height: 34px; border-radius: 10px; background: var(--surface);
  font-size: 1.2rem; font-weight: 800; transition: .15s;
}
.qty-box button:active { background: var(--primary); color: #fff; }
#qtyVal { font-weight: 900; font-size: 1.1rem; min-width: 22px; text-align: center; }

/* ---------- Order card ---------- */
.order-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 2px solid var(--primary); box-shadow: 0 14px 40px rgba(91,61,245,.16);
  scroll-margin-top: 80px;
}
.order-head {
  background: linear-gradient(120deg, #2a1d63, var(--primary));
  color: #fff; padding: 18px; text-align: center;
}
.order-head h2 { font-size: 1.1rem; font-weight: 900; }
.order-head p { font-size: .78rem; opacity: .85; }
.order-card form { padding: 18px; display: flex; flex-direction: column; gap: 13px; }

.order-summary { padding: 14px 18px 0; display: flex; flex-direction: column; gap: 8px; }
.sum-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); border-radius: 12px; padding: 9px 12px; font-size: .82rem;
  animation: slideIn .3s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none;} }
.sum-item b { font-weight: 700; }
.sum-item small { color: var(--ink-2); display: block; font-size: .7rem; }
.sum-remove { color: #d92d20; font-weight: 800; font-size: 1rem; padding: 2px 8px; }

/* Floating-label fields */
.field { position: relative; }
.field input, .field textarea, .field select {
  width: 100%; padding: 15px 14px 13px; border: 1.5px solid var(--line);
  border-radius: 13px; font-family: inherit; font-size: .95rem; background: #fff;
  outline: none; transition: .2s; color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91,61,245,.12);
}
.field label {
  position: absolute; top: 14px; right: 14px; color: #98a2b3; font-size: .9rem;
  pointer-events: none; transition: .18s; background: #fff; padding: 0 5px;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  top: -9px; font-size: .72rem; color: var(--primary); font-weight: 700;
}
.field.err input, .field.err textarea, .field.err select { border-color: #f04438; }

.order-total-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border-radius: 13px; padding: 13px 15px; font-size: .95rem;
}
.order-total-row b { font-family: var(--font-display); font-size: 1.3rem; color: var(--primary); }

/* CTA button with shimmer */
.btn-order {
  position: relative; overflow: hidden;
  background: linear-gradient(90deg, var(--cta1), var(--cta2));
  color: #fff; font-weight: 900; font-size: 1.05rem; font-family: var(--font-display);
  border-radius: 15px; padding: 16px; box-shadow: 0 12px 28px rgba(255,70,90,.4);
  transition: .2s;
}
.btn-order:active { transform: scale(.97); }
.btn-order::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 55px;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.45), transparent);
  animation: shimmer 2.4s infinite; left: -70px;
}
@keyframes shimmer { to { left: 120%; } }
.btn-order[disabled] { opacity: .6; pointer-events: none; }
.order-note { text-align: center; font-size: .72rem; color: var(--ink-2); }

/* Success state */
.order-success { padding: 40px 20px; text-align: center; }
.success-anim {
  width: 82px; height: 82px; margin: 0 auto 16px; border-radius: 99px;
  background: var(--green); color: #fff; font-size: 2.6rem; font-weight: 900;
  display: grid; place-items: center; animation: pop .5s cubic-bezier(.6,1.6,.4,1);
  box-shadow: 0 14px 34px rgba(18,183,106,.4);
}
@keyframes pop { from { transform: scale(0);} to { transform: scale(1);} }
.order-success h3 { font-size: 1.15rem; margin-bottom: 8px; }
.order-success p { color: var(--ink-2); font-size: .88rem; }

/* Description */
.p-desc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.p-desc h2 { font-size: 1.05rem; margin-bottom: 10px; }
.desc-body { color: var(--ink-2); font-size: .92rem; }

/* Similar products */
.sim-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.sim-row::-webkit-scrollbar { display: none; }
.sim-card {
  flex: 0 0 160px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
}
.sim-img { aspect-ratio: 1; overflow: hidden; background: #eef0f6; display: block; }
.sim-img img { width: 100%; height: 100%; object-fit: cover; }
.sim-body { padding: 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.sim-body h3 {
  font-size: .78rem; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em;
}
.sim-price { font-weight: 900; font-size: .9rem; font-family: var(--font-display); }
.btn-add-sim {
  margin-top: auto; background: var(--primary-soft); color: var(--primary);
  font-weight: 800; font-size: .78rem; border-radius: 10px; padding: 8px; transition: .2s;
}
.btn-add-sim.added { background: var(--green); color: #fff; }

/* ---------- Shipping row inside the order summary ---------- */
.order-ship-row { border-bottom: 1px dashed var(--line); font-size: .88rem; }
.order-ship-row small { color: var(--ink2); font-weight: 600; }

/* ---------- Bottom navigation (app-like) ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 55;
  display: flex; background: rgba(255,255,255,.92); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #98a2b3; font-size: .64rem; font-weight: 700; padding: 5px 0; border-radius: 12px;
  transition: .2s;
}
.bn-item.active { color: var(--primary); }
.bn-item.active svg { filter: drop-shadow(0 3px 6px rgba(91,61,245,.4)); }
.bn-item:active { transform: scale(.9); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center; padding: 34px 20px 20px; color: var(--ink-2); font-size: .82rem;
}
.footer-brand { font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; color: var(--ink); }
.footer-copy { font-size: .7rem; margin-top: 6px; opacity: .7; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 95px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; border-radius: 99px; padding: 11px 22px;
  font-size: .84rem; font-weight: 600; opacity: 0; pointer-events: none;
  transition: .3s; z-index: 99; white-space: nowrap; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Desktop layout
   ============================================================ */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .slide { min-height: 340px; }
  .slide-overlay h2 { font-size: 2rem; }
  .hero-static { padding: 70px 30px; }
  .hero-static h1 { font-size: 2.4rem; }

  .product-landing {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start;
  }
  .p-gallery { position: static; }   /* no sticky: it caused content to overlap the image */
  .order-card, .p-desc, .similar-sec { grid-column: 1 / -1; }
  .order-card { max-width: 640px; margin: 0 auto; width: 100%; }
  .order-card form { padding: 24px; }
  .sim-card { flex-basis: 200px; }
  .p-title { font-size: 1.7rem; }
  .p-price { font-size: 2rem; }
}
