/* core/styles/catalog.css: الشبكة + بطاقة المنتج + شريط الفئات (الرئيسية و /shop). tokens فقط.
   الفكرة: lookbook. الصور من الحافة للحافة فـ الهاتف، فراغ 2px بيناتهم، والمعلومات تحت بلا إطار. */

:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 3px; }

/* ---------- /shop بحال Kiabi ---------- */
.shop { padding-top: 0; }
/* الدوائر ديال الفئات */
.circles { border-bottom: 1px solid var(--c-line); }
.circles-in { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-top: 14px; padding-bottom: 12px; }
.circles-in::-webkit-scrollbar { display: none; }
.circ { position: relative; flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.circ-img { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--c-soft); display: block; transition: box-shadow var(--t-fast); }
.circ-img img { width: 100%; height: 100%; object-fit: cover; }
.circ-l { font-size: 12px; line-height: 1.2; font-weight: 500; color: var(--c-ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.circ:hover .circ-img { box-shadow: 0 0 0 2px var(--c-bg), 0 0 0 3px var(--c-line-strong); }
.circ[aria-current="page"] .circ-img { box-shadow: 0 0 0 2px var(--c-bg), 0 0 0 4px var(--c-ink); }
.circ-x { position: absolute; top: -2px; right: 0; z-index: 1; width: 22px; height: 22px; border-radius: 50%; background: var(--c-ink); color: var(--c-on-ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--c-bg); }
.circ-x svg { width: 11px; height: 11px; }
@media (min-width: 900px) { .circ-x { right: 4px; } }
.circ[aria-current="page"] .circ-l { color: var(--c-ink); font-weight: 700; }
@media (min-width: 900px) { .circles-in { justify-content: center; gap: 22px; } .circ { width: 86px; } .circ-img { width: 76px; height: 76px; } .circ-l { font-size: var(--fs-xs); } }

/* سطر: ‹ العنوان + العدد | Filtrer et trier */
.shop-bar {
  position: sticky; top: var(--header-h); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter) 10px;
  background: var(--glass-bg); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
}
.shop-ttl { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.shop-back { flex: none; width: 34px; height: 34px; margin-left: -8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.shop-back:hover { background: var(--c-soft); }
.shop-ttl h1 { font-size: clamp(1.1rem, .95rem + .8vw, 1.6rem); font-weight: 700; line-height: 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-count { margin: -4px 0 0; color: var(--c-muted); font-size: var(--fs-xs); }
.btn-filter { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 0; border-radius: 10px; background: var(--c-soft); font-size: var(--fs-sm); font-weight: 500; }
.btn-filter:hover { background: var(--c-line); }
.f-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--c-ink); color: var(--c-on-ink); font-size: 12px; line-height: 20px; text-align: center; font-weight: 600; }
.f-active { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px; }
.f-active[hidden] { display: none; }
.f-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 12px; border: 1px solid var(--c-line-strong); border-radius: 999px; background: var(--c-bg); font-size: var(--fs-xs); font-weight: 500; }
.f-chip:hover { border-color: var(--c-ink); }
.f-clear { background: none; border: 0; padding: 6px 4px; font-size: var(--fs-xs); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.shop .grid { margin-top: 6px; }

/* ---------- Sheet: Filtrer et trier ---------- */
.flt { position: fixed; inset: 0; z-index: var(--z-modal); }
.flt-overlay { position: absolute; inset: 0; background: var(--c-overlay); opacity: 0; transition: opacity var(--t); }
.flt.open .flt-overlay { opacity: 1; }
.flt-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; display: flex; flex-direction: column; background: var(--c-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; transform: translateY(100%); transition: transform var(--t) var(--ease); padding-bottom: env(safe-area-inset-bottom, 0px); }
.flt.open .flt-panel { transform: none; }
@media (min-width: 768px) {
  .flt-panel { left: auto; top: 0; width: 420px; max-height: none; border-radius: 0; transform: translateX(100%); }
}
.flt-head { display: flex; align-items: center; justify-content: space-between; padding: 16px var(--gutter); border-bottom: 1px solid var(--c-line); }
.flt-head h2 { font-size: var(--fs-lg); font-weight: 700; }
.flt-close { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--c-ink); color: var(--c-on-ink); }
.flt-body { flex: 1; overflow-y: auto; padding: 4px var(--gutter) 12px; }
.flt-sec { border: 0; margin: 0; padding: 18px 0; border-bottom: 1px solid var(--c-line); min-width: 0; }
.flt-sec:last-child { border-bottom: 0; }
.flt-sec legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-size: var(--fs-md); font-weight: 600; }
.flt-opts { clear: both; display: flex; flex-direction: column; gap: 4px; }
.flt-radio { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: var(--fs-sm); cursor: pointer; }
.flt-radio input { width: 20px; height: 20px; margin: 0; accent-color: var(--c-ink); }
.flt-chips { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.flt-chip { min-width: 48px; padding: 9px 14px; border: 1px solid var(--c-line-strong); border-radius: 10px; background: var(--c-bg); font-size: var(--fs-sm); font-weight: 500; }
.flt-chip:hover { border-color: var(--c-ink); }
.flt-chip[aria-pressed="true"] { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-on-ink); }
.flt-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: var(--fs-sm); font-weight: 500; }
.flt-sw { position: relative; flex: none; width: 44px; height: 26px; }
.flt-sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.flt-sw i { position: absolute; inset: 0; border-radius: 13px; background: var(--c-line-strong); transition: background var(--t-fast); }
.flt-sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform var(--t-fast); }
.flt-sw input:checked + i { background: var(--c-ink); }
.flt-sw input:checked + i::after { transform: translateX(18px); }
.flt-sw input:focus-visible + i { outline: 2px solid var(--c-ink); outline-offset: 2px; }
.flt-foot { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px var(--gutter) 16px; border-top: 1px solid var(--c-line); }
.flt-foot .btn { padding: 14px 20px; }

