/* ══════════════════════════════════════════════════
   TZ WooCommerce Categories — categories.css
   Heiarchy preserved from original design.
   Root selector: .tz-cats-root
   Icon background unified: #89CDC1
══════════════════════════════════════════════════ */

/* ── ROOT / VARIABLES ── */
.tz-cats-root {
  all: revert;
  box-sizing: border-box !important;
  font-family: 'Cairo', sans-serif !important;
  direction: rtl !important;
  overflow-x: hidden;
  --tz-pri:   #272c4a;
  --tz-pri-d: #1a1f36;
  --tz-pri-l: #363d66;
  --tz-sec:   #89cdc1;
  --tz-sec-d: #5ba898;
  --tz-sec-l: #b0dfd8;
  --tz-rad:   16px;
  --tz-pad:   40px;
}
.tz-cats-root *,
.tz-cats-root *::before,
.tz-cats-root *::after { box-sizing: border-box !important; font-family: inherit; }
.tz-cats-root a { text-decoration: none !important; }
.tz-cats-root img { max-width: 100%; height: auto; }
.tz-cats-root button { cursor: pointer; font-family: inherit !important; }

/* ── CATEGORIES SECTION ── */
.tz-cats-root .tz-cats-section {
  padding: 20px var(--tz-pad) 28px;
  max-width: 1400px;
  margin: 0 auto;
}
.tz-cats-root .tz-cats-slider-wrap {
  position: relative !important;
  padding: 0 24px !important;
}

/* ── ARROW BUTTONS ── */
.tz-cats-root .tz-cat-arr {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: #fff !important;
  border: 1.5px solid rgba(39,44,74,.12) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 20 !important;
  box-shadow: 0 2px 10px rgba(39,44,74,.08) !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}
.tz-cats-root .tz-cat-arr:hover {
  background: var(--tz-sec) !important;
  border-color: var(--tz-sec) !important;
  box-shadow: 0 4px 16px rgba(137,205,193,.4) !important;
}
.tz-cats-root .tz-cat-arr:hover svg { stroke: #fff !important; }
.tz-cats-root .tz-cat-arr svg {
  width: 16px !important;
  height: 16px !important;
  stroke: var(--tz-pri) !important;
  fill: none !important;
  stroke-width: 2.5 !important;
  transition: stroke .2s !important;
  display: block !important;
}
.tz-cats-root .tz-cat-arr-prev { right: -18px !important; left: auto !important; }
.tz-cats-root .tz-cat-arr-next { left: -18px !important; right: auto !important; }
.tz-cats-root .tz-cat-arr.tz-disabled { opacity: .3 !important; pointer-events: none !important; }

/* ── VIEWPORT + TRACK ── */
.tz-cats-root .tz-cats-viewport {
  overflow: hidden !important;
  padding: 6px 4px 10px !important;
  margin: -6px -4px -10px !important;
  touch-action: pan-y !important;
  cursor: grab !important;
}
.tz-cats-root .tz-cats-track {
  display: flex !important;
  gap: 14px;
  transition: transform .55s cubic-bezier(.77, 0, .18, 1);
  will-change: transform;
}

/* ── CATEGORY CARD ── */
.tz-cats-root .tz-cat-card {
  flex: 0 0 calc((100% - 5 * 14px) / 6);
  min-width: 0;
  background: #fff;
  border-radius: 16px;
  padding: 20px 12px 16px;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px;
  cursor: pointer;
  border: 2px solid transparent !important;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  text-align: center;
  position: relative !important;
  overflow: hidden !important;
  user-select: none;
  opacity: 0;
  animation: tz-fadeUp .5s forwards;
  color: var(--tz-pri);
}
.tz-cats-root .tz-cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(137,205,193,.08), transparent);
  opacity: 0;
  transition: .3s;
}
.tz-cats-root .tz-cat-card:hover {
  border-color: var(--tz-sec) !important;
  transform: translateY(-5px) !important;
  box-shadow: 0 12px 32px rgba(39,44,74,.12);
}
.tz-cats-root .tz-cat-card:hover::before { opacity: 1; }
.tz-cats-root .tz-cat-card.tz-active {
  border-color: var(--tz-pri) !important;
  box-shadow: 0 8px 22px rgba(39,44,74,.1) !important;
}

