/* Shop / category / archive product grid — minimal, matches homepage cards. */

.woodmart-archive-shop .wd-content-layout,
.woodmart-archive-blog .wd-content-layout {
  max-width: var(--bc-container) !important;
  margin-inline: auto !important;
  padding-inline: clamp(20px, 3vw, 40px) !important;
}

.woodmart-archive-shop .wd-shop-tools {
  margin-bottom: 24px !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid var(--bc-border) !important;
}

.woodmart-archive-shop :is(.wd-shop-tools, .woocommerce-ordering, .wd-products-per-page, .wd-products-shop-view) {
  color: var(--bc-muted) !important;
  font-size: 12px !important;
}

/* Sidebar */
.woodmart-archive-shop .wd-sidebar {
  color: var(--bc-muted) !important;
}

.woodmart-archive-shop .wd-sidebar :is(.widget-title, .wd-widget-title) {
  color: var(--bc-ink) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
}

.woodmart-archive-shop .wd-sidebar a {
  color: var(--bc-muted) !important;
}

.woodmart-archive-shop .wd-sidebar a:hover {
  color: var(--bc-ink) !important;
}

/* Product card（body.wd 前缀压过数据库残留的米色卡片/边框/内边距规则）。 */
body.wd .wd-products .wd-product,
body.wd .product-grid-item {
  background: transparent !important;
  border: 0 !important;
}

body.wd .products :is(.product-image-wrapper, .product-image-link) {
  background-color: var(--bc-image-bg) !important;
}

body.wd .products :is(.attachment-woocommerce_thumbnail, img.wp-post-image) {
  padding: 0 !important;
  object-fit: cover !important;
}

body.wd .wd-sidebar .widget-area,
body.wd .widget-area {
  border: 0 !important;
  padding: 0 !important;
}

