/* ============================================================
   THE IN — theme/components.css  v2
   يستخدم متغيّرات tokens.css + Remix Icons (ri-*)
   ============================================================ */

/* ════════════════════════════════════
   HEADER
════════════════════════════════════ */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 1px 0 var(--c-line);
}

/* Logo */
.brand {
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -.06em;
  color: var(--c-ink);
  text-decoration: none;
  line-height: 1;
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}
.brand small {
  font-size: .58rem;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--c-gray);
  margin-top: 2px;
  text-transform: uppercase;
}

/* Search */
.search-box {
  background: var(--c-bg);
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-pill);
  transition: .15s;
}
.search-box:focus-within {
  border-color: var(--c-black);
  box-shadow: var(--ring);
  background: var(--c-surface);
}
.search-box input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--c-ink);
  width: 100%;
  font-family: var(--font);
  font-size: .9rem;
}
.search-box input::placeholder { color: var(--c-gray-2); }

/* Icon Buttons */
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--c-ink);
  cursor: pointer;
  transition: .15s;
  position: relative;
  text-decoration: none;
  font-size: 1.1rem;
}
.icon-btn:hover { background: var(--c-bg); color: var(--c-ink); }
.icon-btn .dot {
  position: absolute;
  top: 5px; inset-inline-end: 5px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--c-red);
  color: #fff;
  font-size: .58rem;
  border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 700;
  border: 2px solid var(--c-surface);
}

/* Toggle pill (language / theme) */
.toggle-pill {
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--c-ink);
  font-weight: 600;
  font-size: .8rem;
  padding: .3rem .75rem;
  cursor: pointer;
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: .15s;
  text-decoration: none;
}
.toggle-pill:hover { border-color: var(--c-ink); color: var(--c-ink); }

