/* ── Category listing page ── */
.cat-page {
  padding: 1rem 0 2rem;
  background: #fff;
}

.cat-breadcrumb {
  margin-bottom: 0.75rem;
}

.cat-breadcrumb .breadcrumb {
  font-size: 0.8rem;
  --bs-breadcrumb-divider: '›';
  margin: 0;
}

.cat-breadcrumb .breadcrumb-item a {
  color: #888;
  text-decoration: none;
}

.cat-breadcrumb .breadcrumb-item a:hover {
  color: var(--primary);
}

.cat-breadcrumb .breadcrumb-item.active {
  color: #333;
  font-weight: 600;
}

.cat-header {
  margin-bottom: 0.85rem;
}

.cat-title {
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 800;
  color: #1a1a2e;
  margin: 0 0 0.3rem;
  line-height: 1.35;
}

.cat-intro {
  margin: 0;
  font-size: 0.88rem;
  color: #666;
  line-height: 1.6;
  max-width: 46rem;
}

.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #555;
  background: #faf9fb;
  border: 1px solid #ece8ee;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.cat-chip:hover {
  color: var(--primary);
  border-color: rgba(214, 51, 132, 0.3);
  background: #fff5f9;
}

.cat-chip.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.cat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  margin-bottom: 0.85rem;
  border-top: 1px solid #f2eef3;
  border-bottom: 1px solid #f2eef3;
}

.cat-toolbar-end {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cat-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  margin-bottom: 0.85rem;
  background: linear-gradient(135deg, #fff 0%, #fdf9fc 100%);
  border: 1px solid #ece4ea;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(214, 51, 132, 0.05);
  overflow-x: auto;
  scrollbar-width: none;
}

.cat-sort-bar::-webkit-scrollbar {
  display: none;
}

.cat-sort-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--primary);
  background: #fff5f9;
  border: 1px solid rgba(214, 51, 132, 0.12);
}

.cat-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cat-sort-label {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #3d4a5c;
  white-space: nowrap;
  padding-inline-start: 0.65rem;
  border-inline-start: 1px solid #e8e2e8;
}

.cat-sort-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.cat-sort-tab {
  padding: 0.35rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  font-size: 0.8rem;
  font-weight: 400;
  color: #8a96a3;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.cat-sort-tab:hover {
  color: #5b9bd5;
  background: #f5f9fd;
  border-color: #dceaf5;
}

.cat-sort-tab.is-active {
  color: #4a8fc9;
  font-weight: 600;
  background: #eef6fc;
  border-color: #c5ddf0;
}

.cat-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #f7f5f8;
  border: 1px solid #ece8ee;
  border-radius: 10px;
}

.cat-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #999;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.cat-view-btn:hover {
  color: var(--primary);
  background: #fff;
}

.cat-view-btn.is-active {
  color: var(--primary);
  background: #fff;
  box-shadow: 0 1px 4px rgba(214, 51, 132, 0.15);
}

.cat-count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #3d4552;
}

.cat-count i {
  font-size: 1.15rem;
  color: var(--primary);
}

/* ── View modes ── */
.cat-products-wrap.view-list .cat-view--grid {
  display: none;
}

.cat-products-wrap.view-grid .cat-view--list {
  display: none;
}

.cat-view--list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cat-view--grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

.cat-grid-col {
  min-width: 0;
  display: flex;
}

/* ── Grid cards (saraystore style) ── */
.cat-grid-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #f0ebf2;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cat-grid-card:hover {
  border-color: rgba(214, 51, 132, 0.2);
  box-shadow: 0 4px 16px rgba(214, 51, 132, 0.08);
}

.cat-grid-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: #faf8fb;
  overflow: hidden;
}

.cat-grid-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
  transition: transform 0.25s;
}

.cat-grid-card:hover .cat-grid-media img {
  transform: scale(1.03);
}

.cat-grid-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.cat-grid-badge {
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  white-space: nowrap;
}

.cat-grid-badge--stock {
  background: #4a90d9;
}

.cat-grid-badge--featured {
  background: #e53935;
}

.cat-grid-badge--new {
  background: #43a047;
}

.cat-grid-title {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.55;
  margin: 0;
  padding: 0.65rem 0.7rem 0.35rem;
  flex: 1;
}

