/**
 * TEREAU category pages — Fiberluma/FIRSOL layout with jewelry branding.
 */

body.tpl_tereau .centerColumn.tereau-category-page {
  max-width: var(--tereau-max, 1280px);
  margin: 0 auto;
  padding: 0 max(var(--tereau-gutter, 0px), env(safe-area-inset-right)) 3.5rem max(var(--tereau-gutter, 0px), env(safe-area-inset-left));
  box-sizing: border-box;
  background: #fff;
  overflow-x: clip;
}

.tereau-category-header {
  padding: 0.5rem 0 1rem;
}

.tereau-category-header__title,
.tereau-category-page h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
}

.tereau-category-header__title {
  margin: 0 0 0.6rem;
  padding: 0;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--tereau-ink, #1a1a1a);
  text-align: left;
}

.tereau-category-header__desc {
  max-width: 40rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--tereau-muted, #6b6560);
}

.tereau-category-header__desc p {
  margin: 0 0 0.5rem;
}

.tereau-category-header__desc p:last-child {
  margin-bottom: 0;
}

.tereau-subcat-grid {
  padding: 0.5rem 0 2rem;
}

.tereau-subcat-grid__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tereau-subcat-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tereau-line, rgba(26, 26, 26, 0.12));
  background: #fff;
  text-decoration: none !important;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tereau-subcat-card:hover,
.tereau-subcat-card:focus-visible {
  border-color: var(--tereau-gold, #a8845a);
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.06);
  outline: none;
}

.tereau-subcat-card__media {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--tereau-pearl, #f7f5f2);
}

.tereau-subcat-card__media img,
.tereau-subcat-card__img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: contain;
}

.tereau-subcat-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--tereau-gold, #a8845a);
  font-size: 2rem;
  opacity: 0.45;
}

.tereau-subcat-card__body {
  border-top: 1px solid var(--tereau-line, rgba(26, 26, 26, 0.12));
  padding: 0.85rem 0.75rem;
}

.tereau-subcat-card__title {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--tereau-ink, #1a1a1a);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tereau-subcat-card:hover .tereau-subcat-card__title {
  color: var(--tereau-gold, #a8845a);
}

.tereau-category-page--products #filter-wrapper,
.tereau-category-page--products #sorter_form,
.tereau-category-page--products .button-top,
.tereau-category-page--products .prod-list-wrap {
  display: none !important;
}

.tereau-category-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--tereau-line, rgba(26, 26, 26, 0.12));
  text-align: left !important;
  width: 100%;
  box-sizing: border-box;
}

.tereau-category-toolbar__filters,
.tereau-category-toolbar__form,
.tereau-category-toolbar form {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  float: none !important;
  width: auto !important;
  max-width: 100%;
}

