/******************************************************************
  CART PAGE — stable table layout, metadata visible and on top,
  product bordered, no absolute positioning, no layout breaking
******************************************************************/

/* ---------- Ensure rules only affect the Cart page ---------- */
body.woocommerce-cart {

  /* make sure table/layout remains table-based (do not override) */
}

body.wp-block-woocommerce-cart{margin: 50px 0 0 0 !important;}

body.woocommerce-cart table caption + thead tr:first-child th{
  border: none !important;
}

body.wc-block-components-sidebar-layout, .wp-block-woocommerce-cart.alignwide{margin-bottom: 0 !important;}



body.woocommerce-cart .is-large.wc-block-cart .wc-block-cart-items th{
  padding: 0 10px 10px 10px !important;
}

body.woocommerce-cart .is-large.wc-block-cart .wc-block-cart-items .wc-block-cart-items__header-image{
  text-align: left !important;
}

/* ---------- Product border (wraps entire row) ---------- */
/* We apply border to the row container but make sure it does not break table flow */
body.woocommerce-cart .wc-block-cart-items__row {
  display: table-row; /* keep native table row behavior */
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 14px;
  /* use a small inner padding via cell padding below (do not apply padding on tr) */
}

/* apply padding inside each cell so content is spaced */
body.woocommerce-cart .wc-block-cart-items__row > td {
  padding: 14px;
  vertical-align: top;
  box-sizing: border-box;
}

body.woocommerce-cart .mk-status-row .mk-status-cell{padding:0 !important;}


/* ---------- Image column: fixed width and left aligned ---------- */
body.woocommerce-cart .wc-block-cart-item__image {
  width: 120px; /* adjust as needed */
  max-width: 120px;
  box-sizing: border-box;
}

/* enforce image size */
body.woocommerce-cart .wc-block-cart-item__image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* ---------- Total column: keep fixed width and right aligned ---------- */
body.woocommerce-cart .wc-block-cart-item__total {
  width: 160px; /* adjust if needed */
  max-width: 160px;
  text-align: right;
  box-sizing: border-box;
}

/* ---------- Product details column: make wrap a column so we can reorder children ---------- */
body.woocommerce-cart .wc-block-cart-item__product .wc-block-cart-item__wrap {
  display: flex !important;
  flex-direction: row;
  gap: 8px;
  flex-wrap: wrap;
}

body.woocommerce-cart .wc-block-cart-item__product{
  width: 57%;
}


/* ---------- METADATA / STATUS: Put it first inside the product wrap ---------- */
/* Make sure metadata is visible and sits above the title/prices/quantity */
body.woocommerce-cart .wc-block-components-product-metadata {
  order: -1;
  display: block !important;        /* ensure it is not hidden by earlier styles */
  padding: 10px;
  font-weight: 600;
  font-size: 0.98rem;
  color: #222;
  background: transparent;
  margin-top: 10px;
  border: 1px solid #e0e0e0;
}

/*
Status line (stock / location / made-to-order).
Woo Blocks markup changes frequently; the safest approach is to ensure the FIRST
`.wc-block-components-product-details` block is visible and bold, regardless of
whether it uses div/ul/span wrappers.
*/
body.woocommerce-cart
  .wc-block-components-product-metadata
  .wc-block-components-product-details:first-of-type {
  display: block !important;
  font-weight: 600;
}

/* ---------- Hide everything in product-details except the first "status" line ---------- */
/* Works for both div-based and ul/li-based renderings */
body.woocommerce-cart .wc-block-components-product-metadata .wc-block-components-product-details > div:not(:first-child),
body.woocommerce-cart .wc-block-components-product-metadata .wc-block-components-product-details > ul > li:not(:first-child) {
  display: none !important;
}

/*
Do NOT hide additional `.wc-block-components-product-details` blocks globally.
Some products render stock/location in a later block; hiding siblings can result
in an empty metadata box.
*/

/* Hide only the extra attribute chips (Range / Top Type / etc.) */
body.woocommerce-cart .wc-block-components-product-metadata .wc-block-components-product-details__range,
body.woocommerce-cart .wc-block-components-product-metadata .wc-block-components-product-details__top-type,
body.woocommerce-cart .wc-block-components-product-metadata .wc-block-components-product-details__top-stains,
body.woocommerce-cart .wc-block-components-product-metadata .wc-block-components-product-details__colour,
body.woocommerce-cart .wc-block-components-product-metadata .wc-block-components-product-details__handles,
body.woocommerce-cart .wc-block-components-product-metadata .wc-block-components-product-details__base-construction {
  display: none !important;
}

/* (Removed) structure-based hiding rules – they can hide valid stock/location lines */


/* Also ensure short description block is hidden (you asked earlier to hide descriptions) */
body.woocommerce-cart .wc-block-components-product-metadata__description {
  display: none !important;
}

/* ---------- Product title, prices, save badge ---------- */
body.woocommerce-cart .wc-block-components-product-name {
  margin: 0;
  flex-grow: 1;
  flex-basis: 100%;
  max-width: 100% !important;
}

body.woocommerce-cart .wc-block-components-formatted-money-amount{font-weight: bold;}

body.woocommerce-cart .wc-block-components-product-metadata ul{display:none !important;}


/* Price area inline with save badge */
body.woocommerce-cart .wc-block-cart-item__prices {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

body.woocommerce-cart .wc-block-cart-item__prices.mk-price-hidden {
  display: none !important;
}

/* Keep sale/save badge beside price */
body.woocommerce-cart .wc-block-components-sale-badge {
  margin: 0;
}

/* ---------- Quantity + Remove: align on same row and to the right of details column ---------- */
body.woocommerce-cart .wc-block-cart-item__quantity {
  display: flex !important;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
  flex-basis: 100%;
  max-width: 100% !important;
}

body.woocommerce-cart .wc-block-components-quantity-selector{
    margin-bottom: 0 !important;
}

/* Style remove link as a button */
body.woocommerce-cart .wc-block-cart-item__remove-link {
  display: inline-block;
  border: 1px solid #ccc;
  padding: 6px 12px;
  border-radius: 6px;
  background: #fff;
  color: #333;
  text-decoration: none;
}

/* body.woocommerce-cart .wc-block-cart-item__remove-link::before {
    content: '×';
} */

/* ---------- Small screens: stack nicely ---------- */
@media (max-width: 780px) {
  /* Keep cells full width on small screens; table layout will adapt */
  body.woocommerce-cart .wc-block-cart-item__image {
    width: 80px;
    max-width: 80px;
  }
  body.woocommerce-cart .wc-block-cart-item__total {
    width: auto;
    text-align: left;
    margin-top: 8px;
  }

  /* metadata smaller */
  body.woocommerce-cart .wc-block-components-product-metadata {
    font-size: 0.95rem;
    padding-bottom: 8px;
  }

  /* quantity group left-aligned on mobile */
  body.woocommerce-cart .wc-block-cart-item__quantity {
    justify-content: flex-start;
  }

}