.cat-grid-title a {
  color: #333;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-grid-title a:hover {
  color: var(--primary);
}

.cat-grid-price {
  padding: 0 0.7rem 0.7rem;
  text-align: center;
}

.cat-grid-price-current {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
}

.cat-grid-price-current small {
  font-size: 0.68rem;
  font-weight: 500;
}

.cat-grid-price-old {
  display: block;
  font-size: 0.68rem;
  color: #aaa;
  text-decoration: line-through;
  margin-bottom: 0.1rem;
}

/* ── Product list cards ── */
.cat-product-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cat-product-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid #f0ebf2;
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cat-product-card:hover {
  border-color: rgba(214, 51, 132, 0.22);
  box-shadow: 0 6px 22px rgba(214, 51, 132, 0.08);
}

.cat-product-media {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #faf8fb;
  aspect-ratio: 1;
}

.cat-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}

.cat-product-card:hover .cat-product-media img {
  transform: scale(1.04);
}

.cat-product-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff6b9d, var(--primary));
}

.cat-product-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cat-product-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.cat-product-brand {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.cat-product-volume {
  font-size: 0.68rem;
  color: #999;
  padding: 0.1rem 0.4rem;
  background: #f5f3f7;
  border-radius: 4px;
}

.cat-product-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 0.45rem;
}

.cat-product-title a {
  color: #1a1a2e;
  text-decoration: none;
}

.cat-product-title a:hover {
  color: var(--primary);
}

.cat-product-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cat-product-desc {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.75rem;
  background: #faf8fb;
  border: 1px solid #f0ebf3;
  border-radius: 10px;
}

.cat-product-features li {
  position: relative;
  padding-right: 0.75rem;
  font-size: 0.76rem;
  color: #666;
  line-height: 1.45;
}

.cat-product-features li::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0.45em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
}

.cat-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.cat-price-current {
  font-size: 1rem;
  font-weight: 800;
  color: #1a1a2e;
}

.cat-price-current small {
  font-size: 0.72rem;
  font-weight: 500;
  color: #888;
}

.cat-price-old {
  display: block;
  font-size: 0.72rem;
  color: #aaa;
  text-decoration: line-through;
}

.cat-product-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.cat-btn-detail,
.cat-btn-cart {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  white-space: nowrap;
}

.cat-add-form {
  margin: 0;
}

.cat-out-stock {
  font-size: 0.78rem;
  color: #999;
  padding: 0.3rem 0.6rem;
  background: #f5f5f5;
  border-radius: 8px;
}

.cat-empty {
  padding: 0.5rem 0;
}

.cat-seo {
  position: relative;
  margin-top: 1.75rem;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #fff5f9 0%, #f9f2ff 42%, #fff 100%);
  border: 1px solid rgba(214, 51, 132, 0.16);
  box-shadow:
    0 10px 36px rgba(214, 51, 132, 0.1),
    0 2px 10px rgba(155, 89, 182, 0.07);
}

.cat-seo::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(214, 51, 132, 0.09) 0%, transparent 52%),
    radial-gradient(circle at 0% 100%, rgba(155, 89, 182, 0.07) 0%, transparent 48%);
  pointer-events: none;
}

.cat-seo-accent {
  height: 4px;
  background: linear-gradient(90deg, #d63384, #9b59b6, #e84393);
}

.cat-seo-body {
  position: relative;
  padding: 1.35rem 1.5rem 1.45rem;
}

.cat-seo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(214, 51, 132, 0.2);
  font-size: 0.8rem;
  font-weight: 700;
  color: #c41e6a;
  box-shadow: 0 2px 8px rgba(214, 51, 132, 0.08);
}

.cat-seo-badge i {
  font-size: 0.95rem;
  color: #d63384;
}

.cat-seo-text {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: #3a3541;
  line-height: 1.9;
}

@media (max-width: 575px) {
  .cat-seo-body {
    padding: 1.1rem 1.15rem 1.2rem;
  }

  .cat-seo-text {
    font-size: 0.95rem;
    line-height: 1.85;
  }
}

@media (min-width: 768px) {
  .cat-view--grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .cat-grid-title {
    font-size: 0.85rem;
  }

  .cat-grid-price-current {
    font-size: 0.92rem;
  }

  .cat-product-card {
    grid-template-columns: 170px 1fr;
    padding: 1rem 1.15rem;
    gap: 1.15rem;
  }

  .cat-product-title {
    font-size: 0.98rem;
  }

  .cat-product-features li {
    font-size: 0.8rem;
  }
}

