/* =====================================================================
 * Product category / collection archive — mirrors collection.html.
 * Theme-namespaced; no WooCommerce classes/styles.
 * (Product grid + card styles come from style.css.)
 * ===================================================================== */

/* ---- Breadcrumb + title ---- */
.collection-head {
  text-align: center;
  padding: 34px 24px 24px;
}
.collection-head .breadcrumb {
  font-size: 13px;
  letter-spacing: .4px;
  color: #8a8178;
  margin-bottom: 18px;
}
.collection-head .breadcrumb a { color: #8a8178; transition: color .2s ease; }
.collection-head .breadcrumb a:hover { color: #c9a063; }
.collection-head .breadcrumb .sep { margin: 0 8px; color: #c9bfb2; }
.collection-head .breadcrumb .current { color: #2a241d; }
.collection-title {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #2a241d;
  margin: 0;
}

/* ---- Banner ---- */
.collection-banner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 24px;
}
.collection-banner__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 330;
  overflow: hidden;
  background: #f0ece5;
}
.collection-banner__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Description ---- */
.collection-description {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 24px 4px;
  font-size: 15px;
  line-height: 1.85;
  color: #5b5048;
  text-align: left;
}
.collection-description p { margin: 0 0 14px; }
.collection-description strong { color: #2a241d; font-weight: 600; }
.collection-description a { color: #c9a063; font-weight: 600; }
.collection-description a:hover { text-decoration: underline; }

/* ---- Toolbar (count + sort) ---- */
.collection-toolbar {
  max-width: 1500px;
  margin: 28px auto 24px;
  padding: 22px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #eee5d8;
}
.collection-toolbar .count {
  font-size: 13px;
  letter-spacing: .6px;
  color: #8a8178;
  text-transform: uppercase;
}
.collection-toolbar .sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #5b5048;
}
.collection-toolbar select {
  font-family: inherit;
  font-size: 13px;
  color: #2a241d;
  border: 1px solid #e2dcd2;
  background-color: #fff;
  padding: 8px 30px 8px 12px;
  border-radius: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b5048' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ---- Product section + Sale badge ---- */
.collection-section { padding: 0 0 80px; }
.product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: #c0392b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  padding: 4px 9px;
  border-radius: 0;
}

/* ---- Empty state ---- */
.collection-empty {
  max-width: 1500px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  text-align: center;
  color: #8a8178;
  font-size: 14px;
}

/* ---- Pagination ---- */
.collection-pagination {
  max-width: 1500px;
  margin: 0 auto;
  padding: 10px 24px 80px;
  display: flex;
  justify-content: center;
}
.collection-pagination .page-numbers {
  display: inline-flex;
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e2dcd2;
}
.collection-pagination .page-numbers li { margin: 0; }
.collection-pagination .page-numbers a,
.collection-pagination .page-numbers span {
  display: block;
  padding: 9px 15px;
  color: #5b5048;
  text-decoration: none;
  border-right: 1px solid #e2dcd2;
  font-size: 13px;
  transition: background .2s ease, color .2s ease;
}
.collection-pagination .page-numbers li:last-child a,
.collection-pagination .page-numbers li:last-child span { border-right: none; }
.collection-pagination .page-numbers a:hover { background: #f7f1e9; color: #2a241d; }
.collection-pagination .page-numbers .current { background: #2a241d; color: #fff; }

@media (max-width: 640px) {
  .collection-toolbar { padding-left: 16px; padding-right: 16px; }
  .collection-title { font-size: 21px; }
  .collection-banner { padding: 0 16px; }
  .collection-description { padding-left: 16px; padding-right: 16px; }
}


/* =====================================================================
 * Sidebar filters (categories + attribute accordions) + 2-col layout
 * ===================================================================== */
.collection-layout {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* The grid/toolbar/pagination inside the layout fill the main column. */
.collection-main { min-width: 0; }
.collection-main .collection-toolbar,
.collection-main .product-grid,
.collection-main .collection-pagination {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
.collection-main .collection-toolbar { margin-top: 0; }
.collection-main .product-grid { grid-template-columns: repeat(4, 1fr); gap: 24px 18px; }
.collection-main .collection-pagination { justify-content: flex-start; }

/* ---- Sidebar shell ---- */
.shop-sidebar {
  position: sticky;
  top: 96px;
}
.filter-acc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.shop-sidebar__title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #2a241d;
  margin: 0;
}
.filter-clear {
  font-size: 12px;
  color: #c9a063;
  text-decoration: none;
}
.filter-clear:hover { text-decoration: underline; }

/* ---- Accordion ---- */
.filter-acc {
  border-bottom: 1px solid #eee5d8;
}
.filter-acc__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 18px 2px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #2a241d;
  text-align: left;
  list-style: none;
}
.filter-acc__head::-webkit-details-marker { display: none; }
.filter-acc__head::marker { content: ""; }
.filter-acc__icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.filter-acc__icon::before,
.filter-acc__icon::after {
  content: "";
  position: absolute;
  background: #2a241d;
  transition: opacity .25s ease, transform .25s ease;
}
.filter-acc__icon::before { /* horizontal bar */
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.5px;
  transform: translateY(-50%);
}
.filter-acc__icon::after { /* vertical bar */
  left: 50%;
  top: 0;
  width: 1.5px;
  height: 100%;
  transform: translateX(-50%);
}
.filter-acc[open] .filter-acc__icon::after { opacity: 0; }

.filter-acc__panel {
  padding: 0 2px 18px;
}

/* ---- Category list ---- */
.filter-cats { list-style: none; margin: 0; padding: 0; }
.filter-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  font-size: 14px;
  color: #5b5048;
  text-decoration: none;
  transition: color .2s ease, padding-left .2s ease;
}
.filter-cat:hover { color: #c9a063; padding-left: 4px; }
.filter-cat.is-active { color: #2a241d; font-weight: 600; }
.filter-cat__count { color: #b3a99c; font-size: 13px; }

/* ---- Attribute checkbox list ---- */
.filter-list { list-style: none; margin: 0; padding: 0; }
.filter-list li { margin: 0; }
.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  cursor: pointer;
  font-size: 14px;
  color: #5b5048;
}
.filter-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.filter-check__box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1px solid #cabfae;
  background: #fff;
  position: relative;
  transition: border-color .2s ease, background .2s ease;
}
.filter-check input:focus-visible + .filter-check__box { outline: 2px solid #c9a063; outline-offset: 2px; }
.filter-check:hover .filter-check__box { border-color: #c9a063; }
.filter-check input:checked + .filter-check__box {
  background: #2a241d;
  border-color: #2a241d;
}
.filter-check input:checked + .filter-check__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.filter-check__name { flex: 1; }
.filter-check input:checked ~ .filter-check__name { color: #2a241d; font-weight: 600; }
.filter-check__count { color: #b3a99c; font-size: 13px; }

.filter-apply {
  margin-top: 16px;
  width: 100%;
  border: none;
  cursor: pointer;
  background: #2a241d;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 12px 18px;
}

/* ---- Mobile filter toggle ---- */
.filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 0 auto 18px;
  max-width: 1500px;
  border: 1px solid #d8cebd;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #2a241d;
  padding: 11px 18px;
  cursor: pointer;
}
.filter-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* Keep 4 across on full desktop; step down only when the column narrows.
   NOTE: this wider breakpoint must come BEFORE the narrower ones below so the
   mobile (640px) rule wins the cascade — equal-specificity rules are resolved
   by source order, not by how small the max-width is. */
@media (max-width: 1200px) {
  .collection-main .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
  .collection-layout { grid-template-columns: 1fr; gap: 0; }
  .filter-toggle { display: inline-flex; }
  .shop-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 86%;
    max-width: 360px;
    z-index: 1200;
    background: #fff;
    padding: 24px 22px 40px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .35s cubic-bezier(.22, .61, .36, 1);
    box-shadow: 0 0 40px rgba(0, 0, 0, .12);
  }
  .shop-sidebar.is-open { transform: translateX(0); }
  #filterScrim { z-index: 1100; }
  .collection-main .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .collection-main .product-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .collection-layout { padding: 0 16px; }
}
