/*
 * Catalog set: tpmall
 * Lattice list + matching PDP. Scoped to body.pdp-set-tpmall / html.pdp-set-tpmall
 * so classic (theme.css) stays untouched.
 */
body.pdp-set-tpmall {
  --cs-sticky-top: 112px;
  --cs-sale: #c2413b;
  --cs-line: #e5e5e5;
  --cs-muted: #888;
}

@media (max-width: 980px) {
  body.pdp-set-tpmall { --cs-sticky-top: 56px; }
}

body.pdp-set-tpmall .woo-shell {
  width: min(100% - 40px, 1280px);
  padding-top: 28px;
  padding-bottom: 72px;
}

/* ----- Catalog header + toolbar ----- */
body.pdp-set-tpmall .woo-shell .woocommerce-products-header {
  margin: 0 0 22px;
  text-align: center;
}
body.pdp-set-tpmall .woo-shell .woocommerce-products-header__title,
body.pdp-set-tpmall .woo-shell .page-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.3;
}
body.pdp-set-tpmall .woo-shell .term-description {
  margin: 8px auto 0;
  max-width: 640px;
  color: var(--cs-muted);
  font-size: 13px;
}

body.pdp-set-tpmall .cs-tpmall-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 22px;
  padding: 12px 0;
  border-top: 1px solid #111;
  border-bottom: 1px solid var(--cs-line);
}
body.pdp-set-tpmall .cs-tpmall-count,
body.pdp-set-tpmall .woo-shell .woocommerce-result-count {
  order: 1;
  float: none !important;
  margin: 0 auto 0 0 !important;
  font-size: 13px;
  color: #333;
}
body.pdp-set-tpmall .cs-tpmall-count .num {
  font-weight: 700;
  margin-right: 1px;
}
body.pdp-set-tpmall .cs-tpmall-toolbar__display {
  order: 2;
  display: inline-flex;
  border: 1px solid var(--cs-line);
}
body.pdp-set-tpmall .cs-tpmall-display {
  height: 32px;
  padding: 0 12px;
  border: 0;
  background: #fff;
  color: var(--cs-muted);
  font-size: 12px;
  cursor: pointer;
}
body.pdp-set-tpmall .cs-tpmall-display + .cs-tpmall-display {
  border-left: 1px solid var(--cs-line);
}
body.pdp-set-tpmall .cs-tpmall-display.is-active {
  background: #111;
  color: #fff;
}
body.pdp-set-tpmall .cs-tpmall-toolbar__per {
  order: 3;
  margin: 0;
}
body.pdp-set-tpmall .cs-tpmall-toolbar__per select,
body.pdp-set-tpmall .woo-shell .woocommerce-ordering select {
  height: 32px;
  border: 1px solid var(--cs-line);
  padding: 0 8px;
  background: #fff;
  font-size: 12px;
}
body.pdp-set-tpmall .woo-shell .woocommerce-ordering {
  order: 4;
  float: none !important;
  margin: 0 !important;
  text-align: left;
}
body.pdp-set-tpmall .cs-tpmall-toolbar .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ----- Lattice cards ----- */
body.pdp-set-tpmall .woocommerce .woo-shell ul.products,
body.pdp-set-tpmall .woocommerce-page .woo-shell ul.products,
body.pdp-set-tpmall .woo-shell ul.products {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px 14px !important;
  margin: 0 0 36px;
}