.tereau-category-toolbar .inputLabel,
.tereau-category-toolbar label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.tereau-category-toolbar__select,
.tereau-category-toolbar select,
body.tpl_tereau .tereau-category-toolbar select {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: auto !important;
  min-width: 11.5rem !important;
  max-width: 100% !important;
  min-height: 2.375rem;
  margin: 0 !important;
  padding: 0.45rem 2.25rem 0.45rem 0.875rem !important;
  border: 1px solid var(--tereau-line, rgba(26, 26, 26, 0.12));
  background-color: #fff;
  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='%236b6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.75rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.875rem;
  color: var(--tereau-muted, #6b6560);
  cursor: pointer;
}

.tereau-category-toolbar select:hover,
.tereau-category-toolbar select:focus {
  outline: none;
  border-color: var(--tereau-gold, #a8845a);
  color: var(--tereau-ink, #1a1a1a);
}

.tereau-category-toolbar__count {
  margin: 0 0 0 auto;
  font-size: 0.875rem;
  color: var(--tereau-muted, #6b6560);
}

.tereau-category-toolbar__count-num {
  font-weight: 500;
  color: var(--tereau-ink, #1a1a1a);
}

.tereau-category-pager {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
}

.tereau-category-pager a,
.tereau-category-pager strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--tereau-line, rgba(26, 26, 26, 0.12));
  font-size: 0.8125rem;
  text-decoration: none !important;
  color: var(--tereau-ink, #1a1a1a) !important;
}

.tereau-category-pager strong {
  border-color: var(--tereau-gold, #a8845a);
  background: var(--tereau-gold, #a8845a);
  color: #fff !important;
}

.tereau-category-page--products .list-input,
.tereau-category-page--products .cart-add,
.tereau-category-page--products input[name^="products_id["],
.tereau-category-page--products .list-more,
.tereau-category-page--products .listingBuyNowButton,
.tereau-category-page--products .buttonRow,
.tereau-category-page--products .cartBox,
.tereau-category-page--products form[name="cart_quantity"],
.tereau-category-page #categoryImgListing,
.tereau-category-page .categoryImg {
  display: none !important;
}

.tereau-category-page--products .tereau-columnar-display,
.tereau-category-page--products .tereau-columnar-display__rows,
.tereau-category-page--products .tereau-category-product-grid {
  float: none !important;
  margin: 0 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tereau-category-page--products .tereau-columnar-display__rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tereau-category-page--products .tereau-product-row,
.tereau-category-page--products .tereau-columnar-display__rows > div {
  display: contents;
}

.tereau-category-page--products .tereau-columnar-display__rows > div > div[class*="centerBoxContents"],
.tereau-category-page--products .tereau-columnar-display__rows > div > div[class*="ListBoxContents"],
.tereau-category-page--products div.centerBoxContentsProducts,
.tereau-category-page--products div.centerBoxContentsListing {
  float: none !important;
  clear: none !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tereau-line, rgba(26, 26, 26, 0.12)) !important;
  background: #fff !important;
  box-shadow: none !important;
  text-align: left !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.tereau-category-page--products div.centerBoxContentsProducts:hover,
.tereau-category-page--products div.centerBoxContentsListing:hover {
  border: 1px solid var(--tereau-gold, #a8845a) !important;
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.06) !important;
  background: #fff !important;
}

.tereau-category-page--products a.product_listing_image_link {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--tereau-pearl, #f7f5f2);
  border-bottom: 1px solid var(--tereau-line, rgba(26, 26, 26, 0.12));
}

.tereau-category-page--products .centerBoxContentsProducts img,
.tereau-category-page--products .centerBoxContentsListing img,
.tereau-category-page--products .listingProductImage {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  margin: 0 auto;
}

.tereau-category-page--products .centerBoxContentsProducts br,
.tereau-category-page--products .centerBoxContentsListing br,
.tereau-category-page--products .listingDescription,
.tereau-category-page--products .qmin,
.tereau-category-page--products .qunit,
.tereau-category-page--products .qmix,
.tereau-category-page--products .qmax,
.tereau-category-page--products .centerBoxContentsProducts > a:not(.product_listing_image_link),
.tereau-category-page--products .centerBoxContentsListing > a:not(.product_listing_image_link) {
  display: none !important;
}

.tereau-category-page--products .itemTitle a,
.tereau-category-page--products .centerBoxContentsProducts a,
.tereau-category-page--products .centerBoxContentsListing a {
  color: var(--tereau-ink, #1a1a1a) !important;
  text-decoration: none !important;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.4;
}

.tereau-category-page--products div.centerBoxContentsProducts:hover .itemTitle a,
.tereau-category-page--products .itemTitle a:hover {
  color: var(--tereau-gold, #a8845a) !important;
}

.tereau-category-page--products .centerBoxContentsProducts br,
.tereau-category-page--products .centerBoxContentsListing br,
.tereau-category-page--products .listingDescription,
.tereau-category-page--products .qmin,
.tereau-category-page--products .qunit,
.tereau-category-page--products .qmix,
.tereau-category-page--products .qmax,
.tereau-category-page--products .centerBoxContentsProducts > a:not(.product_listing_image_link),
.tereau-category-page--products .centerBoxContentsListing > a:not(.product_listing_image_link) {
  display: none !important;
}

.tereau-category-page--products .itemTitle,
.tereau-category-page--products .list-price,
.tereau-category-page--products .productBasePrice {
  padding-left: 1rem;
  padding-right: 1rem;
}

.tereau-category-page--products .itemTitle {
  width: 100%;
  margin: 0;
  padding-top: 0.85rem;
  padding-bottom: 0.2rem;
  min-height: 0;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.4;
}

.tereau-category-page--products .itemTitle a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif !important;
}

.tereau-category-page--products .list-price,
.tereau-category-page--products .productPrice,
.tereau-category-page--products .productBasePrice,
.tereau-category-page--products .productSpecialPrice {
  display: block;
  margin: 0;
  padding-top: 0.15rem;
  padding-bottom: 0.9rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--tereau-ink, #1a1a1a) !important;
}

.tereau-category-page--products .productListing-data {
  grid-column: 1 / -1;
  border: 0 !important;
  padding: 2.5rem 1rem !important;
  text-align: center !important;
  color: var(--tereau-muted, #6b6560) !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 980px) {
  body.tpl_tereau .centerColumn.tereau-category-page {
    padding-bottom: 2.25rem;
  }

  .tereau-category-header {
    padding: 0.25rem 0 0.85rem;
  }

  .tereau-category-header__title {
    margin-bottom: 0.4rem;
    font-size: clamp(1.55rem, 6.2vw, 1.85rem);
    letter-spacing: 0.03em;
  }

  .tereau-category-header__desc {
    font-size: 0.86rem;
  }

  .tereau-subcat-grid {
    padding: 0.15rem 0 1.5rem;
  }

  .tereau-subcat-grid__list,
  .tereau-category-page--products .tereau-columnar-display__rows {
    gap: 0.65rem;
  }

  .tereau-subcat-card__body {
    padding: 0.7rem 0.6rem;
  }

  .tereau-subcat-card__title {
    font-size: 0.95rem;
  }

  .tereau-category-toolbar {
    flex-wrap: nowrap;
    gap: 0.55rem 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
  }

  .tereau-category-toolbar__filters,
  .tereau-category-toolbar__form,
  .tereau-category-toolbar form {
    width: auto !important;
    max-width: calc(100% - 8.5rem);
    min-width: 0;
    flex: 0 1 auto;
  }

  body.tpl_tereau .tereau-category-toolbar select,
  body.tpl_tereau .tereau-category-toolbar__select {
    flex: 1 1 auto;
    min-width: 0 !important;
    width: auto !important;
    max-width: 100% !important;
  }

  .tereau-category-toolbar__count {
    margin: 0 0 0 auto;
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.8rem;
  }

  .tereau-category-page--products .itemTitle {
    padding-top: 0.7rem;
    font-size: 0.92rem;
  }

  .tereau-category-page--products .itemTitle a,
  .tereau-category-page--products .centerBoxContentsProducts a,
  .tereau-category-page--products .centerBoxContentsListing a {
    font-size: 0.92rem;
  }

  .tereau-category-page--products .itemTitle,
  .tereau-category-page--products .list-price,
  .tereau-category-page--products .productBasePrice {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .tereau-category-page--products .list-price,
  .tereau-category-page--products .productPrice,
  .tereau-category-page--products .productBasePrice,
  .tereau-category-page--products .productSpecialPrice {
    padding-bottom: 0.75rem;
    font-size: 0.92rem;
  }

  .tereau-category-pager {
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1.25rem;
  }

  .tereau-category-pager a,
  .tereau-category-pager strong {
    min-width: 2.5rem;
    height: 2.5rem;
  }
}

@media (max-width: 767px) {
  .tereau-category-toolbar {
    flex-wrap: wrap;
    align-items: center;
  }

  .tereau-category-toolbar__count {
    width: 100%;
    margin-left: 0;
    white-space: normal;
  }
}

@media (min-width: 768px) {
  .tereau-subcat-grid__list,
  .tereau-category-page--products .tereau-columnar-display__rows {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .tereau-subcat-grid__list,
  .tereau-category-page--products .tereau-columnar-display__rows {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
