/* Products list page */
:root {
  --pl-cream: #F5F0E8;
  --pl-warm-white: #FDFAF4;
  --pl-sand: #E8DDD0;
  --pl-terracotta: #C4714A;
  --pl-deep-sage: #3D5445;
  --pl-light-sage: #8FAF90;
  --pl-warm-black: #1C1A17;
  --pl-muted: #8A8070;
  --pl-gold: #C9A96E;
  --pl-gold-light: #E8D5A3;
}

.page-wrap {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh);
  margin: 0 auto;
}

.page-wrap .sidebar {
  border-right: 1px solid var(--pl-sand);
  padding: 1rem;
  padding-top: 8px;
  position: fixed;
  top: 64px;
  /* left: 0; */
  width: 260px;
  height: calc(100vh);
  scrollbar-width: thin;
  scrollbar-color: var(--pl-sand) transparent;
  background: var(--pl-warm-white);
  z-index: 2;
}

.page-wrap .sidebar::-webkit-scrollbar {
  width: 4px;
}

.page-wrap .sidebar::-webkit-scrollbar-thumb {
  background: var(--pl-sand);
  border-radius: 2px;
}

.sidebar-title {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b6053;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pl-sand);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-close {
  display: none;
  border: 0;
  background: transparent;
  color: #8a8070;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.cat-group {
  margin-bottom: 28px;
}

.sidebar-divider {
  width: 100%;
  height: 1px;
  background: var(--pl-sand);
  margin: 4px 0 20px;
}

.cat-group-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pl-warm-black);
  font-weight: 500;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.cat-group-title .cg-icon {
  font-size: 14px;
}

.cat-group-title .cg-arrow {
  margin-left: auto;
  width: 18px;
  height: 18px;
  color: var(--pl-muted);
  transition: transform .25s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cat-group-title .cg-arrow::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.cat-group.open .cg-arrow {
  transform: rotate(180deg);
}

.sidebar-range {
  font-size: 12px;
  color: var(--pl-muted);
  margin: 2px 0 10px;
}

.products-range-info {
  font-size: 13px;
  color: #6b6053;
  margin: 0;
  white-space: nowrap;
}

.cat-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-height: 4000px;
  transition: max-height .3s;
}

.cat-group.closed .cat-items {
  max-height: 0;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: inherit;
}

.cat-item-row {
  position: relative;
}

.cat-node.has-children>.cat-item-row .cat-item {
  padding-right: 34px;
}

.cat-item:hover {
  background: var(--pl-cream);
}

.cat-item.active {
  background: var(--pl-cream);
}

.cat-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-item-icon {
  font-size: 14px;
}

.cat-item-name {
  font-size: 13px;
  color: var(--pl-warm-black);
}

.cat-item.active .cat-item-name {
  color: #8f4f30;
  font-weight: 500;
}

.cat-item.active-parent .cat-item-name {
  color: #8f5f45;
  font-weight: 500;
}

.cat-item-child .cat-item-left {
  padding-left: 16px;
}

.cat-item-depth-2 .cat-item-left {
  padding-left: 28px;
}

.cat-item-depth-3 .cat-item-left {
  padding-left: 40px;
}

.cat-item-count {
  font-size: 11px;
  /* WCAG AA: #8a8070 on #e8ddd0 ~2.9:1 — dùng #6b6053 (~6.3:1) */
  color: #6b6053;
  background: var(--pl-sand);
  padding: 2px 7px;
  border-radius: 10px;
}

.cat-item.active .cat-item-count {
  background: #8f4f30;
  color: #fff;
}

.cat-children {
  display: none;
}

.cat-node.is-open>.cat-children {
  display: block;
}

.cat-expand-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pl-muted);
  cursor: pointer;
}

.cat-expand-icon {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.cat-node.is-open>.cat-item-row .cat-expand-icon {
  transform: rotate(-135deg);
}

.sb-section {
  margin-bottom: 28px;
}

.sb-section-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pl-warm-black);
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.sb-section-title .cg-arrow {
  width: 18px;
  height: 18px;
  color: var(--pl-muted);
  transition: transform .25s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sb-section-title .cg-arrow::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.sb-section.closed .cg-arrow {
  transform: rotate(180deg);
}

.sb-section-body {
  overflow: hidden;
  max-height: 300px;
  transition: max-height .3s;
}

.sb-section.closed .sb-section-body {
  max-height: 0;
}

.style-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.style-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--pl-sand);
  font-size: 11px;
  cursor: pointer;
  color: var(--pl-muted);
  transition: all .2s;
  letter-spacing: 0.04em;
}

.style-chip:hover {
  border-color: var(--pl-muted);
  color: var(--pl-warm-black);
}

.style-chip.active {
  background: var(--pl-warm-black);
  color: var(--pl-cream);
  border-color: var(--pl-warm-black);
}

.clear-filters {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(196, 113, 74, 0.35);
  background: linear-gradient(180deg, #FFF8F2 0%, #FFF1E7 100%);
  border-radius: 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--pl-terracotta);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  margin-top: 8px;
  box-shadow: 0 10px 22px rgba(196, 113, 74, 0.12);
}