/* ── CATEGORY ICON ─ unified background #89CDC1 ── */
.tz-cats-root .tz-cat-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s;
  background: #89CDC1 !important; /* سلوك موحد — بدل الألوان المتعددة */
}
.tz-cats-root .tz-cat-card:hover .tz-cat-icon { transform: scale(1.1) rotate(-5deg); }

.tz-cats-root .tz-cat-icon img,
.tz-cats-root .tz-cat-icon svg {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
/* Ensure SVG strokes are visible on teal background */
.tz-cats-root .tz-cat-icon svg { stroke: #fff; }

/* ── LABEL + COUNT ── */
.tz-cats-root .tz-cat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--tz-pri);
  white-space: normal;
  line-height: 1.4;
  word-break: keep-all;
}
.tz-cats-root .tz-cat-count {
  font-size: 10px;
  color: rgba(39,44,74,.4);
  font-weight: 600;
}

/* ── FADE-UP ANIMATION ── */
@keyframes tz-fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── DOTS ── */
.tz-cats-root .tz-cats-dots {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 0 !important;
  margin: 16px 0 0 !important;
  list-style: none !important;
  line-height: 1 !important;
}
.tz-cats-root .tz-cats-dot {
  display: inline-block !important;
  width: 7px !important;
  min-width: 7px !important;
  max-width: 22px !important;
  height: 7px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  line-height: 1 !important;
  font-size: 0 !important;
  vertical-align: middle !important;
  cursor: pointer !important;
  transition: width .3s, background .3s, border-radius .3s !important;
  flex-shrink: 0 !important;
  background: rgba(39,44,74,.15) !important;
}
.tz-cats-root .tz-cats-dot.tz-active {
  background: var(--tz-sec) !important;
  width: 22px !important;
  max-width: 22px !important;
  border-radius: 4px !important;
}

/* ══ RESPONSIVE — TABLET ══ */
@media (max-width: 900px) {
  .tz-cats-root { --tz-pad: 24px; }
  .tz-cats-root .tz-cat-card {
    padding: 16px 10px 12px;
    flex-basis: calc((100% - 3 * 14px) / 4);
  }
  .tz-cats-root .tz-cat-icon { width: 52px; height: 52px; }
  .tz-cats-root .tz-cat-label { font-size: 11px; }
  .tz-cats-root .tz-cat-arr-prev { right: -14px !important; }
  .tz-cats-root .tz-cat-arr-next { left: -14px !important; }
}

/* ══ RESPONSIVE — MOBILE ══ */
@media (max-width: 600px) {
  .tz-cats-root { --tz-pad: 16px; }
  .tz-cats-root .tz-cats-section { padding: 16px var(--tz-pad) 24px; }
  .tz-cats-root .tz-cat-card {
    padding: 14px 8px 12px;
    border-radius: 12px;
    flex-basis: calc((100% - 2 * 10px) / 3);
  }
  .tz-cats-root .tz-cats-track { gap: 10px; }
  .tz-cats-root .tz-cat-icon { width: 46px; height: 46px; border-radius: 11px; }
  .tz-cats-root .tz-cat-icon img,
  .tz-cats-root .tz-cat-icon svg { width: 22px; height: 22px; }
  .tz-cats-root .tz-cat-label  { font-size: 10px; }
  .tz-cats-root .tz-cat-count  { font-size: 9px; }
  .tz-cats-root .tz-cat-arr { width: 32px !important; height: 32px !important; }
  .tz-cats-root .tz-cat-arr-prev { right: -14px !important; }
  .tz-cats-root .tz-cat-arr-next { left: -14px !important; }
}
