/*
 * Shop + product category archives: sidebar, filters, product cards,
 * internal-link product cards and full-width SEO content.
 */

:root {
  --sbc-shop-accent: #7f47dc;
  --sbc-shop-line: rgba(255, 255, 255, 0.1);
  --sbc-shop-panel: rgba(255, 255, 255, 0.03);
}

/* ---------- Layout ---------- */
.thc-shop-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px 20px 10px;
}

.thc-shop-main {
  min-width: 0;
}

/* SEO copy under the grid runs the full width of the page. */
.thc-shop-main .sbc-seo-copy,
.sbc-cat-seo {
  width: 100%;
  max-width: none;
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--sbc-shop-line);
}

.sbc-cat-seo h2 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  margin: 0 0 14px;
}

.sbc-cat-seo h3 {
  font-size: 1.15rem;
  margin: 28px 0 10px;
}

.sbc-cat-seo p {
  max-width: 78ch;
  line-height: 1.75;
}

/* ---------- Sidebar ---------- */
.thc-shop-sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  min-width: 0;
  border: 1px solid var(--sbc-shop-line);
  border-radius: 16px;
  background: var(--sbc-shop-panel);
  padding: 6px 18px 18px;
}

.thc-sidebar-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--sbc-shop-line);
  border-radius: 12px;
  background: rgba(127, 71, 220, 0.08);
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.thc-sidebar-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--sbc-shop-line);
}

.thc-sidebar-block:last-child {
  border-bottom: 0;
}

.thc-sidebar-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sbc-shop-accent);
}

.thc-sidebar-cats,
.thc-sidebar-subcats,
.thc-sidebar-filters,
.thc-sidebar-notes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.thc-sidebar-cats > li > a,
.thc-sidebar-filters a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.3;
  transition: background 0.15s ease, color 0.15s ease;
}

.thc-sidebar-cats > li > a:hover,
.thc-sidebar-filters a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.thc-sidebar-cats > li.is-active > a,
.thc-sidebar-filters li.is-active a {
  background: rgba(127, 71, 220, 0.14);
  color: var(--sbc-shop-accent);
  font-weight: 700;
}

.thc-cat-count {
  flex: 0 0 auto;
  min-width: 26px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  opacity: 0.85;
}

.thc-sidebar-drop {
  margin: 2px 0 6px;
}

.thc-sidebar-drop > summary {
  list-style: none;
  cursor: pointer;
  padding: 5px 10px 5px 22px;
  font-size: 0.8rem;
  opacity: 0.75;
}

.thc-sidebar-drop > summary::-webkit-details-marker {
  display: none;
}

.thc-sidebar-drop > summary::before {
  content: "▸";
  margin-right: 6px;
  font-size: 0.7rem;
}

.thc-sidebar-drop[open] > summary::before {
  content: "▾";
}

.thc-sidebar-subcats li a {
  display: block;
  padding: 7px 10px 7px 28px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
}

.thc-sidebar-subcats li a:hover {
  background: rgba(255, 255, 255, 0.05);
  opacity: 1;
}

.thc-sidebar-subcats li.is-active a {
  color: var(--sbc-shop-accent);
  font-weight: 700;
  opacity: 1;
}

.thc-sidebar-notes li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: 0.85rem;
  opacity: 0.85;
}

.thc-sidebar-notes li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--sbc-shop-accent);
  font-size: 0.75rem;
}

.thc-sidebar-clear {
  margin: 14px 0 0;
}

.thc-sidebar-clear a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--sbc-shop-line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.thc-sidebar-clear a:hover {
  border-color: var(--sbc-shop-accent);
  color: var(--sbc-shop-accent);
}

/* Active filter chips above the grid. */
.thc-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
}

.thc-active-filters .thc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(127, 71, 220, 0.4);
  background: rgba(127, 71, 220, 0.12);
  color: var(--sbc-shop-accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- Product cards on archives ---------- */
.thc-shop-main ul.products,
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 20px;
  margin: 0 0 10px !important;
  padding: 0 !important;
  list-style: none;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
  content: none !important;
}

