/* Zhenbensi Product Catalog — matches reference design */

.zbs-catalog {
  --zbs-red: #c30000;
  --zbs-red-dark: #a00000;
  --zbs-navy: #1a202c;
  --zbs-navy-light: #2d3748;
  --zbs-text: #1a1a1a;
  --zbs-muted: #666;
  --zbs-line: #e8e8e8;
  --zbs-bg: #f5f5f5;
  --zbs-white: #fff;
  --zbs-sidebar-w: 280px;
  --zbs-radius: 0;
  --zbs-columns: 4;

  display: grid;
  grid-template-columns: var(--zbs-sidebar-w) 1fr;
  gap: 0;
  font-family: 'Segoe UI', Tahoma, 'Noto Sans Arabic', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--zbs-text);
  background: var(--zbs-bg);
  min-height: 500px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.zbs-catalog *,
.zbs-catalog *::before,
.zbs-catalog *::after {
  box-sizing: border-box;
}

/* ── Sidebar ── */
.zbs-sidebar {
  background: var(--zbs-navy);
  display: flex;
  flex-direction: column;
}

.zbs-sidebar__head {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--zbs-red);
  color: #fff;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.zbs-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  max-height: 720px;
  scrollbar-width: thin;
  scrollbar-color: var(--zbs-navy-light) var(--zbs-navy);
}

.zbs-sidebar__nav::-webkit-scrollbar { width: 5px; }
.zbs-sidebar__nav::-webkit-scrollbar-thumb { background: var(--zbs-navy-light); }

.zbs-sidebar__empty {
  padding: 20px 18px;
  color: rgba(255,255,255,.6);
  font-size: 13px;
}

.zbs-cat-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 18px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.zbs-cat-tab:hover,
.zbs-cat-tab.is-active {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.zbs-cat-tab.is-active {
  border-inline-start: 3px solid var(--zbs-red);
  padding-inline-start: 15px;
}

.zbs-cat-tab__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.zbs-cat-tab__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.zbs-cat-tab__logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.zbs-cat-tab__label {
  flex: 1;
}

.zbs-cat-tab__arrow {
  flex-shrink: 0;
  opacity: .5;
}

.zbs-cat-tab__expand {
  flex-shrink: 0;
  opacity: .7;
  transition: transform .2s;
}

.zbs-cat-group.is-open > .zbs-cat-tab--parent .zbs-cat-tab__expand {
  transform: rotate(180deg);
}

.zbs-cat-children {
  background: rgba(0, 0, 0, 0.2);
}

.zbs-cat-children[hidden] {
  display: none !important;
}

.zbs-cat-tab--child {
  padding-inline-start: 36px;
  font-size: 12px;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.zbs-cat-tab--child .zbs-cat-tab__icon {
  width: 18px;
  height: 18px;
}

.zbs-cat-tab--child .zbs-cat-tab__logo {
  width: 18px;
  height: 18px;
}

a.zbs-cat-tab {
  text-decoration: none;
  color: rgba(255,255,255,.9);
}

a.zbs-cat-tab:hover,
a.zbs-cat-tab.is-active {
  color: #fff;
}

.zbs-cat-tab--product .zbs-cat-tab__label {
  font-weight: 600;
}

/* ── Main area ── */
.zbs-main {
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  width: 100%;
}

/* Search */
.zbs-search {
  display: flex;
  gap: 0;
  width: 100%;
  background: var(--zbs-white);
  border: 1px solid var(--zbs-line);
}

.zbs-search input {
  flex: 1;
  border: none;
  padding: 14px 18px;
  font-size: 14px;
  outline: none;
  background: transparent;
  font-family: inherit;
}

.zbs-search input::placeholder { color: #aaa; }

.zbs-search button {
  background: var(--zbs-red);
  color: #fff;
  border: none;
  padding: 0 28px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background .2s;
  font-family: inherit;
}

.zbs-search button:hover { background: var(--zbs-red-dark); }

/* Section title */
.zbs-section-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--zbs-text);
  margin: 0 0 20px;
  position: relative;
  padding-bottom: 10px;
}

.zbs-section-title::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  background: var(--zbs-red);
}

