/* ==========================================================================
   نظام تصميم «دفا» (Dafa Design System)
   متجر الباهي الزاهي لتجهيز شنط العرايس والريحة السودانية
   ========================================================================== */

:root {
  /* ألوان الهوية الرئيسية */
  --majorelle-blue: #6e44ff;
  --soft-periwinkle: #b892ff;
  --blush-pop: #ffc2e2;
  --cotton-candy: #ff90b3;
  --light-coral: #ef7a85;

  --primary: var(--light-coral);
  --on-primary: #2b1420;
  --link: #b23a4a;
  --ink: #2b1420;
  --muted: #7a5f6b;
  --bg: #fff8f9;
  --card: #ffffff;
  --line: #f5dfe6;
  --tint: #ffeef5;
  --success: #2e7d32;
  --whatsapp: #25d366;

  /* الزخارف والرموز التراثية السودانية (SVG Masks) */
  --m-tri: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8'%3E%3Cpath d='M0 8L4 0L8 8Z M8 0L12 8L16 0Z' fill='black'/%3E%3C/svg%3E");
  --m-dia: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M14 3L25 14L14 25L3 14Z' fill='none' stroke='black' stroke-width='1'/%3E%3Ccircle cx='14' cy='14' r='1.6' fill='black'/%3E%3C/svg%3E");
  --m-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='54' height='10'%3E%3Cpath d='M27 0L32 5L27 10L22 5Z' fill='black'/%3E%3Cpath d='M12 2L15 5L12 8L9 5Z M42 2L45 5L42 8L39 5Z' fill='black'/%3E%3Ccircle cx='2' cy='5' r='1.5' fill='black'/%3E%3Ccircle cx='52' cy='5' r='1.5' fill='black'/%3E%3C/svg%3E");

  /* الأبعاد والمسافات */
  --r: 20px;
  --r-sm: 12px;
  --r-lg: 28px;
  --gutter: 16px;
  --font-main: 'Almarai', system-ui, -apple-system, sans-serif;
  --shadow-card: 0 4px 16px rgba(43, 20, 32, 0.04);
  --shadow-hover: 0 8px 24px rgba(43, 20, 32, 0.08);
}

/* التنسيق الأساسي */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  padding-bottom: 76px;
  overflow-x: hidden;
  direction: rtl;
  text-align: right;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}

button:active {
  transform: scale(0.97);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.i {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.wrap {
  padding-inline: var(--gutter);
  max-width: 1120px;
  margin-inline: auto;
}

.wrap-narrow {
  max-width: 680px;
  margin-inline: auto;
}

/* شريط زخرفة البرش السوداني */
.band {
  height: 8px;
  background: var(--cotton-candy);
  -webkit-mask: var(--m-tri) repeat-x;
  mask: var(--m-tri) repeat-x;
}

/* الهيدر العلوي */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.header-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 58px;
}

.logo {
  text-align: center;
  line-height: 1.2;
}

.logo b {
  font-size: 17px;
  font-weight: 800;
  display: block;
  color: #fff;
  letter-spacing: -0.3px;
}

.logo small {
  font-size: 10px;
  color: var(--blush-pop);
  letter-spacing: 0.5px;
  font-weight: 700;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  position: relative;
  color: #fff;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.count {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* درج التنقل الجانبي (Drawer) */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  visibility: hidden;
  transition: visibility 0.3s;
}

.drawer.open {
  visibility: visible;
}

.drawer-bg {
  position: absolute;
  inset: 0;
  background: rgba(43, 20, 32, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer.open .drawer-bg {
  opacity: 1;
}

.drawer-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(85vw, 340px);
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}

.drawer.open .drawer-panel {
  transform: none;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.drawer-head h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tint);
  color: var(--ink);
}

.drawer-panel a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  transition: background 0.2s, padding-right 0.2s;
}

.drawer-panel a:hover, .drawer-panel a.active {
  background: var(--tint);
  padding-right: 12px;
  color: var(--link);
}

