/* =========================
   CART (Woo Blocks) – CakeShop (clean)
   ========================= */

body.woocommerce-cart .wp-block-woocommerce-cart {
  --cs-trash-icon: url("/wp-content/uploads/trash.svg");
  --cs-fav-icon: url("/wp-content/uploads/favourite.svg");
}

.wc-block-components-product-details__name {
  display: none !important;
}

/* =========================
   Page layout (main + sidebar)
   ========================= */

body.woocommerce-cart .wc-block-components-sidebar-layout.wc-block-cart {
  display: grid !important;
  grid-template-columns: 1fr 420px !important;
  gap: 48px !important;
  width: 100% !important;
  align-items: start;
}

body.woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-main,
body.woocommerce-cart .wc-block-components-sidebar {
  width: 100% !important;
  padding: 0 !important;
  min-width: 0 !important;
}

body.woocommerce-cart .wc-block-cart__sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
}

@media (max-width: 1024px) {
  body.woocommerce-cart .wc-block-components-sidebar-layout.wc-block-cart {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  body.woocommerce-cart .wc-block-cart__sidebar {
    position: static;
    top: auto;
  }
}

/* =========================
   Headings
   ========================= */

body.woocommerce-cart h1,
body.woocommerce-cart .wc-block-cart__totals-title {
  font-size: var(--font-size-h3);
  font-family: var(--font-family-heading);
  line-height: var(--line-height-h3);
  font-weight: var(--font-weight-500);
  color: var(--main--03);
  text-transform: none;
  padding: 0 0 32px !important;
  margin: 0 !important;
}

/* Hide table header row in items list */
body.woocommerce-cart .wc-block-cart-items__header {
  display: none;
}

/* =========================
   Items list = table, rows as “cards”
   ========================= */

/* td must behave like blocks inside grid-row */
body.woocommerce-cart .wc-block-cart-items__row > td {
  display: flex !important;
  /* width: auto !important; */
  padding: 0 !important;
  border-top: 0 !important;
}

/* total cell aligned right */
body.woocommerce-cart td.wc-block-cart-item__total {
  justify-self: end;
  text-align: right;
}

/* product title */
body.woocommerce-cart .wc-block-cart-item__product a {
  font-family: var(--font-family-body);
  font-weight: var(--font-weight-500);
  font-size: var(--font-size-16);
  line-height: var(--line-height-16);
  color: var(--color-text);
  text-decoration: none;
}
body.woocommerce-cart .wc-block-cart-item__product a:hover {
  color: var(--color-primary);
}

/* metadata */
body.woocommerce-cart .wc-block-components-product-metadata {
  font-size: var(--font-size-13);
  line-height: var(--line-height-13);
  color: var(--black--06);
}

/* hide price + badges in product column (we show them in TOTAL) */
body.woocommerce-cart .wc-block-cart-item__product .wc-block-cart-item__prices,
body.woocommerce-cart .wc-block-cart-item__product .wc-block-components-product-badge {
  display: none !important;
}

/* =========================
   Quantity selector
   ========================= */

body.woocommerce-cart .wc-block-components-quantity-selector {
  border: solid 1px var(--black--03) !important;
  background: var(--white) !important;
  border-radius: var(--b--xsm) !important;
  width: 100px !important;
}
body.woocommerce-cart .wc-block-components-quantity-selector__button {
  border-radius: var(--b--xsm) !important;
}
body.woocommerce-cart .wc-block-components-quantity-selector input {
  font-family: var(--font-family-body);
  border: none !important;
}

/* =========================
   Total column styling
   ========================= */

body.woocommerce-cart .wc-block-cart-item__total-price-and-sale-badge-wrapper {
  display: flex;
  flex-direction: column;
}

/* push our actions to bottom */
body.woocommerce-cart .wc-block-cart-item__total-price-and-sale-badge-wrapper .mirrored-cart-item-actions {
  order: 999;
  margin-top: auto;
  align-self: flex-end;
  width: 24px;
  height: 24px;
}

/* =========================
   Remove (proxy button in TOTAL)
   ========================= */

/* hide original remove link in product column */
body.woocommerce-cart .wc-block-cart-items__row td.wc-block-cart-item__product .wc-block-cart-item__quantity > .wc-block-cart-item__remove-link {
  display: none !important;
}

/* proxy button look */
body.woocommerce-cart .remove-trash-proxy {
  background: transparent;
  border: 0;
  padding: 0 !important;
  cursor: pointer;
  line-height: 0;
}

body.woocommerce-cart .remove-trash-proxy::before {
  content: "";
  width: 24px;
  height: 24px;
  display: block;
  background: var(--cs-trash-icon) center/contain no-repeat;
  opacity: 0.9;
}

/* =========================
   Totals block (sidebar)
   ========================= */

body.woocommerce-cart .wc-block-components-totals-wrapper {
  border-top: 0;
  padding: 0;
}

.wc-block-cart__submit {
  margin: 0 0 32px !important;
}

.mirrored-cart-item-net {
  font-size: var(--font-size-13);
  line-height: var(--line-height-13);
  font-weight: var(--font-weight-300) !important;
}

body.woocommerce-cart .wc-block-components-totals-item__label,
body.woocommerce-cart .wc-block-components-totals-item__value,
.wc-block-components-panel__button {
  color: var(--black);
  font-size: var(--font-size-13);
  line-height: var(--line-height-13);
}

body.woocommerce-cart .wc-block-components-totals-item__label {
  font-weight: var(--font-weight-300) !important;
}

.wp-block-woocommerce-cart-order-summary-totals-block strong {
  font-weight: var(--font-weight-300) !important;
}

.wc-block-components-totals-coupon {
  padding: 0 !important;
}

.wc-block-components-totals-coupon__form {
  display: flex;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin-bottom: 0;
  width: 100%;
}

.total-discount-prices__regular,
.mirrored-cart-item-gross {
  color: var(--black--05);
  font-size: var(--font-size-13);
  font-weight: var(--font-weight-300);
}

.wc-block-components-product-price {
  font-family: var(--font-family-body-basic);
  font-size: var(--font-size-16);
  line-height: var(--line-height-16);
  color: var(--main--03);
}

.total-discount-prices__row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.wc-block-components-product-metadata__description {
  display: none !important;
}

/* product image */
body.woocommerce-cart .wc-block-cart-item__image img {
  width: 144px !important;
  height: 144px !important;
  border-radius: var(--b--sm);
  object-fit: contain;
}

/* row card */
body.woocommerce-cart .wc-block-cart-items__row {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr) 200px;
  gap: 32px;
  width: 100% !important;
  padding: 16px;
  border-bottom: 1px solid var(--black--03);
}