/* Products section */
.zbs-products__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.zbs-products__head .zbs-section-title {
  margin-bottom: 0;
}

.zbs-products__view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--zbs-red);
  text-decoration: none;
  transition: opacity .2s;
}

.zbs-products__view-all:hover { opacity: .75; color: var(--zbs-red); }

.zbs-products__wrap {
  position: relative;
  margin-top: 20px;
  width: 100%;
}

.zbs-products__grid {
  display: grid;
  grid-template-columns: repeat(var(--zbs-columns), 1fr);
  gap: 16px;
  width: 100%;
  transition: opacity .25s;
}

.zbs-products__grid.is-loading {
  opacity: .4;
  pointer-events: none;
}

/* Product card */
.zbs-product-card {
  background: var(--zbs-white);
  border: 1px solid var(--zbs-line);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
}

.zbs-product-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

.zbs-product-card__image {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #fafafa;
}

.zbs-product-card__image img,
.zbs-product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s;
}

.zbs-product-card:hover .zbs-product-card__image img {
  transform: scale(1.04);
}

.zbs-product-card__body {
  padding: 14px 14px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.zbs-product-card__title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
  color: var(--zbs-text);
}

.zbs-product-card__sku {
  font-size: 12px;
  color: var(--zbs-muted);
  margin: 0 0 12px;
}

.zbs-product-card__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--zbs-red);
  color: #fff;
  padding: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  margin-top: auto;
  transition: background .2s;
}

.zbs-product-card__cta:hover {
  background: var(--zbs-red-dark);
  color: #fff;
}

.zbs-product-card__cta svg {
  transform: none;
}

/* Carousel next btn */
.zbs-carousel-btn {
  position: absolute;
  top: 50%;
  inset-inline-end: -18px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--zbs-white);
  border: 1px solid var(--zbs-line);
  color: var(--zbs-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  transition: all .2s;
  z-index: 2;
}

.zbs-carousel-btn:hover {
  background: var(--zbs-red);
  border-color: var(--zbs-red);
  color: #fff;
}

/* Loader */
.zbs-products__loader {
  text-align: center;
  padding: 20px;
}

.zbs-products__loader[hidden] { display: none; }

.zbs-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--zbs-line);
  border-top-color: var(--zbs-red);
  border-radius: 50%;
  animation: zbs-spin .7s linear infinite;
}

@keyframes zbs-spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.zbs-products__wrap.is-empty {
  min-height: 200px;
}

.zbs-empty-notice {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}

.zbs-empty-notice:not([hidden]) {
  display: flex;
}

.zbs-empty-notice span {
  font-size: 14px;
  color: var(--zbs-muted);
}

.zbs-products__wrap.is-empty .zbs-carousel-btn {
  display: none;
}

/* Legacy empty (errors only) */
.zbs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 20px;
  color: var(--zbs-muted);
  font-size: 14px;
}

.zbs-empty strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--zbs-text);
}

.zbs-empty p {
  color: var(--zbs-muted);
  margin: 0;
  font-size: 13px;
}

.zbs-catalog--rtl .zbs-cat-tab {
  text-align: right;
}

.zbs-catalog--rtl .zbs-cat-tab__arrow {
  transform: scaleX(-1);
}

.zbs-catalog--rtl .zbs-products__view-all svg {
  transform: scaleX(-1);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .zbs-catalog { --zbs-sidebar-w: 240px; }
}

@media (max-width: 900px) {
  .zbs-catalog {
    grid-template-columns: 1fr;
  }

  .zbs-sidebar__nav {
    max-height: 280px;
  }

  .zbs-main { padding: 20px 16px; }

  .zbs-products__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .zbs-carousel-btn { inset-inline-end: -8px; }
}

@media (max-width: 520px) {
  .zbs-products__grid {
    grid-template-columns: 1fr;
  }

  .zbs-search { flex-direction: column; }
  .zbs-search button { padding: 14px; }
}