.main-content {
  padding: 0 32px 60px;
  min-width: 0;
  margin-left: 260px;
}

.breadcrumb {
  padding: 0.5rem 0;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--pl-muted);
  letter-spacing: 0.04em;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  border-bottom: 1px solid var(--pl-sand);
}

.breadcrumb::-webkit-scrollbar {
  display: none;
}

.breadcrumb a {
  color: #6b6053;
  text-decoration: none;
  transition: color .2s;
  flex-shrink: 0;
}

.breadcrumb a:hover {
  color: var(--pl-terracotta);
}

.breadcrumb span {
  color: var(--pl-warm-black);
  flex-shrink: 0;
}

.bc-sep {
  opacity: 0.4;
  flex-shrink: 0;
}

.cat-header-block {
  padding: 24px 0 0;
  margin-bottom: 0;
}

.cat-h1-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.cat-h1 {
  margin: 0;
  font-family: 'Playfair Display', 'Be Vietnam Pro', serif;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 500;
  color: var(--pl-warm-black);
  line-height: 1.15;
  position: relative;
}

.cat-h1::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--pl-terracotta);
  margin-top: 6px;
  border-radius: 1px;
}

.cat-desc-wrap {
  position: relative;
  background: var(--pl-warm-white);
  border: 1px solid var(--pl-sand);
  border-left: 3px solid var(--pl-terracotta);
  border-radius: 0 4px 4px 0;
  padding: 14px 18px 12px;
  margin-bottom: 16px;
}

.cat-desc {
  font-size: 13px;
  color: var(--pl-warm-black);
  line-height: 1.85;
  max-height: 44px;
  overflow: hidden;
  transition: max-height .45s cubic-bezier(0.4, 0, 0.2, 1);
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.cat-desc.expanded {
  max-height: 300px;
  mask-image: none;
  -webkit-mask-image: none;
}

.cat-desc-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--pl-terracotta);
  letter-spacing: 0.04em;
  padding: 0;
  transition: opacity .2s;
}

.cat-desc-toggle:hover {
  opacity: 0.7;
}

.cat-desc-toggle-icon {
  transition: transform .3s;
}

.cat-desc-toggle.open .cat-desc-toggle-icon {
  transform: rotate(180deg);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-filters-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--pl-cream);
  border: 1px solid var(--pl-sand);
  border-radius: 20px;
  font-size: 11px;
  color: var(--pl-warm-black);
  cursor: pointer;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-dropdown {
  position: relative;
}

.sort-trigger {
  min-width: 168px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #6b3f29;
  border-radius: 999px;
  background: linear-gradient(180deg, #d08a5f 0%, #c47b4f 100%);
  color: #fff4e9;
  box-shadow:
    0 10px 20px rgba(120, 58, 28, 0.22),
    0 2px 0 rgba(255, 255, 255, 0.28) inset,
    0 -2px 0 rgba(95, 54, 33, 0.24) inset;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

.sort-trigger:hover {
  filter: brightness(1.02);
  box-shadow:
    0 12px 22px rgba(120, 58, 28, 0.25),
    0 2px 0 rgba(255, 255, 255, 0.3) inset,
    0 -2px 0 rgba(95, 54, 33, 0.26) inset;
}

.sort-trigger:active {
  transform: translateY(1px);
}

.sort-current {
  font-size: 15px;
  line-height: 1;
  color: #fff8f2;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  white-space: nowrap;
}

.sort-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid #fff8f2;
  border-bottom: 2px solid #fff8f2;
  transform: rotate(45deg);
  margin-right: 2px;
  transition: transform .2s ease;
}

.sort-dropdown.open .sort-caret {
  transform: rotate(-135deg);
}

.sort-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 1px);
  width: 100%;
  background: linear-gradient(180deg, #1a1715 0%, #11100f 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 0;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
  display: none;
  z-index: 20;
}

.sort-dropdown.open .sort-menu {
  display: block;
}

.sort-dropdown.is-loading .sort-trigger {
  pointer-events: none;
  opacity: .9;
}

.sort-dropdown.is-loading .sort-current::after {
  content: " ...";
  font-size: 13px;
}

.sort-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(250, 247, 240, 0.85);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  line-height: 1.15;
  font-family: 'Cormorant Garamond', serif;
  cursor: pointer;
}

.sort-option+.sort-option {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sort-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff9f2;
}

.sort-option.is-selected {
  color: #fff2df;
}

.sort-check {
  opacity: 0;
  color: #e2c16a;
  font-size: 14px;
}

.sort-option.is-selected .sort-check {
  opacity: 1;
}

.view-btns {
  display: flex;
  border: 1px solid var(--pl-sand);
  border-radius: 3px;
  overflow: hidden;
}

.view-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--pl-muted);
}

.view-btn.active {
  background: var(--pl-warm-black);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  margin-top: 4px;
}

