/* =========================================================================
   Joom - cart page. Styles WooCommerce's own cart template (cart/cart.php,
   cart-totals.php, cart-empty.php, cross-sells): products as cards, the
   totals as an order summary beside them, a sticky checkout button on
   phones. assets/js/cart.js adds quantity steppers / auto update.
   ========================================================================= */

.woocommerce-cart .site-main {
	--mj-ct-line: var(--border-color, #e7e5e4);
	--mj-ct-ink: var(--price-color, #111827);
	--mj-ct-muted: var(--light-text-color, #64748b);
	--mj-ct-soft: color-mix(in srgb, var(--text-color, #334155) 4%, #ffffff);
}

/* --- Layout: products | summary --------------------------------------------- */
.woocommerce-cart .woocommerce:has(> .woocommerce-cart-form) {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

.woocommerce-cart .woocommerce:has(> .woocommerce-cart-form) > * {
	grid-column: 1 / -1;
	min-width: 0;
	margin: 0;
}

@media (min-width: 1000px) {
	.woocommerce-cart .woocommerce:has(> .woocommerce-cart-form) {
		grid-template-columns: minmax(0, 1fr) 380px;
		grid-auto-flow: row dense;
		column-gap: clamp(32px, 4vw, 56px);
	}

	.woocommerce-cart .woocommerce:has(> .woocommerce-cart-form) > .woocommerce-cart-form {
		grid-column: 1;
	}

	.woocommerce-cart .woocommerce:has(> .woocommerce-cart-form) > .cart-collaterals {
		grid-column: 2;
		position: sticky;
		top: calc(var(--mj-sticky-top, 0px) + 24px);
	}
}

.woocommerce-cart .woocommerce-notices-wrapper:empty {
	display: none;
}

/* --- Products as cards ------------------------------------------------------- */
.woocommerce-cart table.shop_table.cart {
	display: block;
	width: 100%;
	margin: 0;
	border: 0;
	border-top: 1px solid var(--mj-ct-line);
	border-radius: 0;
}

.woocommerce-cart table.shop_table.cart thead {
	display: none;
}

.woocommerce-cart table.shop_table.cart tbody {
	display: block;
}

.woocommerce-cart table.shop_table.cart tr.cart_item {
	position: relative;
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr) auto;
	grid-template-areas:
		"thumb name     remove"
		"thumb price    price"
		"thumb quantity subtotal";
	column-gap: 20px;
	row-gap: 6px;
	padding: 24px 0;
	border-bottom: 1px solid var(--mj-ct-line);
}

.woocommerce-cart table.shop_table.cart tr.cart_item td,
.woocommerce-cart table.shop_table_responsive.cart tr:nth-child(2n) td {
	display: block;
	padding: 0;
	border: 0;
	background: none;
	text-align: left !important; /* WooCommerce's small-screen CSS right-aligns with !important */
}

.woocommerce-cart table.shop_table_responsive.cart tr td::before {
	display: none;
}

.woocommerce-cart table.cart td.product-thumbnail {
	grid-area: thumb;
	width: auto;
}

.woocommerce-cart table.cart td.product-thumbnail img {
	display: block;
	width: 96px;
	height: 120px;
	object-fit: cover;
	background: var(--mj-ct-soft);
}

.woocommerce-cart table.cart td.product-name {
	grid-area: name;
	align-self: start;
	font-size: 15px;
	line-height: 1.4;
}

.woocommerce-cart table.cart td.product-name > a {
	color: var(--mj-ct-ink);
	font-weight: 500;
	text-decoration: none;
}

.woocommerce-cart table.cart td.product-name > a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.woocommerce-cart table.cart td.product-name dl.variation,
.woocommerce-cart table.cart td.product-name .backorder_notification {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 10px;
	margin: 6px 0 0;
	color: var(--mj-ct-muted);
	font-size: 13px;
}

.woocommerce-cart table.cart td.product-name dl.variation dt,
.woocommerce-cart table.cart td.product-name dl.variation dd,
.woocommerce-cart table.cart td.product-name dl.variation p {
	display: inline;
	float: none;
	margin: 0;
	padding: 0;
}

.woocommerce-cart table.cart td.product-price {
	grid-area: price;
	color: var(--mj-ct-muted);
	font-size: 13.5px;
}

.woocommerce-cart table.cart td.product-quantity {
	grid-area: quantity;
	align-self: end;
}

.woocommerce-cart table.cart td.product-subtotal {
	grid-area: subtotal;
	align-self: end;
	color: var(--mj-ct-ink);
	font-size: 15px;
	font-weight: 600;
	text-align: right !important;
}

.woocommerce-cart table.cart td.product-remove {
	grid-area: remove;
	justify-self: end;
	width: auto;
}

.woocommerce-cart table.cart td.product-remove a.remove {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	color: var(--mj-ct-muted) !important; /* WooCommerce colours it red with !important */
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
}

.woocommerce-cart table.cart td.product-remove a.remove:hover {
	background: var(--mj-ct-soft);
	color: var(--mj-ct-ink) !important;
}

/* Quantity stepper (the same buttons as the product page) */
.woocommerce-cart table.cart div.quantity {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--mj-ct-line);
}

.woocommerce-cart table.cart div.quantity .qty {
	width: 40px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--mj-ct-ink);
	font-size: 14px;
	text-align: center;
	-moz-appearance: textfield;
}

.woocommerce-cart table.cart div.quantity .qty::-webkit-outer-spin-button,
.woocommerce-cart table.cart div.quantity .qty::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.woocommerce-cart table.cart .mj-qty-step {
	width: 34px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--mj-ct-ink);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.woocommerce-cart table.cart .mj-qty-step:hover {
	background: var(--mj-ct-soft);
}

/* Coupon and update row */
.woocommerce-cart table.cart tr:last-child,
.woocommerce-cart table.cart tr:last-child td.actions {
	display: block;
	padding: 0;
	border: 0;
	background: none;
}

.woocommerce-cart table.cart td.actions {
	padding-top: 24px !important; /* WooCommerce sets padding on every table cell */
	text-align: left;
}

.woocommerce-cart table.cart td.actions .coupon {
	display: flex;
	float: none;
	gap: 0;
	max-width: 420px;
}

.woocommerce-cart table.cart td.actions .coupon label {
	display: none;
}

.woocommerce-cart table.cart td.actions .coupon .input-text {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--mj-ct-line);
	border-right: 0;
	border-radius: 0;
	font-size: 14px;
}

.woocommerce-cart table.cart td.actions .coupon .button,
.woocommerce-cart table.cart td.actions > .button {
	height: 46px;
	margin: 0;
	padding: 0 22px;
	border: 1px solid var(--mj-ct-ink);
	border-radius: 0;
	background: var(--mj-ct-ink);
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.woocommerce-cart table.cart td.actions > .button {
	float: right;
	background: #ffffff;
	color: var(--mj-ct-ink);
}

.woocommerce-cart table.cart td.actions > .button:disabled {
	opacity: 0.4;
}

/* cart.js presses "Update cart" itself. */
.woocommerce-cart .mj-auto-update td.actions > button[name="update_cart"] {
	display: none;
}

/* --- Summary (cart totals) ------------------------------------------------------ */
.woocommerce-cart .cart-collaterals {
	width: auto;
}

.woocommerce-cart .cart-collaterals::before,
.woocommerce-cart .cart-collaterals::after {
	display: none;
}

.woocommerce-cart .cart-collaterals .cart_totals {
	float: none;
	width: 100%;
	padding: 28px;
	border: 1px solid var(--mj-ct-line);
	background: #ffffff;
}

.woocommerce-cart .cart_totals > h2 {
	margin: 0 0 18px;
	color: var(--mj-ct-ink);
	font-family: var(--mj-display-font, inherit);
	font-size: 26px;
	font-weight: 500;
	line-height: 1.2;
}

body.joom-header-premium {
	--mj-display-font: "Cormorant Garamond", "Playfair Display", Georgia, serif;
}

.woocommerce-cart .cart_totals table.shop_table {
	width: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
}

.woocommerce-cart .cart_totals table.shop_table tr {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
	border-top: 1px solid var(--mj-ct-line);
}

.woocommerce-cart .cart_totals table.shop_table th,
.woocommerce-cart .cart_totals table.shop_table td {
	display: block;
	padding: 0;
	border: 0;
	background: none;
	color: var(--text-color, #334155);
	font-size: 14px;
	font-weight: 400;
	text-align: right;
}

.woocommerce-cart .cart_totals table.shop_table th {
	text-align: left;
}

.woocommerce-cart .cart_totals table.shop_table td::before {
	display: none;
}

.woocommerce-cart .cart_totals tr.order-total th,
.woocommerce-cart .cart_totals tr.order-total td {
	color: var(--mj-ct-ink);
	font-size: 16px;
	font-weight: 600;
}

.woocommerce-cart .cart_totals tr.order-total td .amount {
	font-size: 20px;
}

.woocommerce-cart .cart_totals .woocommerce-shipping-totals td {
	max-width: 65%;
}

.woocommerce-cart .cart_totals ul#shipping_method {
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce-cart .cart_totals .woocommerce-shipping-destination,
.woocommerce-cart .cart_totals .shipping-calculator-button {
	color: var(--mj-ct-muted);
	font-size: 12.5px;
}

/* "You save ₹X on this order" (inc/cart.php) */
.woocommerce-cart .cart_totals table.shop_table tr.mj-cart-savings,
.woocommerce-checkout-review-order-table tr.mj-cart-savings {
	display: block;
	border-top: 0;
}

.woocommerce-cart .cart_totals table.shop_table tr.mj-cart-savings td,
.woocommerce-checkout-review-order-table tr.mj-cart-savings td {
	display: block;
	width: 100%;
	padding: 10px 14px;
	border: 1px dashed color-mix(in srgb, #15803d 45%, transparent);
	background: color-mix(in srgb, #15803d 6%, #ffffff);
	color: #15803d;
	font-size: 13.5px;
	text-align: center;
}

.woocommerce-cart .cart_totals .wc-proceed-to-checkout {
	padding: 20px 0 0;
}

.woocommerce-cart .cart_totals .wc-proceed-to-checkout .checkout-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 54px;
	margin: 0;
	padding: 0 20px;
	border: 1px solid var(--add-to-cart-bg, var(--mj-ct-ink));
	border-radius: 0;
	background: var(--add-to-cart-bg, var(--mj-ct-ink));
	color: var(--add-to-cart-color, #ffffff);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.woocommerce-cart .cart_totals .wc-proceed-to-checkout .checkout-button:hover {
	border-color: var(--add-to-cart-hover, var(--mj-ct-ink));
	background: var(--add-to-cart-hover, var(--mj-ct-ink));
	color: var(--add-to-cart-hover-color, #ffffff);
}

/* --- Free-shipping bar and cross-sells ------------------------------------------ */
.woocommerce-cart .woocommerce > .mj-free-shipping-bar-wrap {
	padding: 16px 20px;
	border: 1px solid var(--mj-ct-line);
}

.woocommerce-cart .cross-sells {
	margin-top: 32px;
}

.woocommerce-cart .cross-sells > h2 {
	margin: 0 0 24px;
	color: var(--mj-ct-ink);
	font-family: var(--mj-display-font, inherit);
	font-size: clamp(24px, 2.4vw, 32px);
	font-weight: 500;
	text-align: center;
}

/* --- Empty cart ----------------------------------------------------------------- */
.woocommerce-cart .cart-empty.woocommerce-info {
	padding: 48px 20px 12px;
	border: 0;
	background: none;
	color: var(--mj-ct-ink);
	font-family: var(--mj-display-font, inherit);
	font-size: 28px;
	text-align: center;
}

.woocommerce-cart .cart-empty.woocommerce-info::before {
	display: none;
}

.woocommerce-cart .return-to-shop {
	text-align: center;
}

.woocommerce-cart .return-to-shop .button {
	display: inline-flex;
	align-items: center;
	height: 50px;
	padding: 0 32px;
	border: 1px solid var(--mj-ct-ink);
	border-radius: 0;
	background: var(--mj-ct-ink);
	color: #ffffff;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* --- Phones: checkout button stays at the bottom ---------------------------------- */
@media (max-width: 767px) {
	.woocommerce-cart table.shop_table.cart tr.cart_item {
		grid-template-columns: 80px minmax(0, 1fr) auto;
		column-gap: 14px;
		padding: 18px 0;
	}

	.woocommerce-cart table.cart td.product-thumbnail img {
		width: 80px;
		height: 100px;
	}

	.woocommerce-cart table.cart td.actions > .button {
		float: none;
		width: 100%;
		margin-top: 12px;
	}

	.woocommerce-cart .cart-collaterals .cart_totals {
		padding: 20px;
	}

	.woocommerce-cart .cart_totals .wc-proceed-to-checkout {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 990;
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
		border-top: 1px solid var(--mj-ct-line);
		background: #ffffff;
		box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06);
	}

	body.joom-has-mobile-menu .cart_totals .wc-proceed-to-checkout {
		bottom: calc(60px + env(safe-area-inset-bottom, 0px));
		padding-bottom: 10px;
	}

	.woocommerce-cart .site-main {
		padding-bottom: 80px;
	}
}

/* Room above the footer, and no legacy highlight behind the total. */
.woocommerce-cart #primary {
	padding-bottom: 72px;
}

.woocommerce-cart .cart_totals tr.order-total td .amount,
.woocommerce-cart .cart_totals tr.order-total td strong {
	padding: 0;
	background: none;
	box-shadow: none;
}

/* =========================================================================
   Card look (the store's original cart design) on WooCommerce's markup.
   ========================================================================= */
.woocommerce-cart .site-main {
	--mj-ct-radius: 16px;
	--mj-ct-card-line: color-mix(in srgb, var(--mj-ct-ink) 8%, #ffffff);
}

.woocommerce-cart table.shop_table.cart {
	border-top: 0;
}

.woocommerce-cart table.shop_table.cart tbody {
	display: grid;
	gap: 16px;
}

.woocommerce-cart table.shop_table.cart tr.cart_item {
	grid-template-columns: 94px minmax(0, 1fr) auto auto;
	grid-template-areas:
		"thumb name     quantity remove"
		"thumb subtotal quantity remove";
	align-items: center;
	column-gap: 20px;
	row-gap: 8px;
	padding: 20px 24px;
	border: 1px solid var(--mj-ct-card-line);
	border-radius: var(--mj-ct-radius);
	background: #ffffff;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.woocommerce-cart table.cart td.product-thumbnail img {
	width: 94px;
	height: 94px;
	border-radius: 10px;
}

.woocommerce-cart table.cart td.product-name {
	align-self: end;
	font-size: 16px;
}

.woocommerce-cart table.cart td.product-name > a {
	font-weight: 600;
}

/* The line total (price x quantity) sits under the name. */
.woocommerce-cart table.cart td.product-price {
	display: none !important; /* the line total below already shows it */
}

.woocommerce-cart table.cart td.product-subtotal {
	align-self: start;
	font-size: 16px;
	font-weight: 700;
	text-align: left !important;
}

.woocommerce-cart table.cart td.product-quantity {
	align-self: center;
}

.woocommerce-cart table.cart div.quantity {
	border-color: var(--mj-ct-card-line);
	border-radius: 10px;
	background: color-mix(in srgb, var(--mj-ct-ink) 2%, #ffffff);
	overflow: hidden;
}

.woocommerce-cart table.cart div.quantity .qty {
	height: 36px;
	font-weight: 600;
}

.woocommerce-cart table.cart td.product-remove {
	align-self: center;
}

/* Remove: a bin icon in a soft circle */
.woocommerce-cart table.cart td.product-remove a.remove {
	width: 38px;
	height: 38px;
	background: color-mix(in srgb, #dc2626 8%, #ffffff);
	color: #dc2626 !important; /* WooCommerce sets its own colour with !important */
	font-size: 0;
}

.woocommerce-cart table.cart td.product-remove a.remove::before {
	content: "";
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.woocommerce-cart table.cart td.product-remove a.remove:hover {
	background: #dc2626;
	color: #ffffff !important;
}

/* Coupon: a soft field and a dark button */
.woocommerce-cart table.cart td.actions {
	padding-top: 8px !important;
}

.woocommerce-cart table.cart td.actions .coupon {
	gap: 10px;
	max-width: 460px;
}

.woocommerce-cart table.cart td.actions .coupon .input-text {
	height: 48px;
	border: 1px solid var(--mj-ct-card-line);
	border-right: 1px solid var(--mj-ct-card-line);
	border-radius: 12px;
	background: color-mix(in srgb, var(--mj-ct-ink) 2.5%, #ffffff);
}

.woocommerce-cart table.cart td.actions .coupon .button {
	height: 48px;
	padding: 0 26px;
	border-radius: 12px;
	letter-spacing: 0.04em;
	text-transform: none;
	font-size: 14px;
}

/* Summary card */
.woocommerce-cart .cart-collaterals .cart_totals {
	padding: 28px;
	border: 1px solid var(--mj-ct-card-line);
	border-radius: 20px;
	box-shadow: 0 10px 40px rgba(15, 23, 42, 0.05);
}

.woocommerce-cart .cart_totals > h2 {
	margin-bottom: 14px;
	padding-bottom: 16px;
	border-bottom: 1px dashed var(--mj-ct-card-line);
	font-family: inherit;
	font-size: 20px;
	font-weight: 700;
}

.woocommerce-cart .cart_totals table.shop_table tr:first-child {
	border-top: 0;
}

.woocommerce-cart .cart_totals tr.order-total td .amount {
	font-size: 22px;
	font-weight: 800;
}

.woocommerce-cart .cart_totals table.shop_table tr.mj-cart-savings td {
	padding: 12px 14px;
	border-radius: 10px;
	font-weight: 600;
}

.woocommerce-cart .cart_totals .wc-proceed-to-checkout .checkout-button {
	height: 54px;
	border-radius: 14px;
	font-size: 15px;
	letter-spacing: 0.02em;
	text-transform: none;
}

@media (max-width: 767px) {
	.woocommerce-cart table.shop_table.cart tr.cart_item {
		grid-template-columns: 80px minmax(0, 1fr) auto;
		grid-template-areas:
			"thumb name     remove"
			"thumb subtotal subtotal"
			"thumb quantity quantity";
		column-gap: 14px;
		row-gap: 6px;
		padding: 14px;
		border-radius: 14px;
	}

	.woocommerce-cart table.cart td.product-thumbnail img {
		width: 80px;
		height: 80px;
	}

	.woocommerce-cart table.cart td.product-name {
		font-size: 14.5px;
	}

	.woocommerce-cart table.cart td.product-remove {
		align-self: start;
	}

	.woocommerce-cart table.cart td.product-remove a.remove {
		width: 34px;
		height: 34px;
	}

	.woocommerce-cart .cart-collaterals .cart_totals {
		padding: 20px;
		border-radius: 16px;
	}

	.woocommerce-cart .cart_totals .wc-proceed-to-checkout .checkout-button {
		border-radius: 12px;
	}
}

/* WooCommerce's small-screen zebra rows and the thumbnail link's line box. */
.woocommerce-cart .cart_totals table.shop_table_responsive tr:nth-child(2n) td,
.woocommerce-cart .cart_totals table.shop_table_responsive tr:nth-child(2n) th {
	background: none;
}

.woocommerce-cart table.cart td.product-thumbnail,
.woocommerce-cart table.cart td.product-thumbnail a {
	display: block;
	line-height: 0;
}

.woocommerce-cart table.shop_table.cart tr.cart_item {
	grid-template-rows: auto auto;
	align-content: center;
}

@media (min-width: 768px) {
	.woocommerce-cart table.cart td.product-thumbnail {
		grid-row: 1 / span 2;
	}

	.woocommerce-cart table.cart td.product-quantity,
	.woocommerce-cart table.cart td.product-remove {
		grid-row: 1 / span 2;
	}
}

@media (max-width: 767px) {
	.woocommerce-cart table.shop_table.cart tr.cart_item {
		grid-template-rows: auto auto 1fr;
	}
}

.woocommerce-cart table.cart td.product-thumbnail img {
	margin: 0; /* page content images get a bottom margin */
}