.drawer-panel a .i {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.drawer-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.drawer-footer .btn {
  width: 100%;
}

/* قسم الهيرو (Hero) */
.hero {
  position: relative;
  height: 440px;
  overflow: hidden;
  background: var(--ink);
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 38% center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(43, 20, 32, 0.1) 20%, rgba(43, 20, 32, 0.94) 100%);
}

.hero-text {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 0 var(--gutter) 28px;
  color: #fff;
}

.hero-text small {
  display: inline-block;
  font-size: 12px;
  color: var(--blush-pop);
  font-weight: 700;
  margin-bottom: 4px;
}

.hero-text h1 {
  font-size: 28px;
  line-height: 1.35;
  font-weight: 800;
  margin: 4px 0 8px;
  color: #fff;
}

.hero-text p {
  font-size: 14px;
  color: #f3dfe6;
  margin-bottom: 18px;
  max-width: 500px;
}

/* الأزرار العامة */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 24px;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  border: 0;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(239, 122, 133, 0.35);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-dark:hover {
  background: #3e1b2f;
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
}

.btn-whatsapp:hover {
  background: #20ba59;
}

.btn-outline {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--tint);
  border-color: var(--primary);
}

.btn-block {
  width: 100%;
}

.hero .band {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 3;
}

/* شريط الثقة (Trust Bar) */
.trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 20px 0 6px;
}

.trust div {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--muted);
}

.trust span {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--link);
  display: grid;
  place-items: center;
  margin: 0 auto 6px;
  transition: transform 0.2s;
}

.trust div:hover span {
  transform: translateY(-2px);
}

/* شريط الماركات المتحرك (Marquee) */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  margin-top: 20px;
  padding: 12px 0;
  direction: ltr;
  background: rgba(255, 255, 255, 0.6);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-slide 40s linear infinite;
}

.marquee span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 22px;
  padding-right: 22px;
}

.marquee span::after {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--cotton-candy);
  transform: rotate(45deg);
}

@keyframes marquee-slide {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ترويسات الأقسام (Section Headers) */
section.sec {
  padding: 38px 0 6px;
  scroll-margin-top: 64px;
}

.sec-head {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.sec-head::before {
  content: "";
  display: block;
  width: 54px;
  height: 10px;
  margin: 0 auto 10px;
  background: var(--cotton-candy);
  -webkit-mask: var(--m-dots) no-repeat;
  mask: var(--m-dots) no-repeat;
}

.sec-head h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.sec-head h2 a {
  color: inherit;
}

.sec-head h2 a:hover {
  color: var(--link);
}

.sec-head p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.see-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  margin: 18px auto 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--link);
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--tint);
  border: 1px solid var(--line);
  transition: all 0.2s;
}

.see-all:hover {
  background: #ffdfea;
  transform: translateY(-1px);
}

/* باقات الشيلة (Bundles) */
.seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 25px;
  padding: 4px;
  margin-bottom: 14px;
}

.seg button {
  height: 40px;
  border-radius: 21px;
  font-weight: 800;
  font-size: 15px;
  color: var(--muted);
  direction: ltr;
}

