/* Owned native product archive: restore the retained full-width header/category stack. */
body.woocommerce.archive .wd-00000106 {
  flex-direction: column;
}
body.woocommerce.archive .wd-00000106 > .wp-block-wd-column {
  flex: none;
  width: 100%;
  min-width: 0;
}
/* Root shop has no current category: do not render the full navigation list. */
body.woocommerce-shop .malare-current-category-nav {
  display: none !important;
}
/* Retained old category carousel title size; keep native image ratio and slides. */
body.woocommerce.archive .malare-product-archive-parent-cats .wd-entities-title {
  font-size: 16px;
}

/* Keep the native review at the full width of its owned grid column. */
body.woocommerce-checkout form.checkout.malare-checkout > .checkout-order-review {
  width: 100%;
  max-width: 100%;
  flex: initial;
  padding: 24px;
}
body.woocommerce-checkout form.malare-checkout .malare-checkout-contact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}
body.woocommerce-checkout form.malare-checkout .malare-checkout-contact-fields > .form-row {
  width: 100%;
  float: none;
  clear: none;
}
body.woocommerce-checkout form.malare-checkout .malare-checkout-contact-fields::after {
  display: none;
}
body.woocommerce-checkout form.malare-checkout #order_review .amount {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
/* Reserve readable numeric columns in the native desktop cart table. */
@media (min-width: 769px) {
  body.woocommerce-cart .woocommerce-cart-form table.cart {
    table-layout: auto;
    width: 100%;
  }
  body.woocommerce-cart .woocommerce-cart-form table.cart :is(th, td) {
    padding: 12px 6px;
  }
  body.woocommerce-cart .woocommerce-cart-form table.cart .product-remove {
    width: 24px;
    padding-inline: 0;
  }
  body.woocommerce-cart .woocommerce-cart-form table.cart .product-thumbnail {
    width: 76px;
  }
  body.woocommerce-cart .woocommerce-cart-form table.cart .product-name {
    width: auto;
  }
  body.woocommerce-cart .woocommerce-cart-form table.cart .product-price {
    width: 84px;
  }
  body.woocommerce-cart .woocommerce-cart-form table.cart .product-quantity {
    width: 126px;
  }
  body.woocommerce-cart .woocommerce-cart-form table.cart .product-subtotal {
    width: 100px;
  }
  body.woocommerce-cart .woocommerce-cart-form table.cart th:not(.product-name) {
    font-size: 14px;
  }
  body.woocommerce-cart .woocommerce-cart-form table.cart :is(.product-price, .product-quantity, .product-subtotal) {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }
}
@media (max-width: 600px) {
  body.woocommerce-checkout form.malare-checkout .malare-checkout-contact-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 480px) {
  body.woocommerce-checkout form.checkout.malare-checkout > .checkout-order-review {
    padding: 16px;
  }
}

/* Finite old Source fidelity: native mobile category titles stay on the image. */
@media (max-width: 767px) {
  body.woocommerce.archive .malare-product-archive-parent-cats .wd-cat > .wd-cat-inner {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
  }
  body.woocommerce.archive .malare-product-archive-parent-cats .wd-cat .wd-cat-image,
  body.woocommerce.archive .malare-product-archive-parent-cats .wd-cat .wd-cat-image img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
  }
  body.woocommerce.archive .malare-product-archive-parent-cats .wd-cat .wd-cat-content.hover-mask {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 12px;
    background: linear-gradient(180deg, rgba(12, 19, 26, 0.18), rgba(12, 19, 26, 0.42));
    text-align: center;
    transform: none;
    pointer-events: none;
  }
  body.woocommerce.archive .malare-product-archive-parent-cats .wd-cat .wd-entities-title {
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: 16px;
    line-height: 20px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.58);
  }
}

/* Keep the current native buy action; restore its retained blue58/radius12 surface. */
body.single-product .malare-product-buybox .single_add_to_cart_button {
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  background-color: #2f5bbf;
  color: #fff;
}
body.single-product .malare-product-buybox .single_add_to_cart_button:hover {
  background-color: #244fb0;
  color: #fff;
}

/* The owned outer card supplies summary chrome; remove the native inner duplicate. */
body.woocommerce-cart .cart-content-wrapper > .cart_totals > .cart-totals-inner {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.woocommerce-cart .cart-content-wrapper > .cart_totals > .cart-totals-inner > h2 {
  display: none;
}

/* Product-only retained rhythm; preserve native bottom-reset reserve via its own variable. */
body.single-product .malare-product-buybox .wd-single-add-cart table.variations {
  display: block;
  width: 100%;
  margin: 0 0 var(--wd-var-table-mb, 20px);
  padding: 0;
}
body.single-product .malare-product-buybox .wd-single-add-cart table.variations > tbody,
body.single-product .malare-product-buybox .wd-single-add-cart table.variations > tbody > tr,
body.single-product .malare-product-buybox .wd-single-add-cart table.variations > tbody > tr > .cell {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}
body.single-product .malare-product-buybox .wd-single-add-cart table.variations > tbody > tr {
  margin-bottom: 16px;
}
body.single-product .malare-product-buybox .wd-single-add-cart table.variations > tbody > tr > th.label {
  margin-bottom: 16px;
}
body.single-product .malare-product-buybox .wd-single-add-cart table.variations > tbody > tr:last-child {
  margin-bottom: 0;
}
body.single-product .malare-product-buybox .wd-single-add-cart table.variations > tbody > tr > th.label > label {
  white-space: normal;
}

/* Native variable purchase region only: no mirrors, visibility gates or control relocation. */
body.single-product .malare-product-buybox .wd-single-add-cart form.variations_form > .single_variation_wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 24px;
  border: 0;
  border-radius: 24px;
  background: #f4f6fb;
  box-shadow: none;
  overflow: visible;
}

/* Native tab variables keep hover/active ownership; only radius and state contrast change. */
body.single-product .malare-product-tabs-row .wd-single-tabs .woocommerce-tabs > .wd-nav-tabs-wrapper .wd-nav-tabs {
  --nav-radius: 8px;
  --nav-color: #1f2933;
  --nav-color-hover: #1f2933;
  --nav-color-active: #fff;
  --nav-bg: #f3f5fa;
  --nav-bg-hover: #e9edf7;
  --nav-bg-active: #2f5bbf;
}

@media (max-width: 767px) {
  body.single-product .malare-product-buybox .wd-single-add-cart table.variations > tbody > tr {
    margin-bottom: 24px;
  }
  body.single-product .malare-product-buybox .wd-single-add-cart table.variations > tbody > tr > th.label {
    margin-bottom: 24px;
  }
  body.single-product .malare-product-buybox .wd-single-add-cart table.variations > tbody > tr:last-child {
    margin-bottom: 0;
  }
  body.single-product .malare-product-buybox .wd-single-add-cart form.variations_form > .single_variation_wrap {
    padding: 18px;
    border-radius: 18px;
  }
}

/* Retained checkout headings preserve their native sentence case. */
body.woocommerce-checkout form.malare-checkout .woocommerce-billing-fields > h3,
body.woocommerce-checkout form.malare-checkout #malare-checkout-shipping-heading,
body.woocommerce-checkout form.malare-checkout #order_review_heading {
  text-transform: none;
}