/* Category chips */
.cat-row { overflow-x: auto; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: .4rem 1.1rem;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-pill);
  font-size: .82rem;
  font-weight: 500;
  color: var(--c-ink);
  text-decoration: none;
  white-space: nowrap;
  transition: .15s;
  background: var(--c-surface);
}
.chip:hover { border-color: var(--c-ink-2); color: var(--c-ink); }
.chip.active { background: var(--c-black); color: #fff; border-color: var(--c-black); }
[data-bs-theme="dark"] .chip.active { background: #fff; color: #000; border-color: #fff; }

/* ════════════════════════════════════
   PRODUCT CARD (مكوّن مشترك)
════════════════════════════════════ */
.p-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r);
  overflow: hidden;
  transition: .2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.p-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

.p-thumb {
  position: relative;
  aspect-ratio: 3/4;
  background: var(--c-bg);
  overflow: hidden;
}
.p-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.p-card:hover .p-thumb img { transform: scale(1.05); }

.p-disc {
  position: absolute;
  inset-block-start: 9px; inset-inline-start: 9px;
  background: var(--c-red); color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: .18rem .55rem;
  border-radius: 6px;
  z-index: 2;
}
.p-badge-new {
  position: absolute;
  inset-block-start: 9px; inset-inline-start: 9px;
  background: var(--c-green); color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: .18rem .55rem;
  border-radius: 6px;
  z-index: 2;
}
.p-rank {
  position: absolute;
  inset-block-start: 9px; inset-inline-start: 9px;
  background: rgba(5,5,5,.85); color: #fff;
  font-size: .72rem; font-weight: 800;
  padding: .18rem .55rem;
  border-radius: 6px;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.p-fav {
  position: absolute;
  inset-block-start: 9px; inset-inline-end: 9px;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--c-gray);
  display: grid; place-items: center;
  cursor: pointer;
  transition: .15s;
  z-index: 2;
  font-size: 1rem;
  backdrop-filter: blur(4px);
}
.p-fav:hover, .p-fav.on { color: var(--c-red); background: #fff; }

.p-body {
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .22rem;
  flex: 1;
}
.p-brand {
  font-size: .68rem;
  font-weight: 700;
  color: var(--c-gray);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.p-name {
  font-size: .84rem;
  font-weight: 500;
  color: var(--c-ink);
  line-height: 1.4;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.35em;
}
.p-rate {
  font-size: .72rem;
  color: var(--c-gray);
  display: flex;
  align-items: center;
  gap: 3px;
}
.p-rate i { color: #F4A000; }
.p-price {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  margin-top: .1rem;
}
.p-price .now {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--c-ink);
}
.p-price .now .cur { font-size: .68rem; font-weight: 600; }
.p-price .old {
  font-size: .75rem;
  color: var(--c-gray-2);
  text-decoration: line-through;
}
.p-bnpl {
  font-size: .67rem;
  color: var(--c-green);
  font-weight: 600;
}
.p-ksa-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .65rem;
  background: #E6F4EE;
  color: var(--c-green);
  padding: .12rem .5rem;
  border-radius: 4px;
  font-weight: 700;
}
[data-bs-theme="dark"] .p-ksa-badge { background: rgba(11,143,90,.2); }

.p-add {
  margin-top: auto;
  padding-top: .55rem;
  width: 100%;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-black);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  padding: .55rem;
  cursor: pointer;
  font-family: var(--font);
  transition: .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.p-add:hover { background: var(--c-ink-2); }
[data-bs-theme="dark"] .p-add { background: #fff; color: #000; }
[data-bs-theme="dark"] .p-add:hover { background: #e0e0e0; }

/* ════════════════════════════════════
   SECTION HEADERS
════════════════════════════════════ */
.sec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 0 .85rem;
}
.sec-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--c-ink);
  margin: 0;
  letter-spacing: -.02em;
}
.sec-icon {
  width: 30px; height: 30px;
  background: var(--c-black);
  color: #fff;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: .9rem;
  flex-shrink: 0;
}
[data-bs-theme="dark"] .sec-icon { background: #fff; color: #000; }
.sec-all {
  font-size: .82rem;
  font-weight: 600;
  color: var(--c-gray);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .2rem;
  transition: .15s;
}
.sec-all:hover { color: var(--c-ink); }

/* ════════════════════════════════════
   GRIDS
════════════════════════════════════ */
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: .85rem; }
.grid-5 { display: grid; grid-template-columns: repeat(5,1fr); gap: .85rem; }
.grid-6 { display: grid; grid-template-columns: repeat(6,1fr); gap: .85rem; }

@media (max-width: 1199px) { .grid-5 { grid-template-columns: repeat(4,1fr); } }
@media (max-width: 991px)  {
  .grid-4 { grid-template-columns: repeat(3,1fr); }
  .grid-5 { grid-template-columns: repeat(3,1fr); }
  .grid-6 { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 600px)  {
  .grid-4,.grid-5,.grid-6 { grid-template-columns: repeat(2,1fr); gap: .55rem; }
}

/* ════════════════════════════════════
   FOOTER
════════════════════════════════════ */
footer.site-footer { background: var(--c-black); color: #adadad; }
footer.site-footer h6 { color: #fff; font-weight: 700; font-size: .85rem; }
footer.site-footer a { color: #adadad; text-decoration: none; font-size: .82rem; transition: .15s; }
footer.site-footer a:hover { color: #fff; }

/* ════════════════════════════════════
   PRODUCT PAGE
════════════════════════════════════ */
.pdp-main { aspect-ratio: 3/4; border-radius: var(--r); overflow: hidden; background: var(--c-bg); }
.pdp-main img { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.pdp-thumbs button {
  width: 64px; aspect-ratio: 3/4;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid var(--c-line);
  background: var(--c-bg);
  cursor: pointer; padding: 0;
  transition: .15s;
}
.pdp-thumbs button.active { border-color: var(--c-black); }
[data-bs-theme="dark"] .pdp-thumbs button.active { border-color: #fff; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--c-line); cursor: pointer; }
.swatch.active { outline: 2.5px solid var(--c-black); outline-offset: 2px; }
.size-btn {
  min-width: 46px; padding: .4rem .7rem;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-ink);
  font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: .15s;
}
.size-btn.active { background: var(--c-black); color: #fff; border-color: var(--c-black); }
.btn-buy {
  background: var(--c-black); color: #fff;
  border: 0; border-radius: var(--r-pill);
  font-weight: 800; padding: .8rem;
  font-family: var(--font); cursor: pointer; transition: .15s;
}
.btn-buy:hover { opacity: .88; }
[data-bs-theme="dark"] .btn-buy { background: #fff; color: #000; }
.btn-cart {
  background: transparent; color: var(--c-ink);
  border: 1.5px solid var(--c-black);
  border-radius: var(--r-pill);
  font-weight: 800; padding: .8rem;
  font-family: var(--font); cursor: pointer; transition: .15s;
}
[data-bs-theme="dark"] .btn-cart { border-color: #fff; color: #fff; }

/* ════════════════════════════════════
   REVEAL ANIMATION
════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s, transform .5s; }
  .reveal.in { opacity: 1; transform: none; }
}