/* Woo catalog pager is .woocommerce-pagination; theme reset + unset Woo general hid it. */
body.pdp-set-tpmall .woocommerce-pagination {
  display: flex;
  justify-content: center;
  margin: 8px 0 0;
  padding: 4px 0 12px;
  clear: both;
}
body.pdp-set-tpmall .woocommerce-pagination ul.page-numbers {
  display: inline-flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: auto !important;
  margin: 0;
  padding: 0;
  list-style: none;
  float: none !important;
  grid-template-columns: none !important;
}
body.pdp-set-tpmall .woocommerce-pagination ul.page-numbers li {
  display: inline-flex;
  float: none;
  width: auto;
  margin: 0;
}
body.pdp-set-tpmall .woocommerce-pagination a.page-numbers,
body.pdp-set-tpmall .woocommerce-pagination span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--cs-line);
  color: #111;
  font-size: 13px;
  font-weight: 600;
  box-sizing: border-box;
}
body.pdp-set-tpmall .woocommerce-pagination .page-numbers.current {
  background: #111;
  border-color: #111;
  color: #fff;
}
body.pdp-set-tpmall .woocommerce-pagination .page-numbers.dots {
  border: 0;
  min-width: 20px;
}
body.pdp-set-tpmall .woo-shell ul.products li.product {
  display: flex;
  flex-direction: column;
}
body.pdp-set-tpmall .woo-shell ul.products li.product > a.woocommerce-LoopProduct-link {
  display: flex;
  flex-direction: column;
  color: inherit;
}
body.pdp-set-tpmall .woo-shell ul.products li.product a img,
body.pdp-set-tpmall .woo-shell ul.products li.product img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f4f4f4;
  margin: 0 0 10px;
  border-radius: 0;
}
body.pdp-set-tpmall .woo-shell ul.products li.product .woocommerce-loop-product__title {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.02em;
  min-height: 2.9em;
  margin: 0 0 6px;
  color: #222;
}
body.pdp-set-tpmall .woo-shell ul.products li.product .price {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}
body.pdp-set-tpmall .woo-shell ul.products li.product .price del {
  color: #aaa;
  font-weight: 400;
  font-size: 12px;
  margin-right: 6px;
}
body.pdp-set-tpmall .woo-shell ul.products li.product .price ins {
  text-decoration: none;
}
body.pdp-set-tpmall .woo-shell ul.products li.product .button,
body.pdp-set-tpmall .woo-shell ul.products li.product a.button {
  display: none !important;
}
body.pdp-set-tpmall .woo-shell ul.products li.product .onsale {
  top: 8px;
  left: 8px;
  background: var(--cs-sale);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 0;
  min-width: 0;
  line-height: 1.2;
}

/* List display toggle */
body.pdp-set-tpmall.is-cs-list .woocommerce .woo-shell ul.products,
body.pdp-set-tpmall.is-cs-list .woo-shell ul.products {
  grid-template-columns: 1fr !important;
  gap: 0 !important;
}
body.pdp-set-tpmall.is-cs-list .woo-shell ul.products li.product {
  padding: 16px 0;
  border-bottom: 1px solid var(--cs-line);
}
body.pdp-set-tpmall.is-cs-list .woo-shell ul.products li.product > a.woocommerce-LoopProduct-link {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 18px;
  align-items: start;
}
body.pdp-set-tpmall.is-cs-list .woo-shell ul.products li.product img {
  grid-row: 1 / span 3;
  width: 120px;
  margin: 0;
}
body.pdp-set-tpmall.is-cs-list .woo-shell ul.products li.product .woocommerce-loop-product__title {
  min-height: 0;
  font-size: 15px;
  margin: 4px 0 8px;
}
body.pdp-set-tpmall.is-cs-list .woo-shell ul.products li.product .onsale {
  left: 8px;
}

/* ----- Detail: gallery + buy box ----- */
body.pdp-set-tpmall.single-product .woo-shell div.product {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 36px 48px;
  align-items: start;
}
body.pdp-set-tpmall.single-product .woo-shell div.product > .woocommerce-product-gallery,
body.pdp-set-tpmall.single-product .woo-shell div.product > .images {
  border: 1px solid var(--cs-line);
  background: #fafafa;
}
body.pdp-set-tpmall.single-product .woocommerce-product-gallery__image {
  background: #fafafa;
}
body.pdp-set-tpmall.single-product .woocommerce-product-gallery__image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fafafa;
}
body.pdp-set-tpmall.single-product .flex-control-thumbs,
body.pdp-set-tpmall.single-product .woocommerce-product-gallery ol {
  display: flex;
  gap: 8px;
  margin: 10px;
  overflow-x: auto;
  grid-template-columns: none;
}
body.pdp-set-tpmall.single-product .flex-control-thumbs li {
  flex: 0 0 64px;
  width: 64px;
  margin: 0;
}
body.pdp-set-tpmall.single-product .flex-control-thumbs li img {
  width: 64px;
  height: 64px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--cs-line);
  opacity: 1;
}
body.pdp-set-tpmall.single-product .flex-control-thumbs li img.flex-active {
  border-color: #111;
}

