/* ==========================================================================
   Frosted Bloom — Cart page (glass redesign)
   Scoped to  body.gfd-cart-frosted  so it only affects the cart page.
   Re-skins the existing WooCommerce / Mikado cart markup — no template edits.
   ========================================================================== */

body.gfd-cart-frosted {
	--gfd-pink: #d6447a;
	--gfd-pink-dark: #c43a6c;
	--gfd-ink: #2e2e3a;
	--gfd-ink-soft: #5a5a6a;
	--gfd-glass: rgba(255, 255, 255, 0.55);
	--gfd-glass-strong: rgba(255, 255, 255, 0.82);
	--gfd-glass-border: rgba(255, 255, 255, 0.85);
	--gfd-line: rgba(214, 68, 122, 0.14);
	--gfd-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
	--gfd-radius: 22px;

	background:
		radial-gradient(1100px 520px at 12% -8%, #ffe6f0 0%, rgba(255, 230, 240, 0) 60%),
		radial-gradient(900px 500px at 100% 0%, #fdeafe 0%, rgba(253, 234, 254, 0) 55%),
		#fff6fa;
}

/* Kill the theme's boxed frame / content backgrounds so the glass shows. */
body.gfd-cart-frosted .mkdf-content-inner,
body.gfd-cart-frosted .mkdf-container-inner,
body.gfd-cart-frosted .mkdf-full-width-inner { background: transparent !important; }
body.gfd-cart-frosted.mkdf-boxed .mkdf-wrapper-inner,
body.gfd-cart-frosted .mkdf-content { background: transparent !important; box-shadow: none !important; }
body.gfd-cart-frosted .mkdf-container-inner.clearfix { padding-top: 22px; padding-bottom: 40px; }

/* Constrain + centre the cart within a comfortable measure. */
body.gfd-cart-frosted .woocommerce {
	max-width: 860px;
	margin: 0 auto;
}

/* Page heading. */
body.gfd-cart-frosted .woocommerce::before {
	content: "Your Cart";
	display: block;
	font-family: inherit;
	font-size: 30px;
	font-weight: 800;
	letter-spacing: -0.4px;
	color: var(--gfd-ink);
	margin: 4px 0 20px;
}

/* --------------------------------------------------------------------------
   Layout: single-column stacked sections
   1) Delivery date & slot  2) Apply coupon  3) Cart table  4) Cart Summary
   -------------------------------------------------------------------------- */
body.gfd-cart-frosted .gfd-cart-stack {
	max-width: 920px;
	margin: 0 auto;
}

body.gfd-cart-frosted .woocommerce-cart-form { width: 100%; float: none; margin: 0; }
body.gfd-cart-frosted .cart-collaterals { width: 100%; float: none; margin: 22px 0 0; }

/* Row 1 — delivery card + coupon card side by side (wrap to stack under 640px).
   Wrapped in .gfd-cart-top-row (a plain div) so the flex layout doesn't fight
   the theme's form styling. */
body.gfd-cart-frosted .gfd-cart-top-row {
	display: flex;
	align-items: stretch;
	gap: 22px;
	margin: 0 0 22px;
}
/* flex:1 1 0 + min-width:0 = a clean 50/50 split with no percentage+gap
   rounding (which was tipping the coupon card onto its own row). */
body.gfd-cart-frosted .gfd-cart-top-row > .gfd-cart-delivery-wrapper,
body.gfd-cart-frosted .gfd-cart-top-row > .gfd-cart-coupon-section {
	flex: 1 1 0;
	width: auto !important;
	min-width: 0 !important;
	margin: 0 !important;
}
/* Stack the two cards only on small screens. */
@media (max-width: 640px) {
	body.gfd-cart-frosted .gfd-cart-top-row { flex-wrap: wrap; }
	body.gfd-cart-frosted .gfd-cart-top-row > .gfd-cart-delivery-wrapper,
	body.gfd-cart-frosted .gfd-cart-top-row > .gfd-cart-coupon-section { flex: 1 1 100%; }
}
/* Cart table — full width beneath. */
body.gfd-cart-frosted .gfd-cart-table-section { margin: 0 0 22px; }

/* Coupon + summary section titles. */
body.gfd-cart-frosted .gfd-cart-section-title,
body.gfd-cart-frosted .cart_totals h2 {
	font-size: 18px;
	font-weight: 800;
	color: var(--gfd-ink);
	margin: 0 0 14px;
	letter-spacing: -0.2px;
}

/* Section 2 — Apply coupon card. */
body.gfd-cart-frosted .gfd-cart-coupon-section {
	background: var(--gfd-glass-strong);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border: 1px solid var(--gfd-glass-border);
	border-radius: var(--gfd-radius);
	box-shadow: var(--gfd-shadow);
	padding: 20px 22px;
}
body.gfd-cart-frosted .gfd-cart-coupon-section .coupon {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}
body.gfd-cart-frosted .gfd-cart-coupon-section input#coupon_code {
	flex: 1 1 220px;
	min-width: 160px;
	background: #fff;
	border: 1px solid var(--gfd-glass-border);
	border-radius: 12px;
	padding: 12px 14px;
	color: var(--gfd-ink);
}

/* --------------------------------------------------------------------------
   Cart items table -> glass card
   -------------------------------------------------------------------------- */
body.gfd-cart-frosted .woocommerce-cart-form > .shop_table,
body.gfd-cart-frosted table.cart {
	background: var(--gfd-glass-strong) !important;
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border: 1px solid var(--gfd-glass-border);
	border-radius: var(--gfd-radius);
	box-shadow: var(--gfd-shadow);
	border-collapse: separate !important;
	border-spacing: 0;
	overflow: hidden;
	margin-bottom: 0;
}
body.gfd-cart-frosted table.cart thead th {
	background: transparent !important;
	color: var(--gfd-ink-soft);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 16px 18px;
	border: 0;
	border-bottom: 1px solid var(--gfd-line);
}
body.gfd-cart-frosted table.cart td {
	background: transparent !important;
	padding: 18px !important;
	border: 0 !important;
	border-bottom: 1px solid var(--gfd-line) !important;
	vertical-align: middle;
	color: var(--gfd-ink);
}
body.gfd-cart-frosted table.cart tr:last-child td { border-bottom: 0 !important; }

/* Column widths: numeric/quantity columns shrink to their content (width:1% +
   nowrap) so the product-name column (width:auto) absorbs the rest. This is
   robust in the theme's auto table layout — no table-layout:fixed needed. */
body.gfd-cart-frosted table.cart { width: 100%; }
body.gfd-cart-frosted table.cart th.product-remove,
body.gfd-cart-frosted table.cart td.product-remove { width: 1%; white-space: nowrap; }
body.gfd-cart-frosted table.cart th.product-thumbnail,
body.gfd-cart-frosted table.cart td.product-thumbnail { width: 90px; }
body.gfd-cart-frosted table.cart th.product-name,
body.gfd-cart-frosted table.cart td.product-name {
	width: auto;
	white-space: normal;
	overflow-wrap: anywhere;
}
body.gfd-cart-frosted table.cart th.product-price,
body.gfd-cart-frosted table.cart td.product-price,
body.gfd-cart-frosted table.cart th.product-subtotal,
body.gfd-cart-frosted table.cart td.product-subtotal { width: 1%; white-space: nowrap; text-align: center; }
body.gfd-cart-frosted table.cart th.product-quantity,
body.gfd-cart-frosted table.cart td.product-quantity { width: 1%; white-space: nowrap; text-align: center; }

/* Compact the Mikado quantity widget so it fits its column (was overflowing
   into Subtotal). Hide the redundant "Quantity" label (the column header and
   data-title already say it), shrink the input, inline the +/- arrows. */
body.gfd-cart-frosted td.product-quantity .mkdf-quantity-buttons.quantity {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: auto !important;
	max-width: 100%;
	margin: 0 auto;
}
body.gfd-cart-frosted td.product-quantity .mkdf-quantity-label { display: none !important; }
body.gfd-cart-frosted td.product-quantity input.mkdf-quantity-input,
body.gfd-cart-frosted td.product-quantity input.qty {
	width: 46px !important;
	min-width: 0 !important;
	text-align: center;
	padding: 8px 4px !important;
	background: #fff;
	border: 1px solid var(--gfd-glass-border);
	border-radius: 10px;
}
body.gfd-cart-frosted td.product-quantity .mkdf-quantity-minus,
body.gfd-cart-frosted td.product-quantity .mkdf-quantity-plus {
	position: static !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin: 0 !important;
	padding: 0 !important;
	transform: none !important;
	cursor: pointer;
	color: var(--gfd-pink);
}

/* Product thumbnail. */
body.gfd-cart-frosted td.product-thumbnail img {
	width: 74px;
	height: 74px;
	object-fit: cover;
	border-radius: 14px;
	border: 1px solid var(--gfd-glass-border);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
body.gfd-cart-frosted td.product-name a {
	color: var(--gfd-ink);
	font-weight: 600;
	text-decoration: none;
}
body.gfd-cart-frosted td.product-name a:hover { color: var(--gfd-pink); }
body.gfd-cart-frosted .product-price,
body.gfd-cart-frosted .product-subtotal { color: var(--gfd-ink); font-weight: 600; }

/* Remove ("x") button -> soft pink chip. */
body.gfd-cart-frosted td.product-remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	color: var(--gfd-pink) !important;
	background: rgba(214, 68, 122, 0.10) !important;
	font-size: 18px;
	line-height: 1;
}
body.gfd-cart-frosted td.product-remove a.remove:hover {
	color: #fff !important;
	background: var(--gfd-pink) !important;
}

/* Quantity stepper. */
body.gfd-cart-frosted .quantity input.qty {
	background: #fff;
	border: 1px solid var(--gfd-glass-border);
	border-radius: 12px;
	padding: 8px 6px;
	color: var(--gfd-ink);
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Coupon + update row (lives inside the last table row / .actions). */
body.gfd-cart-frosted td.actions {
	padding: 16px 18px !important;
	background: transparent !important;
}
body.gfd-cart-frosted .coupon input#coupon_code {
	background: #fff;
	border: 1px solid var(--gfd-glass-border);
	border-radius: 12px;
	padding: 12px 14px;
	color: var(--gfd-ink);
	min-width: 200px;
}

/* --------------------------------------------------------------------------
   Cart totals -> glass card
   -------------------------------------------------------------------------- */
body.gfd-cart-frosted .cart_totals {
	background: var(--gfd-glass-strong) !important;
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border: 1px solid var(--gfd-glass-border);
	border-radius: var(--gfd-radius);
	box-shadow: var(--gfd-shadow);
	padding: 22px 24px;
}
body.gfd-cart-frosted .cart_totals h2 {
	font-size: 20px;
	font-weight: 800;
	color: var(--gfd-ink);
	margin: 0 0 14px;
}
body.gfd-cart-frosted .cart_totals table.shop_table {
	background: transparent !important;
	border: 0 !important;
	margin: 0;
}
body.gfd-cart-frosted .cart_totals table.shop_table th,
body.gfd-cart-frosted .cart_totals table.shop_table td {
	background: transparent !important;
	border: 0 !important;
	border-bottom: 1px solid var(--gfd-line) !important;
	padding: 13px 0 !important;
	color: var(--gfd-ink);
}
body.gfd-cart-frosted .cart_totals tr.order-total th,
body.gfd-cart-frosted .cart_totals tr.order-total td {
	border-bottom: 0 !important;
	font-size: 18px;
	font-weight: 800;
}
body.gfd-cart-frosted .cart_totals tr.order-total .amount { color: var(--gfd-pink); }

/* --------------------------------------------------------------------------
   Buttons -> pink gradient (checkout) / glass outline (update, continue)
   -------------------------------------------------------------------------- */
body.gfd-cart-frosted .wc-proceed-to-checkout { padding-top: 18px; }
body.gfd-cart-frosted .button,
body.gfd-cart-frosted button.button,
body.gfd-cart-frosted input.button,
body.gfd-cart-frosted a.button {
	border-radius: 999px !important;
	font-weight: 700 !important;
	letter-spacing: 0.2px;
	padding: 13px 26px !important;
	border: 1.5px solid var(--gfd-pink) !important;
	background: #fff !important;
	color: var(--gfd-pink) !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
body.gfd-cart-frosted .button:hover,
body.gfd-cart-frosted button.button:hover,
body.gfd-cart-frosted a.button:hover {
	transform: translateY(-1px);
	background: var(--gfd-pink) !important;
	color: #fff !important;
	box-shadow: 0 8px 20px rgba(214, 68, 122, 0.18) !important;
}
/* Primary calls-to-action: checkout + apply coupon. */
body.gfd-cart-frosted .checkout-button,
body.gfd-cart-frosted .wc-proceed-to-checkout .button,
body.gfd-cart-frosted button[name="apply_coupon"] {
	background: linear-gradient(135deg, var(--gfd-pink), var(--gfd-pink-dark)) !important;
	color: #fff !important;
	border-color: transparent !important;
}
body.gfd-cart-frosted .checkout-button {
	display: block;
	width: 100%;
	text-align: center;
	font-size: 16px !important;
	padding: 15px 26px !important;
}

/* --------------------------------------------------------------------------
   Empty-cart state
   -------------------------------------------------------------------------- */
body.gfd-cart-frosted .cart-empty.woocommerce-info,
body.gfd-cart-frosted .woocommerce-info,
body.gfd-cart-frosted .woocommerce-error,
body.gfd-cart-frosted .woocommerce-message {
	background: var(--gfd-glass-strong) !important;
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border: 1px solid var(--gfd-glass-border) !important;
	border-top: 3px solid var(--gfd-pink) !important;
	border-radius: 16px !important;
	box-shadow: var(--gfd-shadow);
	color: var(--gfd-ink) !important;
	padding: 20px 22px !important;
}
body.gfd-cart-frosted .woocommerce-info::before,
body.gfd-cart-frosted .woocommerce-message::before { color: var(--gfd-pink) !important; }
body.gfd-cart-frosted .return-to-shop { margin-top: 18px; }

/* Clear the desktop floats after the cart. */
body.gfd-cart-frosted .woocommerce::after { content: ""; display: table; clear: both; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
	body.gfd-cart-frosted .woocommerce-cart-form,
	body.gfd-cart-frosted .cart-collaterals { width: 100%; float: none; }
	body.gfd-cart-frosted .cart-collaterals { margin-top: 24px; }
	body.gfd-cart-frosted .woocommerce::before { font-size: 25px; }
}

/* Phones: turn each cart row into a flex card so the table never overflows —
   thumbnail + name + remove on the first line, then labeled price / quantity /
   subtotal rows beneath. */
@media (max-width: 600px) {
	/* Hard width guards so nothing in the cart column can exceed the screen. */
	body.gfd-cart-frosted .gfd-cart-stack,
	body.gfd-cart-frosted .woocommerce-cart-form,
	body.gfd-cart-frosted .gfd-cart-table-section,
	body.gfd-cart-frosted table.cart { max-width: 100% !important; box-sizing: border-box; }
	body.gfd-cart-frosted .gfd-cart-table-section { overflow-x: hidden; }

	body.gfd-cart-frosted table.cart { overflow: visible; }
	body.gfd-cart-frosted table.cart thead { display: none; }
	body.gfd-cart-frosted table.cart,
	body.gfd-cart-frosted table.cart tbody,
	body.gfd-cart-frosted table.cart tr { display: block; width: 100%; }

	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px 12px;
		padding: 14px 4px !important;
		border-bottom: 1px solid var(--gfd-line) !important;
	}
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td {
		border: 0 !important;
		padding: 0 !important;
		white-space: normal !important;
	}
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-thumbnail {
		order: 1;
		width: 60px !important;
		flex: 0 0 auto;
	}
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-thumbnail img {
		width: 60px !important;
		height: 60px !important;
	}
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-name {
		order: 2;
		flex: 1 1 auto;
		width: auto !important;
		min-width: 0;
		text-align: left;
		font-weight: 600;
	}
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-remove {
		order: 3;
		width: auto !important;
		margin-left: auto;
	}

	/* Labeled full-width rows: label (data-title) left, value right. */
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-price { order: 4; }
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-quantity { order: 5; }
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-subtotal { order: 6; }
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-price,
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-quantity,
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-subtotal {
		flex: 0 0 100%;
		width: 100% !important;
		display: flex;
		align-items: center;
		justify-content: space-between;
		text-align: left !important;
		padding: 4px 0 !important;
	}
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-price::before,
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-quantity::before,
	body.gfd-cart-frosted tr.woocommerce-cart-form__cart-item td.product-subtotal::before {
		content: attr(data-title);
		font-size: 11px;
		font-weight: 700;
		letter-spacing: .04em;
		text-transform: uppercase;
		color: var(--gfd-ink-soft);
	}

	/* Coupon / update actions row stacks full width. */
	body.gfd-cart-frosted td.actions {
		display: block;
		width: 100% !important;
		padding: 14px 0 !important;
		text-align: left;
	}
}