.woocommerce ul.products li.product {
  display: flex !important;
  flex-direction: column;
  width: auto !important;
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid var(--sbc-shop-line);
  border-radius: 16px;
  background: var(--sbc-shop-panel);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-3px);
  border-color: rgba(127, 71, 220, 0.45);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

.woocommerce ul.products li.product a img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin: 0 0 12px !important;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .sbc-loop-title {
  font-size: 0.95rem !important;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 8px !important;
  padding: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.woocommerce ul.products li.product .price {
  display: block;
  margin: 0 0 12px !important;
  color: var(--sbc-shop-accent) !important;
  font-size: 1.02rem !important;
  font-weight: 800;
}

.woocommerce ul.products li.product .price del {
  opacity: 0.55;
  font-weight: 500;
  margin-right: 6px;
}

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .added_to_cart {
  display: block;
  margin: 12px 0 0 !important;
  padding: 11px 14px !important;
  border-radius: 999px !important;
  background: var(--sbc-shop-accent) !important;
  color: #04210c !important;
  font-weight: 800 !important;
  font-size: 0.85rem !important;
  text-align: center;
  text-decoration: none;
}

.woocommerce ul.products li.product .added_to_cart {
  margin-top: 8px !important;
  background: transparent !important;
  border: 1px solid var(--sbc-shop-line);
  color: inherit !important;
}

.woocommerce ul.products li.product .onsale {
  top: 16px;
  right: 16px;
  left: auto;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sbc-shop-accent);
  color: #04210c;
  font-size: 0.72rem;
  font-weight: 800;
}

/* ---------- Internal link product cards (SEO blocks) ---------- */
.sbc-seo-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0 26px;
  padding: 0;
  list-style: none;
}

.sbc-seo-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--sbc-shop-line);
  border-radius: 14px;
  background: var(--sbc-shop-panel);
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.sbc-seo-card:hover {
  transform: translateY(-3px);
  border-color: rgba(127, 71, 220, 0.45);
}

.sbc-seo-card__media {
  display: block;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.04);
}

.sbc-seo-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sbc-seo-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px 14px;
}

.sbc-seo-card__title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  color: inherit;
  text-decoration: none;
}

.sbc-seo-card__title:hover {
  color: var(--sbc-shop-accent);
}

.sbc-seo-card__price {
  font-weight: 800;
  color: var(--sbc-shop-accent);
  font-size: 0.95rem;
}

.sbc-seo-card__price del {
  opacity: 0.55;
  font-weight: 500;
  margin-right: 5px;
}

.sbc-seo-card__cta {
  margin-top: auto;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(127, 71, 220, 0.14);
  color: var(--sbc-shop-accent);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.sbc-seo-card__cta:hover {
  background: var(--sbc-shop-accent);
  color: #04210c;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .thc-shop-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .thc-shop-sidebar {
    position: static;
    padding: 6px 14px 14px;
  }

  .thc-sidebar-toggle {
    display: flex;
    margin: 12px 0;
  }

  .thc-shop-sidebar .thc-sidebar-body {
    display: none;
  }

  .thc-shop-sidebar.is-open .thc-sidebar-body {
    display: block;
  }
}

@media (max-width: 600px) {
  .thc-shop-layout {
    padding: 16px 14px 6px;
  }

  .woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
  }

  .woocommerce ul.products li.product {
    padding: 9px !important;
  }

  .sbc-seo-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* ==========================================================================
   Full-width category intro (v6.3.0)
   ========================================================================== */
.sbc-shop-hero .sbc-container { max-width: 1360px; }
.sbc-shop-hero__lede,
.sbc-shop-hero__intro,
.sbc-cat-intro {
  width: 100%;
  max-width: none !important;
  color: var(--sbc-ink-soft);
}
.sbc-shop-hero__intro p,
.sbc-cat-intro p {
  max-width: none !important;
  line-height: 1.8;
  margin: 0 0 14px;
}
.sbc-shop-hero__intro h2,
.sbc-shop-hero__intro h3,
.sbc-cat-intro h2,
.sbc-cat-intro h3 { color: var(--sbc-ink); }
.thc-shop-main .sbc-cat-intro { max-width: none; }
.sbc-cat-seo p { max-width: none; }
