/* Add-on lines grouped under their cake: the cart page and FunnelKit's side cart (MMG-264). Display only:
   the lines are ordinary cart items. The cart page row carries mmg-sf-addon-line / mmg-sf-addon-parent
   (woocommerce_cart_item_class); FunnelKit has no row class, so a hidden marker span is printed inside each row's
   wrapper (fkcart_before_cart_item). Plain WooCommerce cart markup only: the cart page is Bricks on one site and
   Woodmart on the others, so no theme class is used. Scoped to .woocommerce-cart-form, which the checkout
   review (it prints the same row class) does not have. Colours are the --mmg-sf-* tokens, with the MMG palette as fallback. */

/* ---- Cart page ------------------------------------------------------------------------------------------ */

.woocommerce-cart-form table tr.mmg-sf-addon-parent > td {
  border-bottom-width: 0;
}

.woocommerce-cart-form table tr.mmg-sf-addon-line > td {
  padding-top: 6px;
  padding-bottom: 6px;
  border-top-width: 0;
}

/* The set reads as one block: the last add-on keeps the row divider, the ones before it drop theirs. */
.woocommerce-cart-form table tr.mmg-sf-addon-line:has(+ tr.mmg-sf-addon-line) > td {
  border-bottom-width: 0;
}

.woocommerce-cart-form table tr.mmg-sf-addon-line td.product-thumbnail {
  padding-left: 24px;
}

.woocommerce-cart-form table tr.mmg-sf-addon-line td.product-thumbnail img {
  width: 40px;
  max-width: 40px;
  height: auto;
}

.woocommerce-cart-form table tr.mmg-sf-addon-line td.product-name {
  font-size: 0.93em;
}

/* The quantity is locked and printed as a plain number: show it as "x 2". Below 769px WooCommerce labels the cell. */
@media (min-width: 769px) {
  .woocommerce-cart-form table tr.mmg-sf-addon-line td.product-quantity::before {
    content: "\00d7\00a0";
  }
}

/* ---- Quiet remove link (cart page and side cart) ---------------------------------------------------------- */

/* WooCommerce draws the remove link as a round red button and forces its colour, so this has to out-rank it. */
html body a.mmg-sf-addon-remove[href],
#fkcart-modal a.mmg-sf-addon-remove[href] {
  display: inline;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--mmg-sf-muted, #5f574e) !important;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

html body a.mmg-sf-addon-remove[href]:hover,
html body a.mmg-sf-addon-remove[href]:focus,
#fkcart-modal a.mmg-sf-addon-remove[href]:hover,
#fkcart-modal a.mmg-sf-addon-remove[href]:focus {
  background: none !important;
  color: var(--mmg-sf-strong, #1c1a17) !important;
}

html body a.mmg-sf-addon-remove[href]:focus-visible,
#fkcart-modal a.mmg-sf-addon-remove[href]:focus-visible {
  outline: 2px solid var(--mmg-sf-accent, #6f4e37);
  outline-offset: 2px;
}

/* ---- FunnelKit side cart ----------------------------------------------------------------------------------- */

.mmg-sf-addon-mark,
.mmg-sf-addon-parent-mark {
  display: none;
}

/* An add-on row: indented under its cake, no divider above it. */
.fkcart--item-parent:has(> .mmg-sf-addon-mark) {
  margin-top: 0;
  padding-top: 0;
  padding-inline-start: 24px;
  border-top-width: 0;
}

.fkcart--item-parent:has(> .mmg-sf-addon-mark) > .fkcart--item {
  border-top-width: 0;
}

/* Any row an add-on row follows (the cake, or an earlier add-on) has no divider below it. */
.fkcart--item-parent:has(+ .fkcart--item-parent > .mmg-sf-addon-mark),
.fkcart--item-parent:has(+ .fkcart--item-parent > .mmg-sf-addon-mark) > .fkcart--item {
  margin-bottom: 0;
  border-bottom-width: 0;
}
