/* Shop / category — world-class catalog */

body.woocommerce-shop .tmo-main > .tmo-section,
body.tax-product_cat .tmo-main > .tmo-section,
body.post-type-archive-product .tmo-main > .tmo-section {
  max-width: none;
  padding: 0;
  margin: 0;
}

body.woocommerce-shop,
body.tax-product_cat,
body.post-type-archive-product {
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(126, 184, 168, 0.14), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(15, 39, 68, 0.05), transparent 50%),
    #f4f7f9;
}

.tmo-shop {
  max-width: var(--tmo-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4.5rem;
}

/* Intro — one job */
.tmo-shop__intro {
  max-width: 38rem;
  margin: 0 0 1.75rem;
  animation: tmo-shop-rise .7s ease both;
}

.tmo-shop__eyebrow {
  margin: 0 0 .55rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tmo-mint-deep);
}

.tmo-shop__title {
  margin: 0 0 .65rem !important;
  font-family: var(--tmo-font) !important;
  font-size: clamp(1.85rem, 3.4vw, 2.55rem) !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  letter-spacing: -.03em !important;
  text-transform: none !important;
  color: var(--tmo-navy) !important;
}

.tmo-shop__lede {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--tmo-muted);
  max-width: 42ch;
}

/* Category chips */
.tmo-shop__cats {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 1.5rem;
  padding: 0;
  animation: tmo-shop-rise .7s ease .08s both;
}

.tmo-shop__cat {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .9rem;
  border: 1px solid var(--tmo-line);
  background: #fff;
  color: var(--tmo-slate) !important;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.tmo-shop__cat:hover {
  border-color: var(--tmo-navy);
  color: var(--tmo-navy) !important;
}

.tmo-shop__cat.is-active {
  background: var(--tmo-navy);
  border-color: var(--tmo-navy);
  color: #fff !important;
}

.tmo-shop__cat-count {
  font-size: .72rem;
  font-weight: 600;
  opacity: .65;
}

.tmo-shop__cat.is-active .tmo-shop__cat-count {
  opacity: .8;
}

/* Toolbar */
.tmo-shop__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  margin: 0 0 1.5rem;
  padding: .85rem 0;
  border-top: 1px solid var(--tmo-line);
  border-bottom: 1px solid var(--tmo-line);
  animation: tmo-shop-rise .7s ease .12s both;
}

.tmo-shop__toolbar .woocommerce-result-count {
  margin: 0 !important;
  float: none !important;
  font-size: .88rem !important;
  font-weight: 500;
  color: var(--tmo-muted) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.tmo-shop__toolbar .woocommerce-ordering {
  margin: 0 !important;
  float: none !important;
}

.tmo-shop__toolbar .woocommerce-ordering select,
.tmo-shop__toolbar .orderby {
  min-height: 2.5rem;
  padding: .45rem .85rem !important;
  border: 1px solid var(--tmo-line) !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: var(--tmo-navy) !important;
  font-family: var(--tmo-font) !important;
  font-size: .85rem !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

/* Kill default Woo chrome inside shop */
.tmo-shop .woocommerce-breadcrumb,
.tmo-shop > .page-title,
body.woocommerce-shop .woocommerce-products-header,
.tmo-shop .woocommerce-notices-wrapper:empty {
  display: none !important;
}

/* Product grid */
.tmo-shop ul.products,
body.woocommerce-shop ul.products,
body.tax-product_cat ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1.5rem 1.25rem !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.tmo-shop ul.products::before,
.tmo-shop ul.products::after,
body.woocommerce-shop ul.products::before,
body.woocommerce-shop ul.products::after {
  display: none !important;
  content: none !important;
}

/* Tile */
.tmo-tile,
.tmo-shop ul.products li.product,
body.woocommerce-shop ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  clear: none !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-align: left !important;
  animation: tmo-shop-rise .75s ease both;
  animation-delay: calc(var(--tmo-tile-i, 1) * 45ms);
}

.tmo-tile__link {
  display: block !important;
  text-decoration: none !important;
  color: inherit !important;
}

.tmo-tile__media {
  position: relative;
  display: block;
  overflow: hidden;
  background: #e8eef3;
  aspect-ratio: 4 / 5;
}

.tmo-tile__img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center top !important;
  margin: 0 !important;
  display: block !important;
  transition: transform .65s ease, opacity .45s ease;
}