.wd-products .wd-product .wd-product-wrapper,
.wd-products .wd-product .product-wrapper {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* 按钮嵌在 .wd-product-thumb 内、与标题价格不同层；
   用 display:contents 拍平后统一 order：图片→标题→价格→按钮（图二顺序）。 */
body.wd .wd-products .wd-product .product-wrapper {
  display: flex !important;
  flex-direction: column !important;
}

body.wd .wd-products .wd-product .wd-product-thumb {
  display: contents !important;
}

body.wd .wd-products .wd-product .product-wrapper > .wd-product-thumb ~ *,
body.wd .wd-products .wd-product .product-image-link {
  min-width: 0 !important;
}

body.wd .wd-products .wd-product .product-image-link {
  order: 0 !important;
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
  aspect-ratio: 1 / 1 !important;
  margin-bottom: 14px !important;
  border: 1px solid var(--bc-border) !important;
  background: var(--bc-image-bg) !important;
}

body.wd .wd-products .wd-product .wd-entities-title {
  order: 1 !important;
}

body.wd .wd-products .wd-product .price {
  order: 2 !important;
}

body.wd .wd-products .wd-product .wd-add-btn {
  order: 3 !important;
}

.wd-products .wd-product .wd-product-thumb a,
.wd-products .wd-product .wd-product-thumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.wd-products .wd-product .wd-product-thumb img {
  transition: transform 1s ease !important;
}

.wd-products .wd-product:hover .wd-product-thumb img,
.wd-products .wd-product:hover .product-image-link img {
  transform: scale(1.05) !important;
}

/* 标题/价格直接是 product-wrapper 的子元素，居中即可。 */

body.wd .wd-products .wd-product .wd-product-cats {
  display: none !important;
}

/* display:contents 后，悬浮副图与角标图标会脱离定位上下文：副图隐藏，图标隐藏。 */
body.wd .wd-products .wd-product .wd-product-img-hover {
  display: none !important;
}

body.wd .wd-products .wd-product .wd-buttons {
  display: none !important;
}

/* ON SALE 标签：白底细黑边黑字，钉在图片左上角（图二）。 */
body.wd .wd-products .wd-product .product-wrapper {
  position: relative !important;
}

body.wd .wd-products .wd-product .product-labels {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  right: auto !important;
  z-index: 3 !important;
}

body.wd .wd-products .wd-product .product-label,
body.wd .product-labels .product-label {
  border: 1px solid var(--bc-ink) !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: var(--bc-ink) !important;
  padding: 4px 10px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
}

/* （边框已移到 .product-image-link 上，.wd-product-thumb 为 display:contents。） */

/* 加购按钮常显（不只 hover 出现）；order:3 已排到最后。 */
body.wd .wd-products .wd-product .wd-add-btn {
  display: block !important;
  width: 100% !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  position: static !important;
  margin-top: 12px !important;
  padding: 0 !important;
  text-align: center !important;
}

.wd-products .wd-product .wd-entities-title {
  margin: 6px 0 8px !important;
  text-align: center !important;
}

.wd-products .wd-product .wd-entities-title,
.wd-products .wd-product .wd-entities-title a {
  color: var(--bc-ink) !important;
  font-family: var(--bc-sans) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  text-transform: none !important;
}

.wd-products .wd-product:hover .wd-entities-title a {
  color: var(--bc-accent) !important;
}

.wd-products .wd-product .price {
  display: block !important;
  text-align: center !important;
  font-size: 15px !important;
  font-weight: 500 !important;
}

.wd-products .wd-product .price del {
  margin-right: 6px !important;
}

/* Add-to-cart：白底黑边描边按钮，标题价格之后（图二风格）。 */
body.wd .wd-products .wd-product .wd-add-btn > a,
body.wd .wd-products .wd-product .add_to_cart_button,
body.wd .product-grid-item .button {
  display: flex !important;
  width: 100% !important;
  min-height: 40px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 12px 0 0 !important;
  padding: 0 16px !important;
  border: 1px solid var(--bc-ink) !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: var(--bc-ink) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  transition: background .25s ease, color .25s ease !important;
}

body.wd .wd-products .wd-product .wd-add-btn > a:hover,
body.wd .wd-products .wd-product .add_to_cart_button:hover,
body.wd .product-grid-item .button:hover {
  background: var(--bc-ink) !important;
  color: #fff !important;
}

body.wd .wd-products .wd-product .wd-add-btn {
  text-align: center !important;
}

@media (max-width: 768px) {
  .woodmart-archive-shop .wd-shop-tools {
    gap: 12px !important;
  }
}

/* Reference shop page */
body.wd.woodmart-archive-shop :is(.container, .wd-container, .woodmart-container, .main-page-wrapper, .wd-content-layout, .content-layout-wrapper) {
  max-width: none !important;
}

body.wd.woodmart-archive-shop .wd-content-layout {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 8px 64px !important;
}

body.wd.woodmart-archive-shop .wd-content-area {
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 100% !important;
  grid-column: 1 / -1 !important;
  --wd-col-lg: 12 !important;
  --wd-col-md: 12 !important;
  --wd-col-sm: 12 !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: auto !important;
  width: 100% !important;
  flex: 1 1 100% !important;
  grid-column: 1 / -1 !important;
  --wd-col-lg: 12 !important;
  --wd-col-md: 12 !important;
  --wd-col-sm: 12 !important;
  max-height: 0 !important;
  max-width: none !important;
  margin: -40px 0 40px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: none !important;
  transition: max-height .28s ease, opacity .2s ease, visibility .2s ease, padding .28s ease, border-color .2s ease !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container.wd-opened {
  max-height: 900px !important;
  padding: 26px 0 28px !important;
  overflow: visible !important;
  border-bottom: 1px solid #eee !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .wd-heading {
  display: none !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .widget-area {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: none !important;
  gap: 18px !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .sidebar-widget {
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) !important;
  align-items: start !important;
  width: 100% !important;
  max-width: none !important;
  column-gap: 26px !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .widget_search {
  display: none !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .sidebar-widget.wd-product-category-filter {
  grid-column: auto !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .sidebar-widget.woodmart-price-filter {
  grid-column: auto !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .sidebar-widget.wd-widget-stock-status {
  grid-column: auto !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container :is(.wd-scroll, .woodmart-price-filter, .wd-widget-stock-status) {
  width: 100% !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .sidebar-widget > :is(.wd-scroll, .wd-checkboxes-on),
body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .sidebar-widget.woodmart-price-filter > .woodmart-price-filter {
  grid-column: 2 !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container :is(.wd-scroll, .wd-scroll-content) {
  max-height: none !important;
  overflow: visible !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container :is(.product-categories, .woodmart-price-filter ul, .wd-checkboxes-on) {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px 16px !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container :is(.product-categories li, .woodmart-price-filter li, .wd-checkboxes-on li) {
  display: inline-flex !important;
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container :is(.product-categories li a, .woodmart-price-filter li a, .wd-checkboxes-on li a) {
  display: inline-flex !important;
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  overflow: visible !important;
  padding: 0 !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container :is(.widget-title, .wd-widget-title) {
  margin: 2px 0 0 !important;
  color: #111 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container :is(li, a, label) {
  color: #555 !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
}

body.wd.woodmart-archive-shop .wd-close-side.wd-close-side-opened {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.wd.woodmart-archive-shop .shop-loop-head .wd-shop-tools:first-child {
  display: none !important;
}

body.wd.woodmart-archive-shop .shop-loop-head {
  width: 100% !important;
  max-width: none !important;
}

body.wd.woodmart-archive-shop .shop-loop-head .wd-shop-tools {
  display: flex !important;
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 62px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 20px !important;
  margin: 0 0 40px !important;
  padding: 0 !important;
  border-top: 1px solid #eee !important;
  border-bottom: 1px solid #eee !important;
  background: #fff !important;
}

body.wd.woodmart-archive-shop .wd-show-sidebar-btn {
  display: inline-flex !important;
  align-items: center !important;
  margin-right: 24px !important;
  color: #242424 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  text-transform: none !important;
}

body.wd.woodmart-archive-shop .wd-show-sidebar-btn .wd-action-icon::before {
  font-size: 14px !important;
}

body.wd.woodmart-archive-shop .wd-products-per-page {
  margin-right: auto !important;
  gap: 10px !important;
  color: #767676 !important;
  font-size: 12px !important;
}

body.wd.woodmart-archive-shop .wd-products-per-page .per-page-title::after,
body.wd.woodmart-archive-shop .wd-products-per-page .per-page-border {
  display: none !important;
}

body.wd.woodmart-archive-shop .wd-products-per-page a {
  display: inline-flex !important;
  min-width: 68px !important;
  height: 40px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 28px 0 14px !important;
  border: 1px solid #e5e5e5 !important;
  color: #242424 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  text-decoration: none !important;
  background: #fff var(--wd-form-chevron) no-repeat right 8px top 50% / 16px 16px !important;
}

body.wd.woodmart-archive-shop .wd-products-shop-view {
  margin-left: auto !important;
  gap: 14px !important;
}

body.wd.woodmart-archive-shop .wd-products-shop-view a {
  color: #9a9a9a !important;
}

body.wd.woodmart-archive-shop .wd-products-shop-view a.current-variation {
  color: #242424 !important;
}

body.wd.woodmart-archive-shop .woocommerce-ordering select {
  width: 150px !important;
  height: 40px !important;
  padding: 0 30px 0 14px !important;
  border: 1px solid #e5e5e5 !important;
  color: #767676 !important;
  background-color: #fff !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 40px !important;
}

body.wd.woodmart-archive-shop .products.wd-products[data-source="main_loop"] {
  --wd-col: 5 !important;
  --wd-col-lg: 5 !important;
  --wd-col-md: 5 !important;
  --wd-col-sm: 3 !important;
  --wd-col-xs: 2 !important;
  --wd-gap: 20px !important;
  --wd-gap-lg: 20px !important;
  --wd-gap-md: 18px !important;
  --wd-gap-sm: 16px !important;
  --wd-gap-xs: 12px !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 30px 20px !important;
  margin: 0 !important;
  border: 0 !important;
  align-items: start !important;
}

body.wd.woodmart-archive-shop .products-bordered-grid.elements-grid > .wd-col,
body.wd.woodmart-archive-shop .products.wd-products[data-source="main_loop"] > .wd-col {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .product-wrapper {
  display: grid !important;
  grid-template-rows: auto auto auto auto !important;
  gap: 0 !important;
  min-width: 0 !important;
  position: relative !important;
  background: transparent !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-product-thumb {
  display: contents !important;
  margin: 0 !important;
  border: 0 !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .product-image-link {
  order: 0 !important;
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 0 10px !important;
  border: 0 !important;
  aspect-ratio: 1 / 1 !important;
  background: #f5f5f5 !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product :is(.product-image-link img, img.wp-post-image, .attachment-woocommerce_thumbnail) {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-buttons {
  display: none !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .product-labels {
  position: absolute !important;
  top: 14px !important;
  left: 14px !important;
  right: auto !important;
  z-index: 4 !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .product-label {
  min-height: 0 !important;
  padding: 4px 8px !important;
  border: 0 !important;
  background: #fff !important;
  color: #242424 !important;
  font-size: 9px !important;
  font-weight: 500 !important;
  letter-spacing: .04em !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-entities-title {
  order: 1 !important;
  display: -webkit-box !important;
  min-height: 34px !important;
  margin: 0 8px 8px !important;
  overflow: hidden !important;
  text-align: center !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-entities-title,
body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-entities-title a {
  color: #111 !important;
  font-family: var(--bc-sans) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.28 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .price {
  order: 2 !important;
  display: block !important;
  min-height: 20px !important;
  margin: 0 0 14px !important;
  color: #111 !important;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .price del {
  margin-right: 7px !important;
  color: #111 !important;
  opacity: 1 !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .price ins {
  color: #111 !important;
  text-decoration: none !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-add-btn {
  order: 3 !important;
  display: block !important;
  position: static !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 2px !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-add-btn > a {
  display: inline-flex !important;
  width: 100% !important;
  min-height: 42px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid #242424 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #111 !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-add-btn > a::before {
  content: "\f123" !important;
  position: static !important;
  inset: auto !important;
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  color: currentColor !important;
  font-family: "woodmart-font" !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  opacity: 1 !important;
  transform: none !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-add-btn > a span {
  min-height: 0 !important;
  transform: none !important;
  opacity: 1 !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-add-btn > a::after,
body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-add-btn .wd-action-icon {
  display: none !important;
}

body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-add-btn > a:hover {
  background: #111 !important;
  color: #fff !important;
}

@media (max-width: 1024px) {
  body.wd.woodmart-archive-shop .products.wd-products[data-source="main_loop"] {
    --wd-col: 4 !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  body.wd.woodmart-archive-shop .wd-content-layout {
    padding-inline: 6px !important;
  }

  body.wd.woodmart-archive-shop .shop-loop-head .wd-shop-tools {
    min-height: 56px !important;
    margin-bottom: 28px !important;
    gap: 12px !important;
  }

  body.wd.woodmart-archive-shop .products.wd-products[data-source="main_loop"] {
    --wd-col: 3 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 26px 14px !important;
  }

  body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .widget-area {
    gap: 18px !important;
  }

  body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .sidebar-widget {
    grid-template-columns: 150px minmax(0, 1fr) !important;
    column-gap: 20px !important;
  }

  body.wd.woodmart-archive-shop .woocommerce-ordering select {
    width: 132px !important;
  }
}

@media (max-width: 576px) {
  body.wd.woodmart-archive-shop .products.wd-products[data-source="main_loop"] {
    --wd-col: 2 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px 12px !important;
  }

  body.wd.woodmart-archive-shop .wd-products-shop-view {
    display: none !important;
  }

  body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container {
    margin-bottom: 28px !important;
  }

  body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .widget-area {
    gap: 22px !important;
  }

  body.wd.woodmart-archive-shop .wd-sidebar.sidebar-container .sidebar-widget {
    grid-template-columns: 1fr !important;
    row-gap: 10px !important;
  }

  body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-entities-title,
  body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-entities-title a {
    font-size: 12px !important;
  }

  body.wd.woodmart-archive-shop .products.wd-products .wd-product .wd-add-btn > a {
    min-height: 38px !important;
    font-size: 10px !important;
  }
}
