/**
 * Cart page (Figma: Screens / Cart, 360 · 768 · 1024 · 1440 · 1920).
 * Phones and tablets: items, then the summary. From 1024px: items and the
 * summary (360px, 400px from 1440px) side by side.
 * Markup: inc/cart.php; behaviour: assets/js/cart.js; Number input: forms.css.
 */

.mw-cart-page {
	margin-block-start: 0 !important;
}

.mw-cart {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--50);
	width: 100%;
	max-width: calc(1280px + 2 * var(--mw-layout-margin));
	margin-inline: auto;
	padding: var(--wp--preset--spacing--40) var(--mw-layout-margin) var(--mw-space-3xl);
}

.mw-cart p,
.mw-cart h1,
.mw-cart h2,
.mw-cart ul,
.mw-cart dl {
	margin: 0;
}

@media (min-width: 600px) {
	.mw-cart {
		padding-block-start: 2.5rem;
	}
}

/* Notices (WooCommerce): full width above everything. */
.mw-cart > .woocommerce-notices-wrapper:empty {
	display: none;
}

/* "Το καλάθι σου" (Display/Small) + "4 προϊόντα". Phones: one under the other. */
.mw-cart__heading {
	display: flex;
	flex-direction: column;
	gap: var(--mw-space-2xs);
}

.mw-cart__heading h1 {
	font-size: clamp(2.25rem, 1.75rem + 1.5vw, 3rem);
	line-height: 1.25;
	letter-spacing: -0.25px;
}

.mw-cart__heading p {
	color: var(--mw-color-on-surface-variant);
	font-size: var(--wp--preset--font-size--small);
	line-height: 26px;
}

@media (min-width: 600px) {
	.mw-cart__heading {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-end;
		gap: var(--wp--preset--spacing--30);
	}

	.mw-cart__heading h1 {
		line-height: 60px;
	}
}

.mw-cart__row {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--50);
}

@media (min-width: 1024px) {
	.mw-cart__row {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 360px;
		align-items: start;
		gap: var(--mw-space-xl);
	}
}

@media (min-width: 1440px) {
	.mw-cart__row {
		grid-template-columns: minmax(0, 1fr) 400px;
	}
}

/* ------------------------------------------------------------------ */
/* Items                                                               */
/* ------------------------------------------------------------------ */

.mw-cart__items {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
}

/* Free shipping: Message / Success over a 6px progress bar. */
.mw-cart__shipping {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	padding: var(--mw-space-sm) var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--radius--medium);
	background: var(--mw-color-success-container);
}

.mw-cart__shipping-text {
	display: flex;
	align-items: center;
	gap: var(--mw-space-2xs);
	color: var(--mw-color-success);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 22px;
	letter-spacing: 0.1px;
}

.mw-cart__shipping-text::before {
	content: "";
	flex: none;
	width: var(--mw-size-icon-md);
	height: var(--mw-size-icon-md);
	background: currentColor;
	-webkit-mask: var(--mw-icon-check-circle) center / contain no-repeat;
	mask: var(--mw-icon-check-circle) center / contain no-repeat;
}

.mw-cart__track {
	height: 6px;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--white);
}

.mw-cart__track span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--mw-color-success);
	transition: width var(--mw-motion-slow) var(--mw-easing);
}

.mw-cart__list {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	padding: 0;
	list-style: none;
}

/* Item: image 80 (112 from 600, 120 from 1440), details on the right. */
.mw-cart-item {
	display: flex;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--30);
	padding-block-end: var(--wp--preset--spacing--30);
	border-bottom: var(--mw-border-thin) solid var(--mw-color-outline-variant);
}

.mw-cart-item__image {
	display: block;
	flex: none;
	width: 80px;
	height: 80px;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--medium);
	background: var(--mw-color-surface-container-high);
}

.mw-cart-item__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

@media (min-width: 600px) {
	.mw-cart-item__image {
		width: 112px;
		height: 112px;
	}
}

@media (min-width: 1440px) {
	.mw-cart-item__image {
		width: 120px;
		height: 120px;
	}
}

.mw-cart-item__details {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	min-width: 0;
}

/* Name (Title/Small on phones, Title/Medium from 600) and price or delete icon. */
.mw-cart-item__head {
	display: flex;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--30);
}

.mw-cart-item__name {
	flex: 1 1 auto;
	min-width: 0;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 22px;
}

.mw-cart-item__name a {
	color: inherit;
	text-decoration: none;
}

.mw-cart-item__name a:hover {
	text-decoration: underline;
}

.mw-cart-item__price {
	flex: none;
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 24px;
	white-space: nowrap;
}

.mw-cart-item__price .woocommerce-Price-amount {
	font-weight: inherit;
}

