/*
 * danh-muc.css
 * Page-specific styles for the Category / Catalog page (Danh Mục)
 * Requires style.css to be loaded first.
 */

/* ──────────────────────────────────────────
   PAGE HERO (CATEGORY BANNER)
────────────────────────────────────────── */
.page-hero {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 36px;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 120% at 80% 50%, rgba(232,255,71,.07) 0%, transparent 65%),
    radial-gradient(ellipse 30% 80% at 10% 50%, rgba(41,214,181,.05) 0%, transparent 60%);
}

.page-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.page-hero .container {
  position: relative;
  z-index: 2;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}

.breadcrumb a {
  transition: color .2s;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-sep {
  opacity: .4;
}

/* ── Hero content row ── */
.page-hero-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-hero-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-hero-eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--accent);
}

.page-hero h1 {
  font-family: var(--ff-head);
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: .04em;
  line-height: 1;
  margin-bottom: 10px;
}

.page-hero-desc {
  color: var(--muted);
  font-size: 13px;
  max-width: 500px;
}

/* ── Stats pills ── */
.page-hero-stats {
  display: flex;
  gap: 28px;
  flex-shrink: 0;
}

.ph-stat {
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 22px;
}

.ph-stat-val {
  font-family: var(--ff-head);
  font-size: 1.8rem;
  color: var(--accent);
  letter-spacing: .04em;
  line-height: 1;
}

.ph-stat-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

/* ──────────────────────────────────────────
   SUB-CATEGORY NAV BAR
────────────────────────────────────────── */
.cat-nav-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}

.cat-nav-bar::-webkit-scrollbar {
  height: 3px;
}

.cat-nav-inner {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.cat-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color .2s;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
  text-decoration: none;
}

.cat-nav-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.cat-nav-item:hover {
  color: var(--text);
}

.cat-nav-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cat-nav-count {
  background: var(--surface2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
}

.cat-nav-item.active .cat-nav-count {
  background: rgba(232,255,71,.15);
  color: var(--accent);
}

/* ──────────────────────────────────────────
   CATALOG LAYOUT (SIDEBAR + GRID)
────────────────────────────────────────── */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  padding: 36px 0 72px;
  align-items: start;
}