.wc-block-cart-item__product,
.wc-block-cart-item__total {
  margin: 8px 0px !important;
}

.wp-block-woocommerce-cart-order-summary-totals-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px !important;
}

.wp-block-woocommerce-cart-order-summary-totals-block,
.wc-block-cart__main,
.wc-block-cart-items,
.wc-block-cart .wp-block-woocommerce-cart-order-summary-block {
  border: none !important;
}

.wc-block-cart .wp-block-woocommerce-cart-order-summary-block {
  font-size: var(--wp--preset--font-size--small, 14px);
  line-height: 20px;
  margin-bottom: 32px !important;
}

/* =========================
   MOBILE
   ========================= */
@media (max-width: 768px) {
  .wc-block-cart-items__row {
    display: flex !important;
    flex-direction: row !important;
    column-gap: 16px !important;
    row-gap: 8px !important;
    flex-wrap: wrap !important;
  }
  .wc-block-cart-item__product {
    width: max-content;
    max-width: calc(100vw - 180px);
  }
  .wc-block-cart-item__quantity {
    width: stretch !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
  }

  .cs-cart-heart {
    display: none;
  }

  .mirrored-cart-item-net {
    display: none;
  }

  .wc-block-components-quantity-selector {
    position: absolute !important;
    left: 0;
    transform: translateY(40px);
  }

  .wc-block-cart-item__total {
    width: inherit;
  }

  .wc-block-cart-item__total-price-and-sale-badge-wrapper {
    display: flex !important;
    flex-direction: row-reverse !important;
    justify-content: space-between;
    width: stretch;
    margin-bottom: 16px;
    max-width: calc(100% - 110px);
    margin-top: 4px;
  }
  body.woocommerce-cart .wc-block-cart-item__image img {
    width: 100px !important;
    height: 100px !important;
  }
}