/* Button icon (delete), phones only: 48×48, icon 24. */
.mw-cart-item__delete {
	display: grid;
	flex: none;
	place-items: center;
	width: var(--mw-size-control-lg);
	height: var(--mw-size-control-lg);
	margin: -0.75rem -0.75rem 0 0;
	border-radius: var(--wp--custom--radius--pill);
	color: var(--mw-color-on-surface-variant);
}

.mw-cart-item__delete::before {
	content: "";
	width: var(--mw-size-icon-lg);
	height: var(--mw-size-icon-lg);
	background: currentColor;
	-webkit-mask: var(--mw-icon-delete) center / contain no-repeat;
	mask: var(--mw-icon-delete) center / contain no-repeat;
}

.mw-cart-item__delete:hover {
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 8%, transparent);
}

.mw-cart-item__meta {
	color: var(--mw-color-on-surface-variant);
	font-size: var(--mw-font-size-x-small);
	line-height: 22px;
	letter-spacing: 0.1px;
}

/* Quantity, then (phones) the price on the right or (600+) "Αφαίρεση". */
.mw-cart-item__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	margin-block-start: var(--wp--preset--spacing--20);
}

.mw-cart-item__remove {
	color: var(--wp--preset--color--primary-dark);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 22px;
	letter-spacing: 0.1px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.mw-cart-item__remove:hover {
	text-decoration: none;
}

@media (max-width: 599px) {
	/* The price moves next to the quantity, the text link gives way to the icon. */
	.mw-cart-item__details {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: var(--wp--preset--spacing--30);
	}

	.mw-cart-item__head,
	.mw-cart-item__meta {
		grid-column: 1 / -1;
	}

	.mw-cart-item__head .mw-cart-item__price {
		display: none;
	}

	.mw-cart-item__controls {
		grid-column: 1;
	}

	.mw-cart-item__remove {
		display: none;
	}

	.mw-cart-item__details > .mw-cart-item__price-mobile {
		grid-column: 2;
		align-self: center;
	}
}

@media (min-width: 600px) {
	.mw-cart-item__name {
		font-size: var(--wp--preset--font-size--medium);
		line-height: 26px;
	}

	.mw-cart-item__delete,
	.mw-cart-item__price-mobile {
		display: none !important;
	}

	.mw-cart-item__controls {
		margin-block-start: 0;
	}
}

/* No JavaScript: the button that saves changed quantities. With JS it is hidden. */
.mw-cart__update {
	align-self: flex-start;
}

.mw-cart.is-enhanced .mw-cart__update {
	display: none;
}

.mw-cart__items.is-updating {
	opacity: 0.6;
	pointer-events: none;
}

.mw-cart__continue a {
	color: var(--wp--preset--color--primary-dark);
}

/* ------------------------------------------------------------------ */
/* Summary                                                             */
/* ------------------------------------------------------------------ */

.mw-cart__summary {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--radius--large);
	background: var(--mw-color-surface-container-low);
}

@media (min-width: 600px) {
	.mw-cart__summary {
		padding: var(--wp--preset--spacing--40);
	}
}

@media (min-width: 1024px) {
	.mw-cart__summary {
		position: sticky;
		top: calc(var(--mw-sticky-top) + var(--wp--preset--spacing--40));
		transition: top var(--mw-motion-slow) var(--mw-easing);
	}
}

/* Title/Large. */
.mw-cart__summary h2 {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
	line-height: 28px;
}

/* Text field "Κωδικός έκπτωσης" with "Εφαρμογή" inside. */
.mw-cart__coupon {
	display: flex;
	flex-direction: column;
	gap: var(--mw-space-2xs);
}

.mw-cart__coupon label {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 22px;
	letter-spacing: 0.1px;
}

.mw-cart__coupon-field {
	display: flex;
	align-items: center;
	height: var(--mw-size-control-lg);
	padding-inline: var(--wp--preset--spacing--30) var(--mw-space-2xs);
	border: var(--mw-border-thin) solid var(--mw-color-outline);
	border-radius: var(--wp--custom--radius--small);
	background: var(--wp--preset--color--white);
}

.mw-cart__coupon-field:focus-within {
	outline: var(--mw-border-thick) solid var(--mw-color-focus);
	outline-offset: -1px;
}

.mw-cart__coupon-field input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	min-height: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--medium);
	text-transform: uppercase;
}

.mw-cart__coupon-field input::placeholder {
	color: var(--mw-color-on-surface-variant);
	text-transform: none;
}

.mw-cart__coupon-field input:focus {
	outline: 0;
}