/* ──────────────────────────────────────────
   SIDEBAR / FILTER PANELS
────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.filter-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.filter-header-left svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
}

.filter-chevron {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2.2;
  transition: transform .3s;
}

.filter-panel.collapsed .filter-chevron {
  transform: rotate(-90deg);
}

.filter-body {
  padding: 18px 20px;
}

.filter-panel.collapsed .filter-body {
  display: none;
}

/* ── Price Range ── */
.price-range-vals {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.price-val {
  color: var(--accent);
  font-family: var(--ff-head);
  font-size: 1rem;
  letter-spacing: .04em;
}

.range-wrap {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

.range-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
}

.range-fill {
  position: absolute;
  height: 4px;
  background: var(--accent);
  border-radius: 99px;
  left: 0%;
  right: 35%;
}

input[type=range] {
  position: absolute;
  width: 100%;
  appearance: none;
  background: transparent;
  height: 4px;
  pointer-events: none;
}

input[type=range]::-webkit-slider-thumb {
  appearance: none;
  pointer-events: all;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(232,255,71,.3);
}

.price-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.price-preset {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.price-preset:hover,
.price-preset.active {
  background: rgba(232,255,71,.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Checkbox Filters ── */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background .2s;
}

.checkbox-item:hover {
  background: var(--surface2);
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.2);
  background: var(--surface2);
  display: grid;
  place-items: center;
  transition: border-color .2s, background .2s;
}

.checkbox-item.checked .checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-box svg {
  width: 11px;
  height: 11px;
  stroke: #000;
  fill: none;
  stroke-width: 3;
  opacity: 0;
  transition: opacity .2s;
}

.checkbox-item.checked .checkbox-box svg {
  opacity: 1;
}

.checkbox-label {
  font-size: 13px;
  flex: 1;
}

.checkbox-count {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 99px;
}

.show-more-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
  background: none;
  border: none;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.show-more-btn:hover {
  color: var(--accent);
}

.show-more-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

/* ── Feature Chips ── */
.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-chip {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all .2s;
}

.feature-chip:hover {
  border-color: rgba(255,255,255,.2);
  color: var(--text);
}

.feature-chip.active {
  background: rgba(232,255,71,.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Rating Filter ── */
.rating-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background .2s;
}

.rating-row:hover {
  background: var(--surface2);
}

.rating-stars {
  display: flex;
  gap: 2px;
}

.rating-stars .s {
  color: var(--accent);
  font-size: 13px;
}

.rating-stars .s.off {
  color: var(--surface2);
}

.rating-label {
  font-size: 12px;
  color: var(--muted);
}

.rating-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.rating-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

/* ── Active Filters ── */
.filter-actions {
  display: flex;
  gap: 10px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.active-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,255,71,.1);
  border: 1px solid rgba(232,255,71,.3);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: background .2s;
}

.active-tag:hover {
  background: rgba(232,255,71,.2);
}

.active-tag svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 3;
}

/* ──────────────────────────────────────────
   TOOLBAR (SORT + VIEW TOGGLE)
────────────────────────────────────────── */
.toolbar {
  display: flex;
  flex-direction: column;
  /* align-items: center; */
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.result-count {
  font-size: 13px;
  color: var(--muted);
}

.result-count strong {
  color: var(--text);
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.sort-btn {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sort-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.sort-btn:hover {
  border-color: rgba(255,255,255,.2);
  color: var(--text);
}

.sort-btn.active {
  background: rgba(232,255,71,.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* .view-toggle {
  display: flex;
  gap: 6px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.view-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .2s;
}

.view-btn svg {
  width: 15px;
  height: 15px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.8;
}

.view-btn.active {
  background: rgba(232,255,71,.1);
  border-color: var(--accent);
}

.view-btn.active svg {
  stroke: var(--accent);
} */

/* ──────────────────────────────────────────
   CATALOG PRODUCT GRID
────────────────────────────────────────── */
.product-grid.archive-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Card overrides specific to the catalog page */
.product-grid.archive-product-grid .product-card {
  background: var(--surface);
  position: relative;
}

.product-grid.archive-product-grid .product-thumb {
  aspect-ratio: 1/1;
}

.product-grid.archive-product-grid .product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-grid.archive-product-grid .product-actions {
  display: flex;
	flex-direction: row;
  gap: 8px;
  margin-top: auto;
}

.thumb-icon {
  width: 56px;
  height: 56px;
  opacity: .2;
  stroke: white;
  fill: none;
  stroke-width: 1;
}

/* ── Thumb Badges ── */
.thumb-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
}

.badge-sale    { background: var(--accent);  color: #000; }
.badge-new     { background: var(--accent2); color: #fff; }
.badge-hot     { background: var(--accent3); color: #000; }
.badge-soldout { background: rgba(255,255,255,.1); color: var(--muted); }

/* ── Product Meta (catalog-specific) ── */
.product-brand {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent3);
}

.product-stars {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stars {
  display: flex;
  gap: 1px;
}

.stars .s {
  font-size: 11px;
  color: var(--accent);
}

.stars .s.half {
  opacity: .5;
}

.stars .s.off {
  color: var(--surface2);
}

.review-count {
  font-size: 11px;
  color: var(--muted);
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ptag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 5px;
}

/* ── Cart icon button ── */
.btn-icon {
  width: 36px;
  flex: none;
  padding: 0;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--muted);
}

.btn-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.btn-icon:hover {
  border-color: var(--accent3);
  color: var(--accent3);
}

/* ── Stock Indicator ── */
.stock-bar {
  margin-top: 6px;
}

.stock-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
}

.stock-label span:last-child {
  color: var(--accent2);
  font-weight: 700;
}

.stock-track {
  height: 3px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.stock-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent3), var(--accent2));
  border-radius: 99px;
}

/* ──────────────────────────────────────────
   PAGINATION
────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.page-btn, .page-numbers {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all .2s;
  color: var(--text);
}

.page-btn:hover, .page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn.active, span.page-numbers {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.page-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

/* ──────────────────────────────────────────
   MOBILE FILTER TOGGLE BUTTON
────────────────────────────────────────── */
.mobile-filter-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

/* ──────────────────────────────────────────
   CATALOG PAGE ANIMATIONS
────────────────────────────────────────── */
.product-grid.archive-product-grid .product-card { animation: fadeUp .4s ease both; }
.product-grid.archive-product-grid .product-card:nth-child(1) { animation-delay: .05s; }
.product-grid.archive-product-grid .product-card:nth-child(2) { animation-delay: .10s; }
.product-grid.archive-product-grid .product-card:nth-child(3) { animation-delay: .15s; }
.product-grid.archive-product-grid .product-card:nth-child(4) { animation-delay: .20s; }
.product-grid.archive-product-grid .product-card:nth-child(5) { animation-delay: .25s; }
.product-grid.archive-product-grid .product-card:nth-child(6) { animation-delay: .30s; }
.product-grid.archive-product-grid .product-card:nth-child(7) { animation-delay: .35s; }
.product-grid.archive-product-grid .product-card:nth-child(8) { animation-delay: .40s; }
.product-grid.archive-product-grid .product-card:nth-child(9) { animation-delay: .45s; }

/* ──────────────────────────────────────────
   CATALOG RESPONSIVE
────────────────────────────────────────── */
@media (max-width: 1024px) {
  .catalog-layout {
    grid-template-columns: 240px 1fr;
    gap: 20px;
  }

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

  .page-hero-stats {
    display: none;
  }
}

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

  .sidebar {
    position: static;
    display: none;
  }

  .sidebar.open {
    display: flex;
  }

  .mobile-filter-toggle {
    display: block;
  }
}

@media (max-width: 580px) {
	.product-grid.archive-product-grid .product-actions {
		flex-direction: column;
	}
	
	
	.product-grid.archive-product-grid .product-actions .btn {
		max-width: 100%;
	}
}

@media (max-width: 520px) {
  .product-grid.archive-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 380px) {
  .product-grid.archive-product-grid {
    grid-template-columns: 1fr;
  }
}