/* =========================================================
   محطة الملكي — storefront. Royal black + gold.
   Theme derives from --primary (black) and --accent (gold),
   both injected from config.js. Re-skin = change those two.
   ========================================================= */
:root {
  --primary: #16181d;
  --accent:  #d4af37;
  --primary-deep: color-mix(in srgb, var(--primary) 72%, #000);
  --accent-soft:  color-mix(in srgb, var(--accent) 20%, #fff);
  --accent-dark:  color-mix(in srgb, var(--accent) 78%, #000);

  --bg: #f5f5f3;
  --card: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e7e7e3;
  --err: #b91c1c;

  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 12px 28px rgba(0,0,0,.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(165deg, var(--primary), #000);
  color: #fff;
  padding: 1.8rem 1.1rem 2rem;
  text-align: center;
}
.brand { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.brand .crown { font-size: 1.8rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.brand h1 {
  font-size: 1.85rem; font-weight: 800; letter-spacing: -.3px;
  color: var(--accent);
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}
.hero .tagline { font-size: .95rem; color: #d9d6cf; margin-top: .2rem; }
.hero-logo { width: 60px; height: 60px; border-radius: 14px; object-fit: cover; margin: 0 auto .5rem; display: block; }

.hero-art {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 1.2rem auto 0;
  border-radius: 14px;
  border: 2px solid var(--accent);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #16181d;
}
.hero-art svg, .hero-banner-img { display: block; width: 100%; height: auto; }

.search-wrap { position: relative; max-width: 460px; margin: 1.2rem auto 0; }
.search-wrap input {
  width: 100%; border: none; border-radius: 999px;
  padding: .8rem 2.9rem .8rem 1.1rem;
  font-family: inherit; font-size: .95rem; background: #fff; color: var(--text);
  box-shadow: var(--shadow-md); outline: none;
}
.search-wrap input::placeholder { color: #9aa1ad; }
.search-wrap .search-icon { position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%); color: var(--primary); display: flex; }

/* ---------- Sticky chips ---------- */
.chips {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: .5rem; overflow-x: auto;
  padding: .85rem 1.1rem; background: var(--bg);
  border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-family: inherit; font-size: .85rem; font-weight: 700;
  padding: .45rem .95rem; border-radius: 999px; cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.chip.active {
  background: var(--accent); border-color: var(--accent); color: var(--primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ---------- Grid ---------- */
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: .4rem 1.1rem 1.5rem; }
.result-count { color: var(--muted); font-size: .85rem; margin: .5rem .15rem 1rem; }
.grid-status { text-align: center; color: var(--muted); padding: 2.5rem 0; }
.grid-status.error { color: var(--err); }

.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
@media (min-width: 560px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; } }
@media (min-width: 860px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Card ---------- */
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease; animation: fadeUp .45s ease both;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card-thumb { position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .card-thumb img { transform: scale(1.06); }
.card-thumb--ph { background: linear-gradient(140deg, #fbf6e8, #f1e4bf); color: var(--accent-dark); }
.card-thumb--ph svg { width: 42%; height: 42%; opacity: .92; transition: transform .25s ease; }
.card:hover .card-thumb--ph svg { transform: scale(1.08); }

.card-body { padding: .75rem .85rem 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card-tag { align-self: flex-start; background: var(--accent-soft); color: var(--accent-dark); font-size: .68rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; }
.card-name { font-size: .95rem; font-weight: 700; line-height: 1.4; }
.card-price { font-size: 1.05rem; font-weight: 800; color: var(--primary); margin-top: auto; }
.card-price .cur { font-size: .72rem; font-weight: 700; color: var(--accent-dark); margin-inline-start: .15rem; }

/* ---------- Skeleton ---------- */
.skeleton .card-thumb, .skeleton .sk-line { background: linear-gradient(90deg,#eef1f6 25%,#e3e7ee 37%,#eef1f6 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.skeleton { cursor: default; }
.skeleton .sk-line { height: 12px; border-radius: 6px; }
.skeleton .sk-line.short { width: 55%; }

/* ---------- Contact / info section ---------- */
.info { background: #fff; border-top: 1px solid var(--line); }
.info-inner { max-width: 1080px; margin: 0 auto; padding: 2rem 1.1rem; display: grid; gap: 1.8rem; }
@media (min-width: 760px) { .info-inner { grid-template-columns: 1fr 1fr; align-items: start; } }

.info h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: .8rem; position: relative; padding-inline-start: .7rem; }
.info h3::before { content: ""; position: absolute; inset-inline-start: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 4px; background: var(--accent); }

.services { display: flex; flex-wrap: wrap; gap: .5rem; }
.service-pill { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: .85rem; padding: .4rem .85rem; border-radius: 999px; }

.contact-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; color: var(--text); text-decoration: none; }
.contact-row .ic { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; }
a.contact-row:hover { color: var(--accent-dark); }

.socials { display: flex; gap: .6rem; margin-top: .9rem; }
.social-btn { width: 42px; height: 42px; border-radius: 11px; background: var(--primary); color: var(--accent); display: flex; align-items: center; justify-content: center; transition: transform .15s ease; }
.social-btn:hover { transform: translateY(-3px); }

.poster { width: 100%; max-width: 320px; border-radius: 14px; border: 2px solid var(--accent); box-shadow: var(--shadow-md); margin-top: .5rem; }

/* ---------- Footer ---------- */
.shop-footer { background: var(--primary-deep); color: #fff; text-align: center; padding: 1.5rem 1rem; }
.shop-footer .f-name { font-weight: 800; font-size: 1.05rem; color: var(--accent); }
.shop-footer .f-sub { font-size: .8rem; opacity: .7; margin-top: .3rem; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } * { transition: none !important; } }
