/* Eco Collections — Typesense-powered category/tag archive UI.
   Progressive enhancement layered over Blocksy's native product grid. */

/* The gap above the breadcrumb comes from Blocksy's content container, which
   applies ~60px top/bottom spacing via [data-vertical-spacing]. Trim the top so
   the collection header sits closer to the page top. The .archive prefix raises
   specificity above Blocksy's rule (no !important needed); this stylesheet only
   loads on product term archives, so it is safely scoped. */
.archive .ct-container[data-vertical-spacing="top:bottom"] {
  padding-top: 24px;
}
.woocommerce-products-header {
  margin-bottom: 0;
}

/* ---- Centered collection header (breadcrumb + title + count + description) ---- */
.eco-coll-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 34px;
  padding: 0 16px;
}
.eco-coll-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 15px;
  color: #6b7280;
  margin-bottom: 10px;
}
.eco-coll-breadcrumb a { color: #2563a8; text-decoration: underline; }
.eco-coll-breadcrumb a:hover { color: #17a673; }
.eco-coll-sep { color: #9aa3af; }
.eco-coll-current { color: #4b5563; }

.eco-coll-title-main {
  margin: 0 0 8px;
  font-size: 36px;
  line-height: 1.18;
  font-weight: 600;
  color: #1a1a1a;
}
.eco-coll-count-main {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
}
/* Parent categories start empty (count filled by JS from Typesense) — avoid a
   gap until then. */
.eco-coll-count-main[data-eco-empty="1"]:empty { margin: 0; }
.eco-coll-desc {
  font-size: 16px;
  line-height: 1.65;
  color: #6b7280;
  max-width: 680px;
  margin: 0 auto;
}
.eco-coll-desc p { margin: 0 0 8px; }
.eco-coll-desc p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
  .eco-coll-title-main { font-size: 28px; }
}

/* ---- Sub-category suggestion strip (CSS-only Show more) ---- */
.eco-subcats {
  max-width: 1100px;
  margin: 0 auto 30px;
  padding: 0 16px;
}
.eco-subcats-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 28px 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.eco-subcats-item { list-style: none; margin: 0; }
.eco-subcats-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 124px;
  text-decoration: none;
  color: #1f2937;
}
.eco-subcats-circle {
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f3f5;
  border: 2px solid transparent;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.eco-subcats-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eco-subcats-initial { font-size: 36px; font-weight: 700; color: #9aa3af; }
.eco-subcats-link:hover .eco-subcats-circle {
  transform: translateY(-3px);
  border-color: #17a673;
  box-shadow: 0 10px 24px rgba(23, 166, 115, .2);
}
.eco-subcats-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: #1f2937;
}
.eco-subcats-link:hover .eco-subcats-name { color: #17a673; }

/* CSS-only Show more / Show less */
.eco-subcats-hidden { display: none; }
.eco-subcats-toggle:checked ~ .eco-subcats-list .eco-subcats-hidden { display: block; }
.eco-subcats-showmore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 18px auto 0;
  padding: 9px 22px;
  border: 1px solid #2563a8;
  border-radius: 999px;
  color: #2563a8;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.eco-subcats-showmore:hover { background: #2563a8; color: #fff; }
.eco-subcats { text-align: center; }
.eco-subcats-showmore .eco-less-label { display: none; }
.eco-subcats-toggle:checked ~ .eco-subcats-showmore .eco-more-label { display: none; }
.eco-subcats-toggle:checked ~ .eco-subcats-showmore .eco-less-label { display: inline; }

@media (max-width: 600px) {
  .eco-subcats-list { gap: 20px 18px; }
  .eco-subcats-link { width: 100px; }
  .eco-subcats-circle { width: 88px; height: 88px; }
  .eco-subcats-name { font-size: 12px; }
}

/* Hide Blocksy/Woo's default result-count + ordering bar; our heading + sort
   pill toolbar replaces it. Scoped: this stylesheet only loads on term pages. */
.woo-listing-top {
  display: none !important;
}

/* ---- Heading + sort pill bar (matches the design) ---- */
.eco-coll-toolbar {
  margin: 0 0 18px;
}
.eco-coll-toolbar.is-loading { opacity: .6; pointer-events: none; }

.eco-coll-heading {
  display: inline-block;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 3px solid #e8623a;
  color: #111827;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.eco-coll-sortbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.eco-coll-pill {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: auto !important;
  max-width: 100%;
  border: 1px solid #d7dde7;
  border-radius: 999px;
  background: #fff
    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='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 11px center;
  color: #344054;
  padding: 6px 28px 6px 13px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.eco-coll-pill:hover { border-color: #2563a8; color: #1f2937; }
.eco-coll-pill.is-active {
  border-color: #2563a8;
  color: #2563a8;
  box-shadow: 0 2px 8px rgba(37, 99, 168, .12);
}
.eco-coll-pill:focus-visible { outline: 2px solid #2563a8; outline-offset: 1px; }


/* ---- Grid (override Woo defaults inside our archive) ---- */
ul.products.eco-coll-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
ul.products.eco-coll-grid::before,
ul.products.eco-coll-grid::after { display: none !important; }

.eco-coll-item { list-style: none; margin: 0; width: auto !important; float: none !important; }

.eco-coll-empty {
  list-style: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: #667085;
  font-weight: 600;
}

/* ---- Load more ---- */
.eco-coll-loadmore-wrap { text-align: center; margin: 28px 0 10px; }
.eco-coll-loadmore {
  border: 1px solid #17a673;
  background: #fff;
  color: #10251f;
  padding: 12px 32px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all .18s ease;
}
.eco-coll-loadmore:hover { background: #17a673; color: #fff; box-shadow: 0 10px 24px rgba(23, 166, 115, .3); }

@media (max-width: 1024px) {
  ul.products.eco-coll-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  ul.products.eco-coll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .eco-coll-sortbar { gap: 8px; }
}
@media (max-width: 480px) {
  ul.products.eco-coll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Recent Items Viewed By You (carousel) ---- */
.eco-recent {
  margin: 48px 0 8px;
}
.eco-recent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.eco-recent__heading {
  display: inline-block;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 3px solid #e8623a;
  color: #111827;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}
.eco-recent__nav { display: flex; gap: 8px; flex: 0 0 auto; }
.eco-recent__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d7dde7;
  border-radius: 50%;
  background: #fff;
  color: #344054;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, opacity .18s ease;
}
.eco-recent__arrow:hover { border-color: #2563a8; color: #2563a8; }
.eco-recent__arrow:disabled { opacity: .35; cursor: default; }

.eco-recent__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 6 * 18px) / 7);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}
.eco-recent__track::-webkit-scrollbar { display: none; }
.eco-recent__item { scroll-snap-align: start; min-width: 0; }

@media (max-width: 1024px) {
  .eco-recent__track { grid-auto-columns: calc((100% - 3 * 16px) / 4); gap: 16px; }
}
@media (max-width: 768px) {
  .eco-recent__track { grid-auto-columns: calc((100% - 2 * 14px) / 3); gap: 14px; }
  .eco-recent__heading { font-size: 18px; }
}
@media (max-width: 480px) {
  .eco-recent__track { grid-auto-columns: calc((100% - 14px) / 2.2); }
}