body.pdp-set-tpmall.single-product .woo-shell span.onsale {
  background: var(--cs-sale);
  border-radius: 0;
  font-weight: 700;
}

body.pdp-set-tpmall.single-product .woo-shell .summary {
  align-self: start;
}
body.pdp-set-tpmall.single-product .woo-shell .product_title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.4;
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #111;
}
body.pdp-set-tpmall.single-product .woo-shell .summary .price {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0 0 16px;
}
body.pdp-set-tpmall.single-product .woo-shell .summary .price del {
  font-size: 15px;
  color: #aaa;
}
body.pdp-set-tpmall.single-product .woo-shell .summary .price ins {
  text-decoration: none;
}

body.pdp-set-tpmall .cs-tpmall-spec {
  margin: 0 0 18px;
  padding: 0;
  border-top: 1px solid var(--cs-line);
  list-style: none;
}
body.pdp-set-tpmall .cs-tpmall-spec li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--cs-line);
  font-size: 13px;
}
body.pdp-set-tpmall .cs-tpmall-spec__th {
  color: var(--cs-muted);
}
body.pdp-set-tpmall .cs-tpmall-spec__td a {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.pdp-set-tpmall.single-product .woo-shell .summary .woocommerce-product-details__short-description {
  margin: 0 0 16px;
  color: #555;
  font-size: 13px;
}

body.pdp-set-tpmall.single-product .woo-shell table.variations th {
  width: 88px;
  color: var(--cs-muted);
  font-weight: 400;
  font-size: 13px;
}
body.pdp-set-tpmall.single-product .woo-shell table.variations select {
  height: 42px;
  border: 1px solid #ccc;
}

body.pdp-set-tpmall .cs-tpmall-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  grid-column: 1 / -1;
  margin: 4px 0 14px;
  padding: 14px 0 4px;
  border-top: 1px solid #111;
}
body.pdp-set-tpmall .cs-tpmall-total__label {
  font-size: 13px;
  color: #333;
}
body.pdp-set-tpmall .cs-tpmall-total__value,
body.pdp-set-tpmall .cs-tpmall-total__value .amount {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

body.pdp-set-tpmall.single-product .woo-shell form.cart .woocommerce-variation-add-to-cart,
body.pdp-set-tpmall.single-product .woo-shell form.cart:not(.variations_form) {
  display: grid;
  grid-template-columns: 88px 1fr 1fr;
  gap: 8px;
}
body.pdp-set-tpmall.single-product .woo-shell form.cart .quantity {
  grid-column: 1;
}
body.pdp-set-tpmall.single-product .woo-shell form.cart .quantity .qty {
  width: 88px;
  height: 48px;
  border: 1px solid #ccc;
}
body.pdp-set-tpmall.single-product .woo-shell form.cart .single_add_to_cart_button,
body.pdp-set-tpmall.single-product .woo-shell form.cart .wovlen-buy-now {
  height: 48px;
  min-width: 0;
  flex: none;
  font-size: 14px;
  letter-spacing: -0.02em;
}
body.pdp-set-tpmall.single-product .woo-shell form.cart .single_add_to_cart_button:not(.wovlen-buy-now) {
  background: #fff;
  color: #111;
  border: 1px solid #111;
}
body.pdp-set-tpmall.single-product .woo-shell form.cart .single_add_to_cart_button:not(.wovlen-buy-now):hover {
  background: #f5f5f5;
}
body.pdp-set-tpmall.single-product .woo-shell form.cart .single_add_to_cart_button.wovlen-buy-now {
  background: #111;
  color: #fff;
}
body.pdp-set-tpmall.single-product .woo-shell form.cart .single_add_to_cart_button.wovlen-buy-now:hover {
  background: #333;
}

body.pdp-set-tpmall.single-product .woo-shell .product_meta {
  border-top: 0;
  padding-top: 8px;
  font-size: 12px;
}

/* ----- goods_contents_quick tabs ----- */
body.pdp-set-tpmall.single-product .woo-shell div.product > .related,
body.pdp-set-tpmall.single-product .woo-shell div.product > .upsells {
  grid-column: 1 / -1;
}
body.pdp-set-tpmall.single-product #goods_contents_quick {
  margin-top: 48px;
  min-width: 0;
  max-width: 100%;
}
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs {
  margin-top: 0;
}
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  flex-wrap: nowrap;
  gap: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  border: 1px solid #111;
  border-left: 0;
  border-right: 0;
  background: #fff;
  list-style: none;
}
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs::before,
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs::after,
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs li::before,
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs li::after {
  display: none !important;
  content: none !important;
}
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  min-width: 0;
  flex: 1 1 0;
}
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs li a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 4px;
  color: #888;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.03em;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs li.active a,
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs li a:hover {
  color: #111;
  font-weight: 700;
  border-bottom-color: #111;
}
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs .panel {
  padding: 36px 0 16px;
  max-width: 860px;
  margin: 0 auto;
  min-width: 0;
  overflow-x: auto;
}
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs .panel table {
  max-width: 100% !important;
  width: 100% !important;
  table-layout: fixed;
}
body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs .panel img {
  max-width: 100% !important;
  width: auto;
  height: auto !important;
  margin: 0 auto 8px;
}
body.pdp-set-tpmall.single-product .woo-shell .wovlen-pdp-guide {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 4px 24px;
  color: #333;
  font-size: 14px;
  line-height: 1.85;
}
body.pdp-set-tpmall.single-product .woo-shell .wovlen-pdp-guide h3 {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  padding-bottom: 12px;
  border-bottom: 1px solid #111;
}

