/* Price hierarchy shared by homepage cards, the catalogue and product summaries. */
body .md-main ul.products li.product .price,
body.single-product .md-shop-main div.product .summary > .price {
  font-size: 20px !important;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

body .md-main .price .md-price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  letter-spacing: 0;
  white-space: normal;
}

body .md-main .price .md-price-breakdown .md-preorder-card-balance {
  display: block;
  margin: 0;
  color: #f5f3ed;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.5;
}

body .md-main .price .md-price-breakdown .md-card-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}

body .md-main .price .md-price-breakdown .md-card-total .md-price-label {
  font-size: 16px;
  font-weight: 500;
}

body .md-main .price .md-price-breakdown .md-card-total .amount {
  font-size: 20px;
  font-weight: 650;
}

body .md-main .price .md-price-breakdown .md-preorder-card-price,
body .md-main .price .md-price-breakdown .md-preorder-card-price > .amount {
  display: block;
  margin: 0;
  color: #e5e4dc;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
}

body .md-main .price .md-price-breakdown .md-preorder-card-price > .amount {
  display: inline;
  margin-right: 0;
}

body .md-main .price .md-price-breakdown .md-card-remaining {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  margin: 0;
  color: #c7c9c1;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
}

body .md-main .price .md-price-breakdown .amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* The loop PHP now requests the full attachment; contain shows all of that source. */
.md-products ul.products li.product a img.md-catalog-image,
.md-shop-main ul.products li.product a img.md-catalog-image {
  display: block;
  width: 100%;
  height: auto !important;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  background: #f1eee6;
}

/* Product archives only. Keep homepage, related products and checkout unchanged. */
body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main {
  --md-card-inset: 22px;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products {
  gap: 24px;
  align-items: stretch;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 0 var(--md-card-inset) !important;
  border: 1px solid #35372f;
  border-radius: 18px;
  background: #191c17;
  overflow: hidden;
  box-shadow: 0 8px 24px #00000012;
  transition: border-color .18s ease, box-shadow .18s ease;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product:hover {
  border-color: #69705b;
  box-shadow: 0 12px 30px #00000026;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product > .woocommerce-LoopProduct-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product img.md-catalog-image {
  display: block;
  width: 100%;
  height: auto !important;
  aspect-ratio: 880 / 587;
  object-fit: contain;
  margin: 0 0 22px !important;
  border-radius: 0;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .woocommerce-loop-product__title {
  min-height: 2.8em;
  padding: 0 !important;
  margin: 0 var(--md-card-inset) 14px !important;
  color: #f5f3ed;
  font-size: 19px !important;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.015em;
  overflow-wrap: break-word;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .price {
  display: block;
  margin: 0 var(--md-card-inset) !important;
  color: #f5f3ed;
  font-size: 28px !important;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .md-price-breakdown {
  gap: 8px;
  letter-spacing: 0;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .price > .amount {
  color: #f5f3ed;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .md-card-total {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 8px;
  margin-bottom: 5px;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .md-card-total > .amount {
  order: -1;
  color: #f5f3ed;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.025em;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .md-card-total .md-price-label {
  color: #b7beb0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .md-preorder-card-price,
body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .md-preorder-card-price > .amount {
  color: #f4c7a7;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .md-card-remaining {
  gap: 2px 5px;
  color: #b7beb0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .md-preorder-badge {
  position: static;
  max-width: calc(100% - 44px);
  width: fit-content;
  box-sizing: border-box;
  margin: 16px var(--md-card-inset) 0;
  padding: 7px 10px;
  border: 1px solid #474f3c;
  border-radius: 7px;
  background: #22281d;
  color: #d6dfc9;
  font-size: 13px !important;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product > .button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: auto;
  min-height: 48px;
  box-sizing: border-box;
  margin: 24px var(--md-card-inset) 0 !important;
  padding: 12px 16px !important;
  border: 1px solid #515745 !important;
  border-radius: 9px !important;
  background: #262c21 !important;
  color: #f5f3ed !important;
  font-size: 15px !important;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product.product-type-variable > .button {
  border-color: var(--md-orange) !important;
  background: var(--md-orange) !important;
  color: #171710 !important;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product > .button:hover {
  border-color: #97a380 !important;
  filter: brightness(1.1);
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product > a:focus-visible {
  outline: 3px solid #ffc185;
  outline-offset: -4px;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main .woocommerce-result-count {
  margin-bottom: 24px;
  color: #bcc3b4;
  font-size: 14px;
  line-height: 44px;
}

body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main .woocommerce-ordering select {
  min-height: 44px;
  padding: 9px 32px 9px 14px;
  border-color: #454c3e;
  border-radius: 8px;
  background: #191c17;
  color: #f5f3ed;
  font-size: 14px;
}

@media (min-width: 1360px) {
  body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .woocommerce-loop-product__title {
    min-height: 1.4em;
  }
}

@media (max-width: 600px) {
  body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .woocommerce-loop-product__title {
    min-height: 0;
    font-size: 20px !important;
  }
  body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main .woocommerce-result-count {
    float: none;
    margin-bottom: 10px;
    line-height: 1.5;
  }
  body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main .woocommerce-ordering {
    float: none;
    margin-bottom: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product {
    transition: none;
  }
}

/* Currency display adds a wrapper after load; preserve the archive's primary price style. */
body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .price > .md-local-price,
body:is(.post-type-archive-product, .tax-product_cat, .tax-product_tag) .md-shop-main > ul.products > li.product .price > .md-local-price > .amount {
  color: #f5f3ed;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}