/* ---------- chips (البحث) ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 16px; font-size: var(--fs-sm); color: var(--c-ink-soft); background: var(--c-soft); border-radius: 999px; transition: background var(--t-fast), color var(--t-fast); }
.chip:hover { background: var(--c-line); color: var(--c-ink); }
.chip[aria-current="page"] { background: var(--c-ink); color: var(--c-on-ink); }

/* ---------- الشبكة ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 10px; }
@media (min-width: 768px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 32px 16px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 40px 18px; } }
.shop-empty { grid-column: 1 / -1; text-align: center; padding: 64px var(--gutter); color: var(--c-muted); }
.shop-empty a { color: var(--c-ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- بطاقة المنتج ---------- */
.card { display: block; min-width: 0; }
.card-media { position: relative; aspect-ratio: 3 / 4; background: var(--c-soft); overflow: hidden; border-radius: var(--radius); }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-img2 { opacity: 0; transition: opacity .45s var(--ease); }
@media (hover: hover) and (min-width: 900px) { .card:hover .card-img2 { opacity: 1; } }
.card-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--f-display); font-size: 4rem; font-weight: 700; color: var(--c-line-strong); }
.card-flag { position: absolute; top: 8px; left: 8px; padding: 4px 10px; border-radius: 999px; background: var(--c-bg); font-size: 12px; font-weight: 500; line-height: 1.3; }
.card[data-soldout] .card-img, .card[data-soldout] .card-ph { opacity: .5; }
.card[data-soldout] .card-img2 { display: none; }
.card-body { padding: 10px 2px 0; }
.card-name { margin-top: 3px; font-size: var(--fs-sm); line-height: 1.35; color: var(--c-ink-soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card:hover .card-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.card-price { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.card-now { font-weight: 700; }
.card-now.is-sale { color: var(--c-accent-ink); }
.card-old { color: var(--c-muted); font-size: var(--fs-xs); }
.card-off { color: var(--c-accent-ink); font-size: var(--fs-xs); font-weight: 600; }
.card-sizes { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 2px 9px; font-size: var(--fs-xs); color: var(--c-muted); }
.card-sizes .off { text-decoration: line-through; opacity: .55; }

.dbg-inline { margin-top: 24px; font: 12px/1.4 monospace; color: var(--c-muted); }

/* placeholder: الحرف الأول ملي ما كايناش صورة (دوائر، menu، bento) */
.ph-letter { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--f-display); font-weight: 700; font-size: 26px; line-height: 1; color: var(--c-ink); background: var(--c-soft); }
.circ-img .ph-letter { font-size: 26px; }
.dm-th .ph-letter { font-size: 20px; }
.tile-ph .ph-letter { font-size: clamp(56px, 14vw, 110px); color: var(--c-line-strong); background: none; }
.shop-empty b { color: var(--c-ink); }