body.pdp-set-tpmall.single-product .woo-shell .related > h2,
body.pdp-set-tpmall.single-product .woo-shell .upsells > h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #111;
}

@media (max-width: 1200px) {
  body.pdp-set-tpmall .woocommerce .woo-shell ul.products,
  body.pdp-set-tpmall .woo-shell ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Desktop: gallery + buy box side by side, tabs full width below (no sticky). */
@media (min-width: 981px) {
  body.pdp-set-tpmall.single-product .woo-shell div.product > .woocommerce-product-gallery,
  body.pdp-set-tpmall.single-product .woo-shell div.product > .images {
    grid-column: 1;
    grid-row: 1;
  }
  body.pdp-set-tpmall.single-product .woo-shell div.product > .summary {
    grid-column: 2;
    grid-row: 1;
    padding-left: 8px;
  }
  body.pdp-set-tpmall.single-product .woo-shell div.product > .cs-tpmall-contents,
  body.pdp-set-tpmall.single-product .woo-shell div.product > .woocommerce-product-gallery + .summary + .cs-tpmall-contents {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-left: 1px solid #111;
    border-right: 1px solid #111;
  }
}

@media (max-width: 980px) {
  body.pdp-set-tpmall.single-product .woo-shell div.product > .cs-tpmall-contents,
  body.pdp-set-tpmall.single-product .woo-shell div.product > .woocommerce-product-gallery + .summary + .cs-tpmall-contents {
    grid-column: 1 / -1;
  }
  body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs {
    position: static;
  }
  body.pdp-set-tpmall .woocommerce .woo-shell ul.products,
  body.pdp-set-tpmall .woocommerce-page .woo-shell ul.products,
  body.pdp-set-tpmall .woo-shell ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px 10px !important;
  }
  body.pdp-set-tpmall.single-product .woo-shell div.product {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  body.pdp-set-tpmall.single-product .woo-shell .summary {
    position: static;
  }
  body.pdp-set-tpmall.single-product .woo-shell form.cart .woocommerce-variation-add-to-cart,
  body.pdp-set-tpmall.single-product .woo-shell form.cart:not(.variations_form) {
    grid-template-columns: 72px 1fr 1fr;
  }
  body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body.pdp-set-tpmall.single-product .woo-shell .woocommerce-tabs ul.tabs li a {
    min-height: 44px;
    font-size: 13px;
  }
  body.pdp-set-tpmall .cs-tpmall-toolbar {
    gap: 8px;
  }
  body.pdp-set-tpmall .cs-tpmall-count {
    flex: 1 0 100%;
  }
}

@media (max-width: 640px) {
  body.pdp-set-tpmall .woo-shell {
    width: min(100% - 24px, 1280px);
  }
  body.pdp-set-tpmall.is-cs-list .woo-shell ul.products li.product > a.woocommerce-LoopProduct-link {
    grid-template-columns: 88px minmax(0, 1fr);
  }
  body.pdp-set-tpmall.is-cs-list .woo-shell ul.products li.product img {
    width: 88px;
  }
}