.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.bundle {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.bundle-visual {
  position: relative;
  height: 170px;
  background: var(--tint);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.bundle-visual svg {
  position: absolute;
  width: 300px;
  color: var(--cotton-candy);
  opacity: 0.45;
}

.bundle-visual strong {
  position: relative;
  font-size: 56px;
  font-weight: 800;
  color: var(--ink);
  direction: ltr;
}

.tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  z-index: 2;
}

.tag[hidden] {
  display: none;
}

.bundle-body {
  padding: 18px;
}

.bundle-body h3 {
  font-size: 18px;
  font-weight: 800;
}

.bundle-body p {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 14px;
  line-height: 1.6;
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.price-line b {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
}

.price-line small {
  font-size: 12px;
  color: var(--muted);
}

.price-line s {
  font-size: 13px;
  color: var(--muted);
}

/* الشبكات وشريط التمرير الأفقي (Rails & Grids) */
.rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding: 0 var(--gutter) 8px;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail > * {
  scroll-snap-align: start;
  flex: 0 0 46%;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* كرت المنتج القياسي (Card) */
.card {
  background: var(--card);
  border-radius: var(--r);
  padding: 8px 8px 12px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.thumb {
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  position: relative;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .thumb img {
  transform: scale(1.04);
}

.thumb.contain img {
  object-fit: contain;
  padding: 8px;
}

.ph {
  background: var(--tint);
  display: grid;
  place-items: center;
  color: var(--link);
  font-weight: 800;
  font-size: 13px;
  border-radius: 14px;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
}

.ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cotton-candy);
  opacity: 0.35;
  -webkit-mask: var(--m-dia);
  mask: var(--m-dia);
}

.ph span {
  position: relative;
  background: var(--tint);
  padding: 4px 10px;
  border-radius: 10px;
  z-index: 1;
}

.name {
  font-size: 13px;
  font-weight: 700;
  margin: 10px 4px 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}

.foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 4px 0;
}

.price {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.price small {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}

.add {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.add .i {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.add.done {
  background: var(--ink);
  color: #fff;
}

/* كرت المنتج البارز (Spot) */
.spot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: grid;
  grid-template-columns: 42% 1fr;
  box-shadow: var(--shadow-card);
}

.spot .thumb {
  border-radius: 0;
  aspect-ratio: auto;
  height: 100%;
  min-height: 190px;
  background: #fff;
}

.spot-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.spot-body small {
  font-size: 11px;
  font-weight: 700;
  color: var(--link);
}

.spot-body h3 {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.spot-body .price {
  font-size: 20px;
  margin: 4px 0 10px;
}

.spot-body .btn {
  height: 42px;
  font-size: 14px;
}

.mini {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.mini a {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  transition: transform 0.2s, border-color 0.2s;
}

.mini a:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.mini b {
  display: block;
  font-size: 13px;
}

.mini span {
  font-size: 13px;
  color: var(--muted);
}

/* قائمة الأسعار المنقطة (Menu) */
.menu {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px 16px;
  box-shadow: var(--shadow-card);
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}

.menu-row + .menu-row {
  border-top: 1px solid var(--line);
}

.menu-row .n {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.menu-row .d {
  flex: 1;
  border-bottom: 2px dotted #e8c9d4;
  transform: translateY(-4px);
  min-width: 16px;
}

.menu-row .price {
  white-space: nowrap;
}

/* البانر والكبسولات (Banner & Pills) */
.banner {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-card);
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 35%, rgba(43, 20, 32, 0.92));
}

.banner-text {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 18px;
  color: #fff;
}

.banner-text b {
  font-size: 19px;
  display: block;
}

.banner-text span {
  font-size: 13px;
  color: #f3dfe6;
  display: block;
  margin: 2px 0 12px;
}

.banner .btn {
  height: 42px;
  font-size: 14px;
}

.pills {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 12px calc(var(--gutter) * -1) 0;
  padding: 0 var(--gutter);
}

.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: 0 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s;
}

.pill:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.pill b {
  display: block;
  font-size: 13px;
  white-space: nowrap;
}

.pill span {
  font-size: 13px;
  color: var(--muted);
}

/* البلاطات (Tiles) */
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.tile .thumb {
  border-radius: 0;
  aspect-ratio: 1;
}

.tile .thumb img {
  object-position: 75% 60%;
}

.tile div.t {
  padding: 12px;
}

.tile b {
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.tile a {
  font-size: 13px;
  font-weight: 700;
  color: var(--link);
  display: inline-block;
}

/* خط زمني للدفع ببنكك (Bankak Payment) */
.pay {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.pay-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.pay-top img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: contain;
  border: 1px solid var(--line);
  padding: 4px;
  background: #fff;
}

.pay-top b {
  font-size: 17px;
  display: block;
}

.pay-top span {
  font-size: 13px;
  color: var(--muted);
}

.timeline {
  list-style: none;
  margin-bottom: 20px;
  position: relative;
}

.timeline li {
  position: relative;
  padding: 0 30px 16px 0;
  font-size: 14px;
}

.timeline li::before {
  content: "";
  position: absolute;
  right: 5px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--tint);
}

.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 22px;
  bottom: 2px;
  width: 2px;
  background: var(--line);
}

.timeline b {
  display: block;
}

.timeline span {
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   مكونات الصفحات الفرعية الموسعة (Category Subpage Components)
   ========================================================================== */

/* رأس الصفحة الفرعية */
.category-header {
  background: linear-gradient(180deg, var(--ink) 0%, #3e1b2f 100%);
  color: #fff;
  padding: 28px var(--gutter) 36px;
  position: relative;
  overflow: hidden;
}

.category-header::after {
  content: "";
  position: absolute;
  left: -40px;
  bottom: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 122, 133, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--blush-pop);
  font-weight: 700;
  margin-bottom: 14px;
}

.breadcrumb a {
  color: #fff;
  opacity: 0.85;
}

.breadcrumb a:hover {
  opacity: 1;
  text-decoration: underline;
}

.category-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  color: var(--blush-pop);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.category-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
}

.category-desc {
  font-size: 14px;
  color: #f3dfe6;
  max-width: 650px;
  line-height: 1.6;
}

/* كبسولات التبديل السريع بين الأقسام (Quick Category Bar) */
.category-nav-bar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 58px;
  z-index: 25;
}

.cat-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px var(--gutter);
}

.cat-pills::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 20px;
  background: var(--tint);
  color: var(--ink);
  border: 1px solid var(--line);
  transition: all 0.2s;
  white-space: nowrap;
}