/* Button / Text. */
.mw-cart__coupon-field button {
	flex: none;
	height: 40px;
	padding: 0 var(--mw-space-sm);
	border: 0;
	border-radius: var(--wp--custom--radius--pill);
	background: none;
	color: var(--wp--preset--color--primary-dark);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
}

.mw-cart__coupon-field button:hover {
	background: color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent);
}

/* Summary list / Order totals. */
.mw-summary {
	display: flex;
	flex-direction: column;
	padding-block: var(--wp--preset--spacing--20) 0;
}

.mw-summary__row {
	display: flex;
	align-items: baseline;
	gap: var(--wp--preset--spacing--30);
	padding-block: var(--mw-space-sm);
	border-bottom: var(--mw-border-thin) solid var(--mw-color-outline-variant);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	line-height: 26px;
}

.mw-summary__row dt {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 var(--wp--preset--spacing--20);
}

.mw-summary__row dd {
	flex: 1 1 auto;
	margin: 0;
	text-align: end;
	white-space: nowrap;
}

.mw-summary__row.is-muted dt {
	color: var(--mw-color-on-surface-variant);
}

.mw-summary__row.is-total {
	border-top: var(--mw-border-thin) solid var(--mw-color-outline-variant);
	border-bottom: 0;
}

.mw-summary__row.is-total dt {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
}

.mw-summary__row.is-total dd {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 24px;
}

.mw-summary__row.is-total dd .woocommerce-Price-amount {
	font-weight: inherit;
}

.mw-summary__remove {
	color: var(--wp--preset--color--primary-dark);
	font-size: var(--mw-font-size-x-small);
}

.mw-summary__note {
	color: var(--mw-color-on-surface-variant);
	font-size: var(--mw-font-size-x-small);
	line-height: 22px;
	letter-spacing: 0.1px;
}

.mw-summary + .mw-summary__note {
	margin-block-start: calc(-1 * var(--wp--preset--spacing--30)) !important;
}

/* Button / Primary, full width, with the forward arrow. */
.mw-cart__checkout.wp-element-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--20);
	min-height: var(--mw-size-control-lg);
	text-decoration: none;
}

.mw-cart__checkout::after {
	content: "";
	width: var(--mw-size-icon-md);
	height: var(--mw-size-icon-md);
	background: currentColor;
	-webkit-mask: var(--mw-icon-arrow-forward) center / contain no-repeat;
	mask: var(--mw-icon-arrow-forward) center / contain no-repeat;
}

/* "ή γρήγορα με" divider and the payment plugins' express buttons. */
.mw-cart__or {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	color: var(--mw-color-on-surface-variant);
	font-size: var(--mw-font-size-x-small);
	line-height: 22px;
}

.mw-cart__or::before,
.mw-cart__or::after {
	content: "";
	flex: 1 1 0;
	height: 1px;
	background: var(--mw-color-outline-variant);
}

/* Stripe shows its element only when the device has a wallet; until then the
   divider and the block stay hidden. */
.mw-cart__or:has(+ .mw-cart__express #wc-stripe-express-checkout-element[style*="none"]),
.mw-cart__express:has(#wc-stripe-express-checkout-element[style*="none"]) {
	display: none;
}

.mw-cart__express #wc-stripe-express-checkout-element {
	margin-top: 0 !important;
}

/* Trust lines: icon 18 + Body/Small. */
.mw-cart__trust {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	padding: 0;
	list-style: none;
}

.mw-cart__trust li {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	color: var(--mw-color-on-surface-variant);
	font-size: var(--mw-font-size-x-small);
	line-height: 22px;
	letter-spacing: 0.1px;
}

.mw-cart__trust li::before {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: var(--mw-trust-icon) center / contain no-repeat;
	mask: var(--mw-trust-icon) center / contain no-repeat;
}

/* ------------------------------------------------------------------ */
/* Empty cart (Design system: Empty state)                             */
/* ------------------------------------------------------------------ */

.mw-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	padding-block: var(--mw-space-xl);
	color: var(--mw-color-on-surface-variant);
	text-align: center;
}

.mw-empty__icon {
	display: grid;
	place-items: center;
	width: 4rem;
	height: 4rem;
	margin-block-end: var(--wp--preset--spacing--30);
	border-radius: 50%;
	background: var(--wp--preset--color--primary-light);
}

.mw-empty__icon::before {
	content: "";
	width: 2rem;
	height: 2rem;
	background: var(--mw-color-on-primary-container);
	-webkit-mask: var(--mw-icon-shopping-bag) center / contain no-repeat;
	mask: var(--mw-icon-shopping-bag) center / contain no-repeat;
}

.mw-empty .mw-empty__title {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.3;
}

.mw-empty .wp-element-button {
	margin-block-start: var(--wp--preset--spacing--30);
	text-decoration: none;
}