.product-grid.list-view {
  grid-template-columns: 1fr;
  gap: 12px;
}

.prod-card {
  cursor: pointer;
  border-radius: 8px;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
}

.prod-card:hover {
  transform: translateY(-4px);
}

.prod-img-wrap {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1/1;
  margin-bottom: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prod-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .5s ease;
}

.prod-card:hover .prod-image {
  transform: scale(1.05);
}

.prod-emoji {
  font-size: 52px;
  opacity: 0.38;
  transition: transform .5s ease;
}

.prod-card:hover .prod-emoji {
  transform: scale(1.1);
}

.prod-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

.badge-new {
  background: var(--pl-deep-sage);
  color: #fff;
}

.badge-hot {
  background: var(--pl-terracotta);
  color: #fff;
}

.badge-sale {
  background: #7a5a21;
  color: #fff;
}

.badge-spirit {
  background: #7B5EA7;
  color: #fff;
}

.prod-cat {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b6053;
  margin-bottom: 4px;
}

.prod-name {
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 6px;
  color: var(--pl-warm-black);
  display: block;
  overflow: visible;
}

.prod-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}

.prod-price {
  font-size: 15px;
  color: #8f4f30;
  font-weight: 500;
}

.prod-price.is-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border: 1.5px solid #d08a67;
  border-radius: 8px;
  background: #fff3ec;
  color: #a8502e !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

/* Force WooCommerce nested amount spans keep AA contrast */
.archive .prod-price .woocommerce-Price-amount,
.archive .prod-price .woocommerce-Price-currencySymbol {
  color: #8f4f30 !important;
}

.prod-original {
  font-size: 10px;
  color: #6b6053;
  text-decoration: line-through;
  margin-left: 6px;
}

.product-grid.list-view .prod-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 16px;
  align-items: center;
  background: transparent;
  border: 1px solid var(--pl-sand);
  border-radius: 6px;
  padding: 14px;
  transform: none;
  margin: 0;
}

.product-grid.list-view .prod-img-wrap {
  aspect-ratio: 1/1;
  margin-bottom: 0;
  border-radius: 4px;
}

.product-grid.list-view .prod-name {
  line-clamp: 1;
  -webkit-line-clamp: 1;
  font-size: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 0 0;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 3px;
  border: 1px solid var(--pl-sand);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: var(--pl-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn.active {
  background: var(--pl-warm-black);
  color: #fff;
  border-color: var(--pl-warm-black);
}

.page-btn.arrow {
  font-size: 16px;
}

.page-dots {
  font-size: 13px;
  color: var(--pl-muted);
  padding: 0 4px;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--pl-sand);
  border-radius: 3px;
  background: #fff;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--pl-warm-black);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 199;
}

.sidebar-overlay.show {
  display: block;
}

.mobile-filter-fab {
  display: none;
}

@media (max-width: 1336px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .page-wrap {
    grid-template-columns: 1fr;
  }

  .page-wrap .sidebar {
    width: 220px;
  }

  .main-content {
    padding: 0 24px 60px;
    margin-left: 220px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .page-wrap {
    grid-template-columns: 1fr;
  }

  .page-wrap .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 200;
    background: var(--pl-warm-white);
    transition: left .3s ease;
    border-right: 1px solid var(--pl-sand);
    height: 100vh;
    padding-top: 2rem;
  }

  .page-wrap .sidebar.open {
    left: 0;
    top: 2rem;
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-close {
    display: inline-flex;
  }

  .main-content {
    padding: 0 1rem;
    margin-left: 0;
    margin-bottom: 2rem;
  }

  .cat-header-block {
    padding: 16px 0 0;
  }

  .cat-h1 {
    font-size: clamp(20px, 5vw, 28px);
  }

  .cat-desc-wrap {
    margin-bottom: 12px;
    padding: 12px 12px 10px;
  }

  .cat-desc {
    font-size: 12px;
    line-height: 1.7;
  }

  .mobile-filter-fab {
    position: fixed;
    left: 8px;
    bottom: 8rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #3a2c23;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    z-index: 8000;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }

  .mobile-filter-fab svg {
    width: 18px;
    height: 18px;
    display: block;
  }

  .mobile-filter-fab.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .toolbar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 10px;
    align-items: center;
  }

  .toolbar-left {
    display: contents;
  }

  .sidebar-toggle {
    grid-column: 1;
    grid-row: 1;
  }

  .toolbar-right {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    gap: 8px;
  }

  .toolbar-filters-wrap {
    display: none;
  }

  .products-range-info {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
    font-size: 12px;
    margin-top: 2px;
  }

  .product-grid {
    display: block;
    column-count: 2;
    column-gap: 14px;
  }

  .prod-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 14px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    display: block;
    column-count: 2;
    column-gap: 12px;
  }

  .prod-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 12px;
  }

  .sort-trigger {
    min-width: 136px;
    min-height: 34px;
    padding: 6px 10px;
  }

  .sort-current {
    font-size: 13px;
  }

  .sort-option {
    font-size: 15px;
  }
}