.cat-pill.active, .cat-pill:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* بطاقة المنتج الموسعة في الصفحة الفرعية (Expanded Product Card) */
.card-expanded {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  align-items: start;
}

.card-expanded:hover {
  box-shadow: var(--shadow-hover);
  border-color: #f0ccd8;
}

.card-expanded .thumb {
  width: 120px;
  height: 120px;
  aspect-ratio: 1;
  border-radius: 14px;
  flex-shrink: 0;
}

.card-expanded-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-expanded-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
}

.card-spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 6px;
}

.spec-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--tint);
  color: var(--link);
}

.spec-tag.badge-original {
  background: #e8f5e9;
  color: #2e7d32;
}

.card-expanded-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.card-expanded-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}

.card-expanded-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.card-expanded-price small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.card-expanded-old {
  font-size: 13px;
  color: var(--muted);
  text-decoration: line-through;
}

.card-expanded-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.card-expanded-actions .btn {
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

/* شبكة المنتجات الموسعة */
.expanded-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 0 10px;
}

/* بطاقة باقة شيلة مفصلة في صفحة الباقات */
.sheila-full-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.sheila-full-head {
  background: var(--tint);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.sheila-full-head h3 {
  font-size: 20px;
  font-weight: 800;
}

.sheila-badge {
  background: var(--ink);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}

.sheila-full-content {
  padding: 20px;
}

.sheila-items-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 14px 0 20px;
}

.sheila-items-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
}

.sheila-items-list li::before {
  content: "✔";
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
}

/* ==========================================================================
   سلة المشتريات المودال (Cart Drawer / Modal)
   ========================================================================== */
.cart-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  transition: visibility 0.3s;
}

.cart-modal.open {
  visibility: visible;
}

.cart-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(43, 20, 32, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-modal.open .cart-modal-bg {
  opacity: 1;
}

.cart-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(90vw, 380px);
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.2);
}

.cart-modal.open .cart-panel {
  transform: none;
}

.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
}

