/*
 * EcoFridge: Καλάθι (cart UX) + banner/βήματα στο checkout
 * Φορτώνει μόνο σε is_cart() / is_checkout(). Module: includes/class-cart-ux.php
 */

body.woocommerce-cart,
body.woocommerce-checkout {
	--ef-blue: #015878;
	--ef-blue-dark: #013f57;
	--ef-cyan: #00a8da;
	--ef-ink: #1d2a33;
	--ef-muted: #6b7780;
	--ef-line: #e3e8ec;
	--ef-soft: #f4f7f9;
	--ef-radius: 12px;
}

/* ---------- Banner του Default Page Template (795): χαμηλό, ανοιχτό ---------- */
body.woocommerce-cart .elementor-795 .elementor-element-0ebeea0,
body.woocommerce-checkout .elementor-795 .elementor-element-0ebeea0 {
	background-color: var(--ef-soft) !important;
	border-bottom: 1px solid var(--ef-line);
}
body.woocommerce-cart .elementor-795 .elementor-element-600f52c,
body.woocommerce-checkout .elementor-795 .elementor-element-600f52c {
	--min-height: 0px;
	min-height: 0 !important;
	padding-top: 34px !important;
	padding-bottom: 4px !important;
	--justify-content: flex-start;
}
body.woocommerce-cart .elementor-795 .elementor-element-600f52c .elementor-heading-title,
body.woocommerce-checkout .elementor-795 .elementor-element-600f52c .elementor-heading-title {
	color: var(--ef-blue) !important;
	font-size: 34px !important;
	text-align: left;
}
body.woocommerce-cart .elementor-795 .elementor-element-600f52c .elementor-widget-heading,
body.woocommerce-checkout .elementor-795 .elementor-element-600f52c .elementor-widget-heading {
	text-align: left;
	width: 100%;
}
body.woocommerce-cart .elementor-795 .elementor-element-3345646,
body.woocommerce-checkout .elementor-795 .elementor-element-3345646 {
	padding-bottom: 18px !important;
	color: var(--ef-muted) !important;
}
body.woocommerce-cart .elementor-795 .elementor-element-3345646 *,
body.woocommerce-checkout .elementor-795 .elementor-element-3345646 * {
	color: var(--ef-muted) !important;
	font-size: 14px;
}
body.woocommerce-cart .elementor-795 .elementor-element-3345646 a:hover,
body.woocommerce-checkout .elementor-795 .elementor-element-3345646 a:hover {
	color: var(--ef-blue) !important;
}
body.woocommerce-cart .elementor-795 .elementor-element-97600eb,
body.woocommerce-checkout .elementor-795 .elementor-element-97600eb {
	padding-top: 0 !important;
	padding-bottom: 64px;
}
body.woocommerce-cart .elementor-795 .elementor-element-97600eb > .e-con-inner,
body.woocommerce-checkout .elementor-795 .elementor-element-97600eb > .e-con-inner {
	padding-top: 8px !important;
}