@media (max-width: 575px) {
  .cat-page {
    padding-top: 0.75rem;
  }

  .cat-product-card {
    grid-template-columns: 110px 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .cat-product-desc {
    padding: 0.55rem 0.65rem;
  }

  .cat-product-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .cat-product-actions {
    width: 100%;
  }

  .cat-btn-detail,
  .cat-add-form {
    flex: 1;
  }

  .cat-btn-detail,
  .cat-btn-cart {
    width: 100%;
    text-align: center;
  }

  .cat-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .cat-chips::-webkit-scrollbar {
    display: none;
  }

  .cat-toolbar {
    flex-wrap: wrap;
  }

  .cat-sort-bar {
    margin-bottom: 0.65rem;
  }
}

/* ── Product color shades ── */
.cat-product-price-row,
.cat-grid-price-row {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.cat-product-price-row .cat-product-price,
.cat-grid-price-row .cat-grid-price {
  flex: 1 1 auto;
  min-width: 0;
}

.cat-color-shades {
  position: relative;
  flex: 0 0 auto;
}

.cat-color-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid #f0e0ea;
  border-radius: 12px;
  background: #fff;
  color: #555;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.cat-color-trigger:hover,
.cat-color-shades.is-open .cat-color-trigger {
  border-color: rgba(214, 51, 132, 0.35);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(214, 51, 132, 0.08);
}

.cat-color-trigger-label {
  color: #666;
}

.cat-color-shades--compact .cat-color-trigger-selected {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cat-color-shades--compact .cat-color-trigger-selected img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.cat-color-shades--compact:not(.has-selection) .cat-color-trigger-selected {
  display: none !important;
}

.cat-color-trigger-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cat-color-trigger-preview img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.cat-color-trigger-dot,
.cat-color-trigger-selected-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.cat-color-swatch--hex {
  display: inline-block;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.cat-color-option.is-out {
  opacity: 0.55;
}

.cat-color-trigger-code {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  direction: ltr;
  unicode-bidi: isolate;
}

.cat-color-trigger-chevron {
  font-size: 0.65rem;
  color: #aaa;
  transition: transform 0.15s ease;
}

.cat-color-shades.is-open .cat-color-trigger-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.cat-color-shades--popover-down {
  overflow: visible;
}

.cat-color-shades--popover-down .cat-color-popover {
  top: calc(100% + 0.45rem);
  bottom: auto;
  left: 0;
  right: auto;
}

.cat-color-shades--popover-down .cat-color-popover::after {
  top: -6px;
  bottom: auto;
  left: 1.25rem;
  right: auto;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid #f0e0ea;
  border-top: 1px solid #f0e0ea;
}

.cat-color-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 30;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 2rem));
  padding: 0.65rem;
  border: 1px solid #f0e0ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(26, 26, 46, 0.14);
}

.cat-color-popover::after {
  content: '';
  position: absolute;
  left: 1.25rem;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #f0e0ea;
  border-bottom: 1px solid #f0e0ea;
  transform: rotate(45deg);
}

.cat-color-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cat-color-item {
  margin: 0;
}

.cat-color-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.35rem 0.4rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  text-align: right;
  cursor: pointer;
}

.cat-color-option:hover,
.cat-color-option.is-selected {
  background: #fdf5f9;
}

.cat-color-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0;
  border-radius: 10px;
}

.cat-color-item:hover {
  background: transparent;
}

.cat-color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(214, 51, 132, 0.15);
}

.cat-color-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  text-align: right;
}

.cat-color-type {
  font-size: 0.8rem;
  font-weight: 700;
  color: #333;
}

.cat-color-code {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary);
}

.cat-product-footer {
  flex-direction: column;
  align-items: stretch;
}

.cat-product-footer .cat-product-actions {
  justify-content: flex-end;
}

@media (max-width: 575px) {
  .cat-color-trigger {
    font-size: 0.68rem;
    padding: 0.4rem 0.55rem;
  }

  .cat-color-popover {
    left: auto;
    right: 0;
  }

  .cat-color-popover::after {
    left: auto;
    right: 1.25rem;
  }
}
