/* ============================================================
   header.css — الهيدر والأقسام
   ============================================================ */

/* ── Header ── */
.hdr {
  background: var(--card);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0);
}
.hdr-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
}
.hdr-logo {
  width: 46px; height: 46px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #D4B876);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 2px 10px rgba(184,150,74,.3);
}
.hdr-logo img { width: 100%; height: 100%; object-fit: cover; }
.hdr-info    { flex: 1; min-width: 0; }
.hdr-name    { color: var(--dark); font-size: 17px; font-weight: 900; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-slogan  { color: var(--muted); font-size: 11px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-cart {
  background: var(--dark);
  border: 1px solid var(--dark);
  border-radius: 50px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--cream);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: .2s;
}
.hdr-cart:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
.cart-badge {
  background: var(--gold);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px; height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.cart-badge.hide { display: none; }

/* ── Categories ── */
.cats-wrap {
  background: var(--card);
  padding: 4px 16px 14px;
}
.cats-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 2px;
}
.cats-scroll::-webkit-scrollbar { display: none; }

/* Chip */
.cat-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  min-width: 62px;
  padding: 0 3px;
}
.cat-chip-ico {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid var(--border);
  background: var(--bg);
  overflow: hidden;
  transition: all .22s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}
.cat-chip-ico img { width: 100%; height: 100%; object-fit: cover; }
.cat-chip-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  transition: color .2s;
  white-space: nowrap;
  text-align: center;
}
.cat-chip-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: transparent;
  transition: background .2s;
  margin: 0 auto;
}

/* Active chip */
.cat-chip.on .cat-chip-ico  { background: var(--gold); border-color: var(--gold); transform: translateY(-3px) scale(1.08); box-shadow: 0 4px 14px rgba(184,150,74,.35); }
.cat-chip.on .cat-chip-lbl  { color: var(--dark); font-weight: 800; }
.cat-chip.on .cat-chip-dot  { background: var(--gold); }

/* Hover chip */
.cat-chip:not(.on):hover .cat-chip-ico { border-color: var(--gold); transform: translateY(-2px); }
.cat-chip:not(.on):hover .cat-chip-lbl { color: var(--dark); }

/* Ripple */
@keyframes ripple { 0%{opacity:.4;transform:scale(0)} 100%{opacity:0;transform:scale(2.6)} }
.cat-chip-ico .rpl {
  position: absolute;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  animation: ripple .4s ease-out forwards;
  pointer-events: none;
}

/* ── الأقسام الفرعية — تظهر جوا قسم المنتجات نفسه ── */
.subcats-wrap-inline {
  margin: -4px 0 14px;
}
.subcats-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 4px;
}
.subcats-scroll::-webkit-scrollbar { display: none; }

.subcat-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  min-width: 56px;
}
.subcat-chip-ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1.5px solid var(--border);
  background: var(--card);
  overflow: hidden;
  transition: all .2s;
}
.subcat-chip-ico img { width: 100%; height: 100%; object-fit: cover; }
.subcat-chip-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}
.subcat-chip.on .subcat-chip-ico { background: var(--cream); border-color: var(--gold); transform: scale(1.06); }
.subcat-chip.on .subcat-chip-lbl { color: var(--gold); font-weight: 800; }