/* ---------- Βήματα ---------- */
.ef-steps {
	display: flex;
	align-items: center;
	gap: 0;
	list-style: none;
	margin: 22px 0 26px;
	padding: 0;
	counter-reset: none;
}
.ef-steps__item {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--ef-muted);
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
}
.ef-steps__item + .ef-steps__item::before {
	content: "";
	display: block;
	width: 56px;
	height: 2px;
	margin: 0 16px;
	background: var(--ef-line);
}
.ef-steps__item.is-done + .ef-steps__item::before,
.ef-steps__item.is-active::before {
	background: var(--ef-cyan);
}
.ef-steps__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid var(--ef-line);
	background: #fff;
	color: var(--ef-muted);
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
}
.ef-steps__item.is-active { color: var(--ef-ink); font-weight: 700; }
.ef-steps__item.is-active .ef-steps__num { background: var(--ef-blue); border-color: var(--ef-blue); color: #fff; }
.ef-steps__item.is-done .ef-steps__num { background: var(--ef-cyan); border-color: var(--ef-cyan); color: #fff; }

/* ---------- Καλάθι: δύο στήλες ---------- */
.woocommerce-cart .elementor-widget-woocommerce-cart .e-cart__container {
	grid-column-gap: 32px;
	align-items: start;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .e-cart-section {
	background: #fff;
	border: 1px solid var(--ef-line) !important;
	border-radius: var(--ef-radius) !important;
	box-shadow: 0 6px 24px rgba(1, 88, 120, 0.06);
	padding: 8px 28px 20px !important;
	font-family: inherit;
}

/* Πίνακας προϊόντων */
.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table {
	border: 0;
	margin: 0;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table thead th {
	padding: 16px 12px 12px 0 !important;
	border-bottom: 1px solid var(--ef-line);
	color: var(--ef-muted) !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table tbody td {
	padding: 18px 12px 18px 0 !important;
	border-top: 0 !important;
	border-bottom: 1px solid var(--ef-line) !important;
	vertical-align: middle;
	color: var(--ef-ink);
	font-size: 15px;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table tbody tr.cart_item:last-of-type td {
	border-bottom: 0 !important;
}
.woocommerce-cart .elementor-widget-woocommerce-cart td.product-thumbnail {
	width: 108px;
}
.woocommerce-cart .elementor-widget-woocommerce-cart td.product-thumbnail a {
	display: block;
	width: 92px;
	height: 92px;
	border-radius: 10px;
	background: var(--ef-soft);
	padding: 6px;
	box-sizing: border-box;
}
.woocommerce-cart .elementor-widget-woocommerce-cart td.product-thumbnail img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: contain;
	margin: 0 !important;
}
.woocommerce-cart .elementor-widget-woocommerce-cart td.product-name a,
.elementor-kit-7.woocommerce-cart .elementor-widget-woocommerce-cart td.product-name a {
	color: var(--ef-ink) !important;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}
.woocommerce-cart .elementor-widget-woocommerce-cart td.product-name a:hover {
	color: var(--ef-blue) !important;
}
.ef-cart-sku {
	display: block;
	margin-top: 4px;
	color: var(--ef-muted);
	font-size: 13px;
	font-weight: 400;
}
.woocommerce-cart .elementor-widget-woocommerce-cart td.product-price {
	color: var(--ef-muted) !important;
	white-space: nowrap;
}
.woocommerce-cart .elementor-widget-woocommerce-cart td.product-subtotal {
	font-weight: 700;
	white-space: nowrap;
	text-align: right;
	padding-right: 0 !important;
}
.woocommerce-cart .elementor-widget-woocommerce-cart thead th.product-subtotal {
	text-align: right;
	padding-right: 0 !important;
}

/* Διαγραφή: εικονίδιο κάδου αντί για «×» */
.woocommerce-cart .elementor-widget-woocommerce-cart td.product-remove {
	width: 40px;
}
.woocommerce-cart .elementor-widget-woocommerce-cart td.product-remove a.remove,
.elementor-kit-7.woocommerce-cart .elementor-widget-woocommerce-cart td.product-remove a.remove {
	display: inline-flex;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	font-size: 0 !important;
	color: transparent !important;
	background: var(--ef-muted);
	-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='M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3'/%3E%3C/svg%3E") center / 20px 20px 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='M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
	transition: background-color .15s;
}
.woocommerce-cart .elementor-widget-woocommerce-cart td.product-remove a.remove:hover {
	background: #c0392b !important;
}

/* Ποσότητα με − / + (τα κουμπιά τα βάζει το cart.js) */
.woocommerce-cart .elementor-widget-woocommerce-cart .quantity {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--ef-line);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .quantity input.qty {
	width: 46px !important;
	height: 38px;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	text-align: center;
	font-size: 15px;
	font-weight: 600;
	color: var(--ef-ink);
	-moz-appearance: textfield;
	background: #fff;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .quantity input.qty::-webkit-outer-spin-button,
.woocommerce-cart .elementor-widget-woocommerce-cart .quantity input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.woocommerce-cart .ef-qty-btn {
	width: 36px;
	border: 0;
	padding: 0;
	background: var(--ef-soft);
	color: var(--ef-blue);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background-color .15s;
}
.woocommerce-cart .ef-qty-btn:hover { background: #e6eef2; }
.woocommerce-cart .ef-qty-btn:disabled { color: #b8c2c9; cursor: default; }

/* Κουμπί «Ενημέρωση καλαθιού»: κρύβεται όταν τρέχει το JS (αυτόματη ενημέρωση) */
.woocommerce-cart.ef-cart-js .elementor-widget-woocommerce-cart button[name="update_cart"] {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0 !important; border: 0 !important;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table tbody td.actions {
	padding: 0 !important;
	border: 0 !important;
}

/* Η γραμμή με το (κρυμμένο) κουμπί ενημέρωσης δεν πιάνει χώρο */
.woocommerce-cart.ef-cart-js .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table tbody td.actions {
	height: 0;
	line-height: 0;
	font-size: 0;
}
.woocommerce-cart.ef-cart-js .elementor-widget-woocommerce-cart td.actions > img {
	display: none;
}

/* Συνέχεια αγορών */
.ef-cart-continue,
.elementor-kit-7 .ef-cart-continue {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	margin: 18px 0 0 4px;
	color: var(--ef-blue) !important;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}
.ef-cart-continue:hover { text-decoration: underline; }

/* ---------- Σύνολα ---------- */
.woocommerce-cart .elementor-widget-woocommerce-cart .e-cart-totals {
	padding: 22px 26px 26px !important;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .e-cart-totals h2,
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals h2 {
	margin: 0 0 8px !important;
	padding: 0 !important;
	color: var(--ef-ink) !important;
	font-size: 18px !important;
	font-weight: 700 !important;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals table th,
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals table td {
	padding: 12px 0 !important;
	border-top: 1px solid var(--ef-line) !important;
	color: var(--ef-ink) !important;
	font-size: 15px !important;
	font-weight: 400 !important;
	vertical-align: top;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals table th {
	color: var(--ef-muted) !important;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals table td {
	text-align: right;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals ul#shipping_method,
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals ul#shipping_method li {
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: right;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals ul#shipping_method li {
	margin: 0 !important;
	line-height: 1.4;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals ul#shipping_method label {
	display: inline;
	margin: 0 !important;
	padding: 0 !important;
	font-weight: 400;
	color: var(--ef-ink);
	white-space: nowrap;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-shipping-destination,
.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-shipping-calculator {
	display: none;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals tr.order-total th,
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals tr.order-total td {
	padding-top: 16px !important;
	border-top: 2px solid var(--ef-ink) !important;
	color: var(--ef-ink) !important;
	font-size: 20px !important;
	font-weight: 700 !important;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals tr.order-total strong,
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals tr.order-total .amount,
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals tr.order-total td::before {
	color: var(--ef-ink) !important;
	font-weight: 700 !important;
}

/* Γραμμή αποστολής: τίτλος και τιμή στην ίδια γραμμή */
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals tr.woocommerce-shipping-totals td {
	display: flex !important;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
}
.woocommerce-cart .elementor-widget-woocommerce-cart .cart_totals tr.woocommerce-shipping-totals td::before {
	float: none !important;
}

/* Κουμπί ολοκλήρωσης */
.woocommerce-cart .elementor-widget-woocommerce-cart .wc-proceed-to-checkout {
	padding: 18px 0 0 !important;
}
.woocommerce-cart .elementor-widget-woocommerce-cart a.checkout-button,
.elementor-kit-7.woocommerce-cart .elementor-widget-woocommerce-cart a.checkout-button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 54px;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 10px !important;
	background: var(--ef-blue) !important;
	color: #fff !important;
	font-size: 17px !important;
	font-weight: 700 !important;
	letter-spacing: .01em;
	text-decoration: none !important;
	transition: background-color .15s, transform .15s;
}
.woocommerce-cart .elementor-widget-woocommerce-cart a.checkout-button::after {
	content: "\2192";
	font-size: 18px;
}
.woocommerce-cart .elementor-widget-woocommerce-cart a.checkout-button:hover {
	background: var(--ef-blue-dark) !important;
	transform: translateY(-1px);
}

/* Μήνυμα WooCommerce (π.χ. «ενημερώθηκε το καλάθι») */
.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-info {
	border-radius: 10px;
	border-top-color: var(--ef-cyan);
}

/* Άδειο καλάθι */
.woocommerce-cart .elementor-widget-woocommerce-cart .return-to-shop a.button,
.elementor-kit-7.woocommerce-cart .elementor-widget-woocommerce-cart .return-to-shop a.button {
	display: inline-flex;
	align-items: center;
	min-height: 46px;
	padding: 0 22px !important;
	border: 0 !important;
	border-radius: 10px !important;
	background: var(--ef-blue) !important;
	color: #fff !important;
	font-weight: 700 !important;
	text-decoration: none !important;
}

/* Κινητό: σταθερή κάτω μπάρα (τη φτιάχνει το cart.js) */
.ef-cart-mbar { display: none; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
	.woocommerce-cart .elementor-widget-woocommerce-cart .e-cart-section {
		padding: 8px 18px 16px !important;
	}
	.woocommerce-cart .elementor-widget-woocommerce-cart td.product-thumbnail { width: 88px; }
	.woocommerce-cart .elementor-widget-woocommerce-cart td.product-thumbnail a { width: 76px; height: 76px; }
}

/* ---------- Κινητό ---------- */
@media (max-width: 767px) {
	body.woocommerce-cart .elementor-795 .elementor-element-600f52c,
	body.woocommerce-checkout .elementor-795 .elementor-element-600f52c {
		padding-top: 22px !important;
	}
	body.woocommerce-cart .elementor-795 .elementor-element-600f52c .elementor-heading-title,
	body.woocommerce-checkout .elementor-795 .elementor-element-600f52c .elementor-heading-title {
		font-size: 26px !important;
	}

	.ef-steps { margin: 16px 0 18px; }
	.ef-steps__item { font-size: 13px; gap: 6px; }
	.ef-steps__item + .ef-steps__item::before { width: 14px; margin: 0 8px; }
	.ef-steps__num { width: 24px; height: 24px; font-size: 12px; }
	.ef-steps__item:not(.is-active) .ef-steps__label { display: none; }

	.woocommerce-cart .elementor-widget-woocommerce-cart .e-cart-section {
		padding: 4px 14px 10px !important;
	}

	/* Κάθε προϊόν: compact κάρτα, φωτογραφία αριστερά */
	.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table_responsive tr.cart_item {
		display: grid !important;
		grid-template-columns: 76px 1fr auto;
		grid-template-areas:
			"thumb name remove"
			"thumb price price"
			"thumb qty   sub";
		column-gap: 12px;
		row-gap: 6px;
		align-items: center;
		padding: 14px 0;
		border-bottom: 1px solid var(--ef-line);
	}
	.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table_responsive tr.cart_item:last-of-type {
		border-bottom: 0;
	}
	.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table_responsive tr.cart_item td {
		display: block !important;
		padding: 0 !important;
		border: 0 !important;
		text-align: left !important;
		background: transparent !important;
		width: auto !important;
	}
	.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table_responsive tr.cart_item td::before {
		display: none !important;
	}
	.woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-thumbnail { grid-area: thumb; align-self: start; display: block !important; }
	.woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-thumbnail a { width: 76px; height: 76px; }
	.woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-name { grid-area: name; }
	.woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-name a { font-size: 15px; }
	.woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-remove { grid-area: remove; align-self: start; }
	.woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-price { grid-area: price; font-size: 13px; }
	.woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-quantity { grid-area: qty; }
	.woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-subtotal { grid-area: sub; text-align: right !important; font-size: 16px; }
	.woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-price::after {
		content: " / τεμ.";
	}
	html[lang^="en"] .woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-price::after,
	html[lang^="en"] body.woocommerce-cart .elementor-widget-woocommerce-cart tr.cart_item td.product-price::after {
		content: " / pc";
	}
	.woocommerce-cart .elementor-widget-woocommerce-cart .quantity input.qty { height: 34px; width: 40px !important; }
	.woocommerce-cart .ef-qty-btn { width: 34px; }

	.woocommerce-cart .elementor-widget-woocommerce-cart .e-cart-totals {
		padding: 18px 16px 20px !important;
	}

	/* Κάτω μπάρα: σύνολο + ολοκλήρωση */
	.ef-cart-mbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 500;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
		background: #fff;
		border-top: 1px solid var(--ef-line);
		box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
		transform: translateY(0);
		transition: transform .2s;
	}
	.ef-cart-mbar.is-hidden { transform: translateY(110%); }
	.ef-cart-mbar__total { display: flex; flex-direction: column; line-height: 1.2; }
	.ef-cart-mbar__label { color: var(--ef-muted); font-size: 12px; }
	.ef-cart-mbar__value { color: var(--ef-ink); font-size: 18px; font-weight: 700; }
	.ef-cart-mbar__btn,
	.elementor-kit-7 .ef-cart-mbar__btn {
		display: inline-flex;
		align-items: center;
		min-height: 46px;
		padding: 0 20px;
		border-radius: 10px;
		background: var(--ef-blue);
		color: #fff !important;
		font-weight: 700;
		text-decoration: none;
		white-space: nowrap;
	}
	body.woocommerce-cart.ef-cart-has-mbar { padding-bottom: 72px; }
}

/* Ενημέρωση σε εξέλιξη */
.woocommerce-cart .elementor-widget-woocommerce-cart .e-cart-section.ef-updating {
	opacity: .55;
	pointer-events: none;
	transition: opacity .15s;
}

/* ---------- Checkout block: τα μεταφορικά συμφωνούνται, όχι «Δωρεάν» ---------- */
body.woocommerce-checkout .wc-block-checkout__shipping-option--free,
body.woocommerce-checkout .wc-block-components-totals-shipping .wc-block-components-totals-item__value {
	display: none !important;
}