.tmo-tile__img--primary {
  position: relative;
  z-index: 1;
}

.tmo-tile__secondary {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity .4s ease;
}

.tmo-tile__secondary img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.tmo-tile:hover .tmo-tile__img--primary {
  transform: scale(1.03);
}

.tmo-tile:hover .tmo-tile__secondary {
  opacity: 1;
}

.tmo-tile__badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  z-index: 3;
  padding: .3rem .55rem;
  background: var(--tmo-gold);
  color: var(--tmo-navy);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}

/* Hide Woo default sale badge if any slips through */
.tmo-tile .onsale,
.tmo-shop ul.products .onsale {
  display: none !important;
}

.tmo-tile__body {
  display: grid;
  gap: .3rem;
  padding: .9rem 0 0;
}

.tmo-tile__title {
  font-family: var(--tmo-font) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  letter-spacing: -.01em !important;
  text-transform: none !important;
  color: var(--tmo-navy) !important;
}

.tmo-tile__price {
  font-size: .92rem;
  font-weight: 600;
  color: var(--tmo-slate);
}

.tmo-tile__price del {
  color: var(--tmo-muted);
  font-weight: 500;
  margin-right: .35rem;
}

.tmo-tile__price ins {
  text-decoration: none;
  color: var(--tmo-mint-deep);
  background: none;
}

.tmo-tile__cta {
  margin-top: .2rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tmo-muted);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s ease, transform .25s ease, color .2s ease;
}

.tmo-tile:hover .tmo-tile__cta {
  opacity: 1;
  transform: translateY(0);
  color: var(--tmo-navy);
}

/* Hide loop ATC / secondary image hook leftovers */
.tmo-shop ul.products .button,
.tmo-shop ul.products .add_to_cart_button,
.tmo-shop .tmo-product-card__secondary,
.tmo-shop .star-rating {
  display: none !important;
}

/* Empty */
.tmo-shop__empty {
  padding: 3rem 0;
  text-align: left;
}

.tmo-shop__empty p {
  margin: 0 0 1rem;
  color: var(--tmo-muted);
  font-size: 1.05rem;
}

/* Pagination */
.tmo-shop .woocommerce-pagination {
  margin: 2.5rem 0 0;
}

.tmo-shop .woocommerce-pagination ul {
  display: flex !important;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  list-style: none !important;
}

.tmo-shop .woocommerce-pagination ul li {
  margin: 0 !important;
  border: 0 !important;
  float: none !important;
}

.tmo-shop .woocommerce-pagination ul li a,
.tmo-shop .woocommerce-pagination ul li span {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: .4rem .7rem !important;
  border: 1px solid var(--tmo-line) !important;
  background: #fff !important;
  color: var(--tmo-navy) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.tmo-shop .woocommerce-pagination ul li span.current,
.tmo-shop .woocommerce-pagination ul li a:hover {
  background: var(--tmo-navy) !important;
  border-color: var(--tmo-navy) !important;
  color: #fff !important;
}

@keyframes tmo-shop-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .tmo-shop__intro,
  .tmo-shop__cats,
  .tmo-shop__toolbar,
  .tmo-tile {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  .tmo-shop ul.products,
  body.woocommerce-shop ul.products,
  body.tax-product_cat ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem 1rem !important;
  }

  .tmo-tile__cta {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .tmo-shop {
    padding: 1.35rem 1rem 3.5rem;
  }

  .tmo-shop__cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-right: -1rem;
    padding-right: 1rem;
    padding-bottom: .25rem;
  }

  .tmo-shop__cat {
    flex: 0 0 auto;
  }

  .tmo-shop__toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tmo-shop__toolbar .woocommerce-ordering,
  .tmo-shop__toolbar .orderby {
    width: 100%;
  }
}

/* Related / upsells on PDP share the same tile language */
.related ul.products,
.upsells ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1.25rem !important;
  margin: 0 !important;
  padding: 0 !important;
}
.related ul.products::before,
.related ul.products::after,
.upsells ul.products::before,
.upsells ul.products::after {
  display: none !important;
  content: none !important;
}
.related ul.products li.product,
.upsells ul.products li.product {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}
@media (max-width: 900px) {
  .related ul.products,
  .upsells ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