.cart-head h3 {
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.cart-item-info b {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.cart-item-info span {
  font-size: 12px;
  color: var(--muted);
}

.cart-item-remove {
  color: #c92a2a;
  padding: 4px;
  cursor: pointer;
}

.cart-empty {
  text-align: center;
  padding: 40px 10px;
  color: var(--muted);
}

.cart-empty p {
  margin-top: 8px;
  font-size: 14px;
}

.cart-footer {
  border-top: 2px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 800;
}

.cart-total-row span.val {
  font-size: 20px;
  color: var(--link);
}

/* ==========================================================================
   الفوتر والتنقل السفلي (Footer & Tabbar)
   ========================================================================== */
footer {
  background: var(--ink);
  color: #ecd9e0;
  margin-top: 44px;
  padding-bottom: 20px;
}

.foot {
  padding-top: 28px;
  display: grid;
  gap: 22px;
  text-align: center;
}

.foot b.brand {
  font-size: 20px;
  color: #fff;
  display: block;
}

.foot .sub {
  font-size: 13px;
  color: var(--blush-pop);
}

.foot h4 {
  font-size: 13px;
  color: #fff;
  margin-bottom: 8px;
}

.branches {
  font-size: 13px;
  line-height: 2;
  color: #f0dde5;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.socials a {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  color: #fff;
  transition: background 0.2s;
}

.socials a:hover {
  background: rgba(255, 255, 255, 0.16);
}

.socials .i {
  width: 18px;
  height: 18px;
  color: var(--cotton-candy);
}

.copy {
  font-size: 11px;
  color: #a98b98;
}

/* شريط التنقل السفلي للهواتف (Mobile Tabbar) */
.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.tabbar a, .tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  position: relative;
  font-weight: 700;
}

.tabbar .ic {
  width: 52px;
  height: 30px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}

.tabbar .on {
  color: var(--ink);
  font-weight: 800;
}

.tabbar .on .ic {
  background: var(--blush-pop);
}

.tabbar .count {
  top: -2px;
  left: calc(50% - 26px);
}

/* رسالة التنبيه المنبثقة (Toast) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 24px;
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 55;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* استجابة الشاشات الكبيرة (Desktop & Tablet Media Queries) */
@media (min-width: 600px) {
  .sheila-items-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .card-expanded {
    grid-template-columns: 160px 1fr;
    padding: 20px;
  }

  .card-expanded .thumb {
    width: 160px;
    height: 160px;
  }

  .card-expanded-title {
    font-size: 18px;
  }

  .card-expanded-desc {
    font-size: 14px;
  }
}

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
  }

  .tabbar {
    display: none;
  }

  .hero {
    height: 560px;
  }

  .hero-text {
    max-width: 1120px;
    margin: auto;
    left: 0;
    right: 0;
    padding-bottom: 48px;
  }

  .hero-text h1 {
    font-size: 44px;
    max-width: 620px;
  }

  .trust div {
    font-size: 13px;
  }

  .rail {
    overflow: visible;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .rail > * {
    flex: none;
  }

  .grid2 {
    grid-template-columns: repeat(4, 1fr);
  }

  #sheila .wrap-narrow,
  #sandal .wrap-narrow,
  #hawaig .wrap-narrow,
  #bankak .wrap-narrow {
    max-width: 640px;
    margin-inline: auto;
  }

  .tiles {
    max-width: 760px;
    margin-inline: auto;
  }

  .category-title {
    font-size: 34px;
  }
}


/* ==========================================================================
   علامة نَفَذَتِ الكَمِيَّة وحالة المزامنة الحية (Live Sync & Sold Out)
   ========================================================================== */
.stamp-sold-out {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
  letter-spacing: 0.3px;
}

.is-sold-out {
  position: relative;
}

.is-sold-out .thumb img {
  filter: grayscale(85%) opacity(0.65);
}

.is-sold-out .add {
  background: #ded5d8 !important;
  color: #8c737d !important;
  cursor: not-allowed;
  pointer-events: none;
}

.is-sold-out .btn-primary,
.is-sold-out .btn-dark {
  background: #ded5d8 !important;
  color: #8c737d !important;
  cursor: not-allowed;
  pointer-events: none;
}

.live-updated-flash {
  animation: live-flash 1.2s ease-out;
}

@keyframes live-flash {
  0% { box-shadow: 0 0 0 4px var(--primary); transform: scale(1.02); }
  100% { box-shadow: var(--shadow-card); transform: scale(1); }
}

/* ==========================================================================
   تحسينات الجوال لنافذة السلة ونموذج بيانات الزبون
   ========================================================================== */
.cart-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.cart-items { flex: 1 0 auto; min-height: 90px; overflow: visible; }
.cart-head { flex-shrink: 0; }
.cart-footer { flex-shrink: 0; }
@media (max-width: 480px) {
  .cart-panel { width: min(94vw, 400px); padding: 16px; }
}
