/* File: C:\Users\am964\Projects\RashaStores\css\style.css
   Rasha Stores — shop page styles. Colors come from the logo:
   ivory paper, soft gold watercolor, deep navy-black lettering. */

:root {
  --ivory: #FBF8F2;
  --paper: #FFFFFF;
  --sand: #F3ECDD;
  --gold: #C9A54C;
  --gold-deep: #A9852F;
  --gold-soft: #EADBB4;
  --ink: #14142B;
  --ink-soft: #4A4A5E;
  --line: #E7DECB;
  --danger: #B3261E;
  --ok: #2E7D32;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 20, 43, 0.08);
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Jost", system-ui, "Segoe UI", sans-serif;
  --font-ar: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-ar); }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(251, 248, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-inline-end: auto; min-width: 0; }
.brand img { width: 42px; height: 42px; border-radius: 50%; }
.brand-name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.45rem;
  letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[lang="ar"] .brand-name { font-family: var(--font-ar); letter-spacing: 0; text-transform: none; font-weight: 700; font-size: 1.25rem; }
.main-nav { display: flex; gap: 22px; }
.main-nav a { text-decoration: none; color: var(--ink-soft); font-size: 0.95rem; }
.main-nav a:hover { color: var(--ink); }
.pill-btn {
  border: 1px solid var(--gold); background: transparent; border-radius: 999px;
  padding: 6px 14px; font-size: 0.9rem; font-weight: 500; white-space: nowrap;
}
.pill-btn:hover { background: var(--gold-soft); }
.bag-btn {
  position: relative; border: 0; background: var(--ink); color: var(--ivory);
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
}
.bag-btn svg { width: 20px; height: 20px; }
.bag-count {
  position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 0.72rem; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--ivory);
}
.bag-count.bump { animation: bump 0.35s ease; }
@keyframes bump { 50% { transform: scale(1.3); } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 48px 0 36px; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(201,165,76,0.28), rgba(201,165,76,0.05) 60%, transparent 70%);
  pointer-events: none;
}
html[dir="rtl"] .hero::before { inset: -30% auto auto -10%; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 32px; align-items: center; }
.eyebrow { color: var(--gold-deep); font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase; margin: 0 0 10px; }
html[lang="ar"] .eyebrow { letter-spacing: 0; font-size: 0.95rem; }
.hero h1 {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(2.3rem, 5.5vw, 4rem);
  line-height: 1.05; margin: 0 0 14px;
}
html[lang="ar"] .hero h1 { font-family: var(--font-ar); font-weight: 700; line-height: 1.3; font-size: clamp(2rem, 5vw, 3.2rem); }
.hero p.lead { color: var(--ink-soft); max-width: 46ch; margin: 0 0 22px; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 12px 22px; font-weight: 500; text-decoration: none; border: 1px solid transparent;
}
.btn-primary { background: var(--ink); color: var(--ivory); }
.btn-primary:hover { background: #262648; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-deep); color: #fff; }
.btn-ghost { border-color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--ivory); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-whatsapp { background: #1F7A4D; color: #fff; width: 100%; }
.btn-whatsapp:hover { background: #17643e; }
.btn-whatsapp svg { width: 20px; height: 20px; }
.hero-logo { justify-self: center; width: min(320px, 70vw); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; box-shadow: var(--shadow); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; color: var(--ink-soft); font-size: 0.92rem; }
.hero-badges span { display: inline-flex; align-items: center; gap: 6px; }
.hero-badges svg { width: 16px; height: 16px; color: var(--gold-deep); }

/* ---------- Shop ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0; }
html[lang="ar"] .section-title { font-family: var(--font-ar); font-weight: 700; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 8px 16px; font-size: 0.92rem; white-space: nowrap;
}
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ivory); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.card {
  background: var(--paper); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  display: flex; flex-direction: column; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 3 / 4; background: var(--sand); border: 0; padding: 0; width: 100%; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .no-photo { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold-deep); }
.card-media .no-photo img { width: 40%; height: auto; opacity: 0.6; border-radius: 50%; }
.badge {
  position: absolute; top: 10px; inset-inline-start: 10px; background: rgba(20,20,43,0.85); color: #fff;
  font-size: 0.75rem; padding: 4px 10px; border-radius: 999px;
}
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { margin: 0; font-size: 1.02rem; font-weight: 500; line-height: 1.35; }
.card-title button { all: unset; cursor: pointer; }
.card-title button:focus-visible { outline: 2px solid var(--gold-deep); }
.card-price { font-weight: 600; color: var(--gold-deep); font-size: 1.05rem; }
.card-sizes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 6px; }
.size-tag { font-size: 0.75rem; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--ink-soft); }
.size-tag.out { text-decoration: line-through; opacity: 0.5; }
.card .btn { margin-top: 10px; padding: 10px 16px; font-size: 0.92rem; }

.state { text-align: center; color: var(--ink-soft); padding: 48px 16px; }
.skeleton { background: linear-gradient(90deg, var(--sand), #fbf6ea, var(--sand)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); aspect-ratio: 3/4.6; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Story / Find us ---------- */
.story { background: var(--paper); border-block: 1px solid var(--line); }
.story-inner { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 36px; align-items: center; }
.story-quote { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.25; margin: 0; color: var(--ink); }
html[lang="ar"] .story-quote { font-family: var(--font-ar); font-weight: 500; line-height: 1.6; }
.story-years { display: flex; gap: 14px; margin-top: 18px; }
.story-years div { border-inline-start: 2px solid var(--gold); padding-inline-start: 10px; }
.story-years strong { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }
.story-years span { font-size: 0.85rem; color: var(--ink-soft); }
.story p { color: var(--ink-soft); margin: 0 0 12px; }

.find-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.find-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.find-card h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.find-card h3 svg { width: 20px; height: 20px; color: var(--gold-deep); }
.find-card p { margin: 0; color: var(--ink-soft); }
.find-card a.btn { margin-top: auto; align-self: flex-start; padding: 9px 18px; font-size: 0.9rem; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.site-footer { padding: 28px 0 40px; text-align: center; color: var(--ink-soft); font-size: 0.88rem; }
.site-footer img { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 10px; }

/* ---------- Product dialog ---------- */
dialog { border: 0; padding: 0; background: transparent; color: inherit; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(20, 20, 43, 0.55); backdrop-filter: blur(2px); }
.product-dialog { width: min(920px, 100% - 24px); margin: auto; }
.product-panel {
  background: var(--paper); border-radius: 18px; overflow: hidden; display: grid;
  grid-template-columns: 1fr 1fr; max-height: min(92vh, 760px);
}
.gallery { background: var(--sand); position: relative; display: flex; flex-direction: column; min-height: 0; }
.gallery-main { flex: 1; min-height: 0; aspect-ratio: 3/4; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: var(--paper); }
.thumbs button { flex: none; width: 56px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--sand); }
.thumbs button[aria-current="true"] { border-color: var(--gold); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 26px 26px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog-close {
  position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,0.92); display: grid; place-items: center; box-shadow: var(--shadow);
}
.dialog-close svg { width: 18px; height: 18px; }
.product-info h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; line-height: 1.15; margin: 0; padding-inline-end: 40px; }
html[lang="ar"] .product-info h2 { font-family: var(--font-ar); font-weight: 700; font-size: 1.5rem; line-height: 1.5; }
.product-info .price { font-size: 1.35rem; font-weight: 600; color: var(--gold-deep); }
.product-info .desc { color: var(--ink-soft); white-space: pre-line; margin: 0; }
.option-label { font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; display: block; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  min-width: 46px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper);
  font-size: 0.92rem;
}
.opt:hover:not(:disabled) { border-color: var(--gold); }
.opt[aria-pressed="true"] { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.opt:disabled { text-decoration: line-through; opacity: 0.45; cursor: not-allowed; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { border: 0; background: transparent; width: 36px; height: 36px; font-size: 1.1rem; }
.qty button:hover { background: var(--sand); }
.qty output { min-width: 28px; text-align: center; font-weight: 600; }
.form-error { color: var(--danger); font-size: 0.88rem; min-height: 1.2em; margin: 0; }
.add-row { display: flex; gap: 12px; align-items: center; margin-top: auto; padding-top: 6px; }
.add-row .btn { flex: 1; }

/* ---------- Bag drawer ---------- */
.bag-dialog { margin: 0; margin-inline-start: auto; height: 100%; max-height: 100dvh; width: min(420px, 100%); }
.bag-panel { background: var(--ivory); height: 100dvh; display: flex; flex-direction: column; }
.bag-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.bag-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; }
html[lang="ar"] .bag-head h2 { font-family: var(--font-ar); font-size: 1.35rem; }
.icon-btn { border: 0; background: transparent; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn:hover { background: var(--sand); }
.icon-btn svg { width: 20px; height: 20px; }
.bag-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.bag-item { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bag-item img, .bag-item .ph { width: 70px; height: 90px; object-fit: cover; border-radius: 8px; background: var(--sand); }
.bag-item h3 { margin: 0 0 2px; font-size: 0.95rem; font-weight: 500; }
.bag-item .meta { font-size: 0.82rem; color: var(--ink-soft); }
.bag-item .line-price { font-weight: 600; color: var(--gold-deep); white-space: nowrap; }
.bag-item .controls { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bag-item .qty button { width: 30px; height: 30px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink-soft); text-decoration: underline; font-size: 0.82rem; }
.bag-foot { border-top: 1px solid var(--line); padding: 16px 20px 20px; background: var(--paper); display: flex; flex-direction: column; gap: 10px; }
.total-row { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 0.82rem; font-weight: 500; }
.field input, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--ivory); width: 100%;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 44px; }
.delivery-note { font-size: 0.82rem; color: var(--ink-soft); text-align: center; margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); opacity: 0; z-index: 60;
  background: var(--ink); color: var(--ivory); padding: 10px 18px; border-radius: 999px; font-size: 0.92rem;
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .hero { padding-top: 28px; }
  .hero-inner, .story-inner { grid-template-columns: 1fr; }
  .hero-logo { width: 150px; order: -1; justify-self: start; }
  .product-panel { grid-template-columns: 1fr; max-height: 94vh; overflow-y: auto; }
  .gallery-main { aspect-ratio: 4/5; max-height: 48vh; }
  .product-info { overflow: visible; }
}
@media (max-width: 520px) {
  .brand-name { font-size: 1.15rem; }
  .brand img { width: 36px; height: 36px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px 10px 12px; }
  .card-title { font-size: 0.92rem; }
  .card .btn { padding: 8px 10px; font-size: 0.82rem; }
  .product-dialog { width: 100%; margin: auto 0 0; }
  .product-panel { border-radius: 18px 18px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Fix (Oct 31): show the whole product photo + roomier bag on phones ---------- */
.gallery-main img { object-fit: contain; background: var(--sand); }
@media (max-width: 860px) {
  .gallery-main { flex: none; aspect-ratio: auto; height: auto; max-height: none; }
  .gallery-main img { height: auto; max-height: 70vh; width: 100%; }
}
/* The whole bag scrolls as one page, so items are never squeezed by the form */
.bag-panel { overflow-y: auto; }
.bag-head { position: sticky; top: 0; z-index: 2; background: var(--ivory); }
.bag-body { flex: none; overflow: visible; }
.bag-foot { flex: none; }

/* ---------- Sizes with weight / price + Facebook (Oct 31) ---------- */
.opt { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.2; }
.opt-size { min-width: 74px; padding: 7px 12px; }
.opt-main { font-weight: 500; }
.opt-sub { font-size: 0.72rem; color: var(--ink-soft); font-weight: 400; white-space: nowrap; }
.opt[aria-pressed="true"] .opt-sub { color: rgba(251, 248, 242, 0.8); }
.opt-price { color: var(--gold-deep); font-weight: 600; }
.social-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.social-row .btn { margin-top: 0 !important; }

/* ---------- Admin button in the header (Oct 31) ---------- */
.admin-btn {
  width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--ink); text-decoration: none; background: transparent;
}
.admin-btn:hover { background: var(--gold-soft); }
.admin-btn svg { width: 20px; height: 20px; }
@media (max-width: 400px) {
  .header-inner { gap: 8px; }
  .admin-btn, .bag-btn { width: 38px; height: 38px; }
  .pill-btn { padding: 6px 11px; }
  .brand-name { font-size: 1rem; letter-spacing: 0.03em; }
  .brand img { width: 32px; height: 32px; }
}
