/* ====== WooCommerce Archive / Category ====== */

/* ── Product Grid ─────────────────────────────────────────── */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.woocommerce ul.products li.product {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Subcategory Cards (no thumbnails) ───────────────────── */
.woocommerce ul.products li.product-category a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5rem;
  padding: 1.25rem;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--divider));
  border-radius: 0.75rem;
  text-decoration: none;
  text-align: center;
  box-shadow:
    0 1px 3px rgb(var(--raw-950) / 0.06),
    0 1px 2px rgb(var(--raw-950) / 0.04);
  transition:
    box-shadow 0.3s ease,
    transform 0.3s ease,
    border-color 0.3s ease;
}
.woocommerce ul.products li.product-category a:hover {
  box-shadow:
    0 8px 25px -5px rgb(var(--raw-950) / 0.1),
    0 4px 10px -5px rgb(var(--raw-950) / 0.06);
  transform: translateY(-2px);
  border-color: rgb(var(--brand));
}
.woocommerce ul.products li.product-category h2 {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: rgb(var(--surface-brand));
  margin: 0;
  line-height: 1.3;
}
.woocommerce ul.products li.product-category a:hover h2 {
  color: rgb(var(--brand-text));
}
.woocommerce ul.products li.product-category .count {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--text-muted));
  background: none;
  margin-left: 0.25rem;
}

/* ── Product Card ─────────────────────────────────────────── */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--divider));
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgb(var(--raw-950) / 0.06),
    0 1px 2px rgb(var(--raw-950) / 0.04);
  transition:
    box-shadow 0.3s ease,
    transform 0.3s ease;
}
.product-card:hover {
  box-shadow:
    0 8px 25px -5px rgb(var(--raw-950) / 0.1),
    0 4px 10px -5px rgb(var(--raw-950) / 0.06);
  transform: translateY(-2px);
}

/* ── Image ────────────────────────────────────────────────── */
.product-card__image {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: rgb(var(--surface-alt));
}
.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top right;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.product-card:hover .product-card__image img {
  transform: scale(1.04);
}

/* ── Body ─────────────────────────────────────────────────── */
.product-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  gap: 0.75rem;
}

/* ── Title ────────────────────────────────────────────────── */
.product-card__title {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  color: rgb(var(--surface-brand));
  margin: 0;
}
.product-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
/* Stretch title link over entire card for click area */
.product-card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.product-card__title a:hover {
  color: rgb(var(--brand-text));
}

/* ── Rating ───────────────────────────────────────────────── */
.product-card__rating {
  display: flex;
  gap: 0.125rem;
  color: rgb(var(--raw-gold));
}
.product-card__rating .inline-icon {
  flex-shrink: 0;
}

/* ── Category Meta (dl) ──────────────────────────────────── */
.product-card__meta {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.product-card__meta dt {
  font-weight: 600;
  color: rgb(var(--heading));
  display: inline;
}
.product-card__meta dt::after {
  content: ': ';
}
.product-card__meta dd {
  display: inline;
  margin: 0;
  color: rgb(var(--text));
}

/* ── Notice ───────────────────────────────────────────────── */
.product-card__notice {
  font-size: 0.8125rem;
  color: rgb(var(--state-error));
  margin: 0;
}

/* ── Description ──────────────────────────────────────────── */
.product-card__description {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgb(var(--text));
}
.product-card__description p {
  margin: 0 0 0.25rem;
}
.product-card__description p:last-child {
  margin-bottom: 0;
}

/* ── Footer (Price + Detail) ──────────────────────────────── */
.product-card__footer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.125rem 1rem;
  padding: 1rem 1.25rem;
  border-top: none;
  margin-top: auto;
  background: rgb(var(--surface-dark) / 0.85);
  border-radius: 0 0 0.75rem 0.75rem;
}

