/* WS Food Ordering: the cart ("Bag") page, in the Snappy Bite blueprint's design. Scoped to body.wsfo-cart. */
body.wsfo-cart {
	--wsfo-accent: #9B1111; --b-soft: color-mix(in srgb, var(--wsfo-accent) 13%, #fff);
	--b-ink: #1D1A17; --b-muted: #6B635A; --b-line: #ECDCC6; --b-sunk: #F7EDDF; --b-cream: #FFF8EE; --b-leaf: #1E7A4C;
	--b-display: "Bricolage Grotesque", Montserrat, system-ui, sans-serif;
	--b-body: Montserrat, -apple-system, "Segoe UI", system-ui, sans-serif;
}
body.wsfo-cart .woocommerce { font-family: var(--b-body); color: var(--b-ink); }
body.wsfo-cart .woocommerce h2 { font-family: var(--b-display); color: var(--b-ink); text-transform: none; letter-spacing: -.01em; }

/* two columns: bag on the left, sticky summary on the right */
@media (min-width: 992px) {
	body.wsfo-cart .cart-content-wrapper { display: grid !important; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
	body.wsfo-cart .cart-content-wrapper > .woocommerce-notices-wrapper { grid-column: 1 / -1; }
	body.wsfo-cart .cart-content-wrapper > form.woocommerce-cart-form { grid-column: 1; width: auto !important; max-width: none !important; float: none !important; }
	body.wsfo-cart .cart-content-wrapper > .cart_totals { grid-column: 2; position: sticky !important; top: 24px; width: auto !important; max-width: none !important; float: none !important; }
	body.admin-bar.wsfo-cart .cart-content-wrapper > .cart_totals { top: 56px; }
}

/* bag card */
body.wsfo-cart form.woocommerce-cart-form { background: #fff; border: 1px solid var(--b-line); border-radius: 18px; padding: 20px; }
.wsfo-bag-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.wsfo-bag-head h2 { margin: 0 !important; font-size: 26px !important; font-weight: 800 !important; }
.wsfo-bag-head p { margin: 2px 0 0; color: var(--b-muted); font-size: 14px; }
.wsfo-bag-head a { color: var(--wsfo-accent) !important; font-weight: 700; font-size: 14.5px; text-decoration: none !important; white-space: nowrap; }

/* dish rows */
body.wsfo-cart table.shop_table.cart { border: 0 !important; margin: 0; border-collapse: collapse; width: 100%; background: none; }
body.wsfo-cart table.shop_table.cart thead { display: none; }
body.wsfo-cart table.shop_table.cart tbody { display: block; }
body.wsfo-cart table.shop_table.cart tr.cart_item {
	display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto 34px; grid-template-areas: "img name qty sub rm";
	align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--b-line);
}
body.wsfo-cart table.shop_table.cart tr.cart_item td { display: block; border: 0 !important; padding: 0 !important; background: none !important; text-align: left; }
body.wsfo-cart table.shop_table.cart tr.cart_item td::before { display: none !important; }
body.wsfo-cart td.product-thumbnail { grid-area: img; }
body.wsfo-cart td.product-thumbnail img { width: 72px !important; height: 72px !important; object-fit: cover; border-radius: 14px; display: block; max-width: none; }
body.wsfo-cart td.product-name { grid-area: name; min-width: 0; }
body.wsfo-cart td.product-name a { color: var(--b-ink) !important; font-weight: 700; font-size: 16px; text-decoration: none !important; }
body.wsfo-cart td.product-name dl.variation, body.wsfo-cart td.product-name .wc-item-meta { margin: 4px 0 0; color: var(--b-muted); font-size: 12.5px; }
body.wsfo-cart td.product-name dl.variation dt, body.wsfo-cart td.product-name dl.variation dd { display: inline; margin: 0; float: none; }
body.wsfo-cart td.product-name dl.variation dd p { display: inline; margin: 0; }
body.wsfo-cart td.product-price { display: none !important; }
body.wsfo-cart td.product-quantity { grid-area: qty; }
body.wsfo-cart td.product-subtotal { grid-area: sub; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; min-width: 90px; }
body.wsfo-cart td.product-subtotal .amount, body.wsfo-cart td.product-subtotal .woocommerce-Price-amount { color: var(--b-ink) !important; }
body.wsfo-cart td.product-remove { grid-area: rm; }
body.wsfo-cart td.product-remove a.remove {
	width: 32px !important; height: 32px !important; border-radius: 50% !important; display: grid !important; place-items: center; font-size: 18px !important;
	background: var(--b-sunk) !important; color: var(--b-muted) !important; border: 0 !important; line-height: 1 !important;
}
body.wsfo-cart td.product-remove a.remove:hover { background: var(--b-soft) !important; color: var(--wsfo-accent) !important; }

/* quantity stepper, like the menu's */
body.wsfo-cart .quantity { display: inline-flex !important; align-items: center; gap: 2px; border: 1px solid var(--b-line); border-radius: 12px; padding: 3px; background: #fff; }
body.wsfo-cart .quantity .btn, body.wsfo-cart .quantity button {
	width: 32px !important; height: 32px !important; min-height: 0 !important; border: 0 !important; border-radius: 9px !important; padding: 0 !important;
	background: transparent !important; color: var(--b-ink) !important; font-size: 18px !important; font-weight: 700; box-shadow: none !important;
}
body.wsfo-cart .quantity .btn:hover { background: var(--b-sunk) !important; }
body.wsfo-cart .quantity input.qty { width: 34px !important; height: 32px !important; min-height: 0 !important; border: 0 !important; padding: 0 !important; background: transparent !important; text-align: center; font: 800 15px var(--b-body) !important; color: var(--b-ink); -moz-appearance: textfield; }
body.wsfo-cart .quantity input.qty::-webkit-inner-spin-button, body.wsfo-cart .quantity input.qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* coupon + update row */
body.wsfo-cart table.shop_table.cart tr:not(.cart_item) { display: block; }
body.wsfo-cart table.shop_table.cart td.actions { display: block; border: 0 !important; padding: 16px 0 0 !important; background: none !important; }
body.wsfo-cart .cart-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
body.wsfo-cart .cart-actions .coupon { display: flex; gap: 8px; flex: 1 1 280px; margin: 0; }
body.wsfo-cart .cart-actions .coupon input.input-text {
	flex: 1; min-width: 0; min-height: 46px !important; border: 1.5px solid transparent !important; border-radius: 10px !important; background: var(--b-sunk) !important;
	padding: 0 14px !important; font: 600 15px var(--b-body) !important; text-transform: uppercase; letter-spacing: .04em; color: var(--b-ink); box-shadow: none !important;
}
body.wsfo-cart .cart-actions .coupon input.input-text::placeholder { text-transform: none; letter-spacing: normal; font-weight: 500; color: var(--b-muted); }
body.wsfo-cart .cart-actions .coupon input.input-text:focus { outline: none; border-color: var(--wsfo-accent) !important; background: #fff !important; }
body.wsfo-cart .cart-actions .button {
	min-height: 46px; padding: 0 18px !important; border: 0 !important; border-radius: 10px !important; box-shadow: none !important;
	font: 700 14.5px var(--b-body) !important; text-transform: none !important; letter-spacing: normal !important;
}
body.wsfo-cart .cart-actions .coupon .button { background: var(--b-ink) !important; color: #fff !important; }
body.wsfo-cart .cart-actions button[name="update_cart"] { background: transparent !important; color: var(--b-muted) !important; text-decoration: underline; text-underline-offset: 3px; padding: 0 4px !important; }
body.wsfo-cart .cart-actions button[name="update_cart"]:disabled { opacity: .45; text-decoration: none; }

/* order summary card */
body.wsfo-cart .cart_totals { background: #fff; border: 1px solid var(--b-line) !important; border-radius: 18px; padding: 20px !important; box-shadow: none !important; }
/* WoodMart nests a bordered, padded box inside; flatten it so there's one card. */
body.wsfo-cart .cart_totals .cart-totals-inner { border: 0 !important; padding: 0 !important; background: none !important; box-shadow: none !important; }
body.wsfo-cart .cart_totals h2 { font-size: 20px !important; font-weight: 700 !important; margin: 0 0 10px !important; text-transform: none !important; letter-spacing: -.01em !important; }
body.wsfo-cart .cart_totals table.shop_table { border: 0 !important; margin: 0 0 6px; background: none; font-variant-numeric: tabular-nums; font-size: 14.5px; }
body.wsfo-cart .cart_totals table th, body.wsfo-cart .cart_totals table td { border: 0 !important; padding: 7px 0 !important; background: none !important; font-weight: 500; color: var(--b-ink); text-transform: none; letter-spacing: normal; }
body.wsfo-cart .cart_totals table td { text-align: right; }
body.wsfo-cart .cart_totals table td::before { display: none !important; }
body.wsfo-cart .cart_totals .amount, body.wsfo-cart .cart_totals .woocommerce-Price-amount { color: var(--b-ink) !important; }
body.wsfo-cart .cart_totals tr.cart-discount .amount { color: var(--b-leaf) !important; }
body.wsfo-cart .cart_totals tr.order-total th, body.wsfo-cart .cart_totals tr.order-total td { border-top: 1px dashed var(--b-line) !important; padding-top: 12px !important; font-size: 19px; font-weight: 800; }
body.wsfo-cart .cart_totals tr.order-total .amount { font-size: 20px; }
body.wsfo-cart .wc-proceed-to-checkout { padding: 8px 0 0 !important; }
body.wsfo-cart .wc-proceed-to-checkout a.checkout-button {
	display: flex !important; align-items: center; justify-content: center; width: 100%; min-height: 54px; margin: 0 !important; border: 0 !important; border-radius: 14px !important;
	background: var(--wsfo-accent) !important; color: #fff !important; font: 700 16.5px var(--b-body) !important; text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important;
}
body.wsfo-cart .wc-proceed-to-checkout a.checkout-button:hover { filter: brightness(1.06); }
.wsfo-bag-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--b-cream); color: var(--b-muted); font-size: 13px; }

/* notices */
body.wsfo-cart .woocommerce-message, body.wsfo-cart .woocommerce-info, body.wsfo-cart .woocommerce-error { border-radius: 14px; border: 0; font-family: var(--b-body); }
body.wsfo-cart .woocommerce-message { background: #DDF0E5; color: var(--b-leaf); }
body.wsfo-cart .woocommerce-error { background: #FEF3F2; color: #912018; }

/* phones */
@media (max-width: 991px) {
	body.wsfo-cart .cart_totals { margin-top: 16px; }
}
@media (max-width: 600px) {
	body.wsfo-cart form.woocommerce-cart-form { padding: 16px; }
	body.wsfo-cart table.shop_table.cart tr.cart_item {
		grid-template-columns: 64px minmax(0, 1fr) 32px; grid-template-areas: "img name rm" "img qty sub"; row-gap: 10px;
	}
	body.wsfo-cart td.product-thumbnail img { width: 64px !important; height: 64px !important; }
	body.wsfo-cart td.product-subtotal { min-width: 0; }
	body.wsfo-cart .cart-actions .coupon { flex-basis: 100%; }
}

/* ---------- 2.9: mobile fixes against WoodMart's own phone layout, and a real "Update bag" button ---------- */
/* WoodMart pins the photo and remove button with position:absolute on phones; keep them in our grid. */
body.wsfo-cart table.shop_table.cart tr.cart_item td.product-thumbnail,
body.wsfo-cart table.shop_table.cart tr.cart_item td.product-remove { position: static !important; width: auto !important; min-width: 0 !important; height: auto !important; margin: 0 !important; }
body.wsfo-cart table.shop_table.cart tr.cart_item td.product-thumbnail img { width: 72px !important; height: 72px !important; min-width: 0 !important; max-width: none !important; object-fit: cover; border-radius: 14px; }
body.wsfo-cart table.shop_table.cart tr.cart_item td.product-name { padding: 0 !important; min-width: 0 !important; }
/* One clean × (WoodMart adds an icon on top of the text). */
body.wsfo-cart td.product-remove a.remove { font-size: 0 !important; }
body.wsfo-cart td.product-remove a.remove::before { display: none !important; }
body.wsfo-cart td.product-remove a.remove::after { content: "×"; font-size: 19px; line-height: 1; font-weight: 500; }

/* "Update bag": an outlined button, disabled-looking until a quantity changes. */
body.wsfo-cart .cart-actions button[name="update_cart"] {
	min-height: 46px; padding: 0 20px !important; border-radius: 10px !important; border: 1.5px solid var(--b-ink) !important;
	background: #fff !important; color: var(--b-ink) !important; text-decoration: none !important; font: 700 14.5px var(--b-body) !important;
	text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important; cursor: pointer;
}
body.wsfo-cart .cart-actions button[name="update_cart"]:hover:not(:disabled) { background: var(--b-ink) !important; color: #fff !important; }
body.wsfo-cart .cart-actions button[name="update_cart"]:disabled { opacity: 1; border-color: var(--b-line) !important; color: var(--b-muted) !important; cursor: default; }

/* WoodMart frames the coupon in a dashed box on phones. */
body.wsfo-cart .cart-actions .coupon.wd-coupon-form { border: 0 !important; padding: 0 !important; background: none !important; margin: 0 !important; }

@media (max-width: 767px) {
	body.wsfo-cart form.woocommerce-cart-form { padding: 16px !important; }
	body.wsfo-cart .wsfo-bag-head { flex-wrap: wrap; align-items: baseline; }
	body.wsfo-cart table.shop_table.cart tr.cart_item {
		grid-template-columns: 64px minmax(0, 1fr) auto !important; grid-template-areas: "img name rm" "img qty sub" !important;
		column-gap: 12px; row-gap: 10px; padding: 14px 0 !important;
	}
	body.wsfo-cart table.shop_table.cart tr.cart_item td.product-thumbnail img { width: 64px !important; height: 64px !important; }
	body.wsfo-cart table.shop_table.cart tr.cart_item td.product-name a { font-size: 15px; white-space: normal; }
	body.wsfo-cart table.shop_table.cart tr.cart_item td.product-remove { justify-self: end; }
	body.wsfo-cart table.shop_table.cart tr.cart_item td.product-quantity { justify-self: start; }
	body.wsfo-cart table.shop_table.cart tr.cart_item td.product-subtotal { justify-self: end; min-width: 0 !important; width: auto !important; white-space: nowrap; }
	body.wsfo-cart .cart-actions { flex-direction: column; align-items: stretch; }
	body.wsfo-cart .cart-actions .coupon { flex: 1 1 auto; width: 100%; }
	body.wsfo-cart .cart-actions .coupon .button { flex: 0 0 auto; }
	body.wsfo-cart .cart-actions button[name="update_cart"] { width: 100%; }
}

/* Order summary rows keep their labels on phones (WooCommerce hides the th there and redraws it with ::before). */
body.wsfo-cart .cart_totals table tr { display: flex !important; flex-direction: row !important; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 !important; border: 0 !important; }
body.wsfo-cart .cart_totals table th { display: block !important; text-align: left; flex: 1 1 auto; }
body.wsfo-cart .cart_totals table td { display: block !important; width: auto !important; flex: 0 0 auto; }