/* ── Price ─────────────────────────────────────────────────── */
.product-card__price {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: rgb(var(--text-on-dark));
  line-height: 1.2;
  grid-column: 1;
  grid-row: 1;
}
.product-card__price-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(var(--text-on-dark) / 0.8);
  display: block;
  margin-bottom: 0.125rem;
}
/* Reset WC price span styling */
.product-card__price .woocommerce-Price-amount {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

/* ── Shipping ─────────────────────────────────────────────── */
.product-card__shipping {
  margin: 0;
  font-size: 0.6875rem;
  color: rgb(var(--text-on-dark) / 0.8);
  grid-column: 1;
  grid-row: 2;
}
.product-card__shipping a {
  color: rgb(var(--text-on-dark) / 0.8);
  text-decoration: none;
  transition: color 0.2s;
}
.product-card__shipping a:hover {
  color: rgb(var(--text-on-dark));
}

/* ── Detail Link ──────────────────────────────────────────── */
.product-card__detail {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgb(var(--brand));
  color: rgb(var(--text-on-dark));
  grid-column: 2;
  grid-row: 1 / -1;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.product-card__detail:hover {
  background: rgb(var(--text-on-dark) / 0.25);
  color: rgb(var(--text-on-dark));
}

/* ── Result Count + Ordering ──────────────────────────────── */
.woocommerce-archive-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.woocommerce-archive-toolbar .woocommerce-result-count {
  font-family: 'Poppins', sans-serif;
  font-size: 0.8125rem;
  background: rgb(var(--surface));
  padding: 0.375rem 0.75rem;
  border-radius: 2rem;
  color: rgb(var(--text-muted));
  margin: 0;
}
.woocommerce-archive-toolbar .woocommerce-ordering {
  margin: 0;
}
/* Select is enhanced to .custom-select by forms.js via .form-select class */
.woocommerce .woocommerce-ordering select {
  font-family: 'Poppins', sans-serif;
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgb(var(--input-border));
  border-radius: 0.375rem;
  background: rgb(var(--input-bg));
  color: rgb(var(--input-text));
}

/* ── Term Description (details/summary toggle) ────────────── */
.woocommerce .term-description {
  margin: 0 0 2rem;
}
.woocommerce details.term-description > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  padding-bottom: 0.75rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(var(--heading));
  cursor: pointer;
  background: none;
  border: none;
  list-style: none;
  position: relative;
}
.woocommerce details.term-description > summary::-webkit-details-marker {
  display: none;
}
.woocommerce details.term-description > summary {
  user-select: none;
  -webkit-user-select: none;
}
/* Animated border line — left to right on open */
.woocommerce details.term-description > summary::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: rgb(var(--heading));
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.woocommerce details[open].term-description > summary {
  display: flex;
}
.woocommerce details[open].term-description > summary::before {
  width: 100%;
}
/* +/− icon — sits next to text, slides to right on open */
.woocommerce details.term-description > summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  color: rgb(var(--heading));
  margin-left: 0.75rem;
  transition: margin 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.woocommerce details[open].term-description > summary::after {
  content: '−';
  margin-left: auto;
}
.woocommerce details.term-description > div {
  padding: 1.25rem 0 0;
}
/* When term-description is a plain div (not details), show directly */
.woocommerce div.term-description:not(details) {
  padding: 0;
}

/* ── Pagination ───────────────────────────────────────────── */
.woocommerce nav.woocommerce-pagination {
  margin-top: 2rem;
  text-align: center;
}
.woocommerce nav.woocommerce-pagination ul {
  display: inline-flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.woocommerce nav.woocommerce-pagination ul li {
  list-style: none;
}
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0.375rem;
  color: rgb(var(--text));
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.woocommerce nav.woocommerce-pagination ul li a:hover {
  background: rgb(var(--surface-alt));
  color: rgb(var(--brand));
}
.woocommerce nav.woocommerce-pagination ul li span.current {
  background: rgb(var(--brand));
  color: white;
  font-weight: 700;
}

/* ── Term description responsive ──────────────────────────── */
@media (min-width: 768px) {
  .woocommerce details.term-description > summary {
    font-size: 1.125rem;
  }
}
@media (min-width: 1024px) {
  .woocommerce details.term-description > summary {
    font-size: 1.5rem;
  }
}

/* ── Mobile line break ─────────────────────────────────────── */
.mobile-br {
  display: none;
}
@media (max-width: 424px) {
  .mobile-br {
    display: block;
  }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 767px) {
  .woocommerce details.term-description > summary::after {
    margin-left: auto;
  }
  .woocommerce-archive-toolbar {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .woocommerce-archive-toolbar .woocommerce-ordering {
    margin-left: 0;
  }
}
@media (max-width: 639px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
  }
  .product-card__body {
    padding: 1rem;
  }
  .product-card__footer {
    padding: 0.75rem 1rem;
  }
  .product-card__price {
    font-size: 1rem;
  }
}
@media (max-width: 424px) {
  .woocommerce ul.products {
    grid-template-columns: 1fr;
  }
}
