/* Purchase flow (PurchaseFlow.php + purchase-flow.js). */

/* ---------- Free shipping progress bar (mini cart, cart, checkout) ---------- */
.amless-ship-bar {
	margin: 0 0 20px;
	padding: 14px 16px;
	border-radius: 12px;
	background: #f3efea;
	color: #202025;
}

.amless-ship-bar__text {
	margin: 0 0 10px !important;
	font-size: 14px;
	line-height: 1.4;
}

.amless-ship-bar__text .woocommerce-Price-amount,
.amless-ship-bar__text strong {
	font-weight: 700;
}

.amless-ship-bar__track {
	display: block;
	height: 6px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(32, 32, 37, 0.12);
}

.amless-ship-bar__fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: #202025;
	transition: width 0.4s ease;
}

.amless-ship-bar.is-done {
	background: #e8f3ea;
}

.amless-ship-bar.is-done .amless-ship-bar__fill {
	background: #2e7d4f;
}

.mbf-shop-minicart .amless-ship-bar {
	margin: 0 0 16px;
}

/* ---------- Reassurance line under the cart / checkout buttons ---------- */
.amless-trust-line {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 16px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
	font-size: 12px;
	color: var(--mbf-color-secondary, #6b6a70);
}

.amless-trust-line li {
	margin: 0;
	padding-left: 18px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%232e7d4f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat 0 50% / 12px;
}

/* ---------- Cart block ---------- */
/* Section headings were ~40px ("Produtos", "Totais do carrinho"). */
.wc-block-cart .wc-block-cart-items__header,
.wc-block-cart .wc-block-cart-items__header th,
.wc-block-cart .wc-block-cart__totals-title {
	font-size: 18px !important;
	line-height: 1.3 !important;
	letter-spacing: 0 !important;
}

/* Primary action: solid dark, like the checkout's "Finalizar encomenda". */
.wc-block-cart .wc-block-cart__submit-button,
.wc-block-cart__submit-container--sticky .wc-block-cart__submit-button {
	min-height: 52px;
	border: 0 !important;
	border-radius: 10px !important;
	background: #202025 !important;
	color: #fff !important;
	font-size: 16px !important;
	font-weight: 600 !important;
}

.wc-block-cart .wc-block-cart__submit-button:hover {
	opacity: 0.88;
}

/* Line total ran past the right edge on phones. */
@media (max-width: 699px) {
	.wc-block-cart .wc-block-cart-items {
		table-layout: fixed;
		width: 100%;
	}

	.wc-block-cart .wc-block-cart-item__total {
		padding-right: 0 !important;
		white-space: nowrap;
	}

	.wc-block-cart .wc-block-cart-items__row {
		grid-template-columns: 72px minmax(0, 1fr) auto !important;
	}
}

/* ---------- Checkout block ---------- */
/* "Informação de contacto" and "Iniciar sessão" overlapped on phones. */
.wc-block-checkout .wc-block-components-checkout-step__heading {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
}

.wc-block-checkout .wc-block-components-checkout-step__heading .wc-block-checkout__login-prompt {
	position: static !important;
	margin: 0 !important;
	font-size: 14px;
	white-space: nowrap;
}

/* EuPago's MB WAY country code select is forced to width:20% inline. */
.wc-block-checkout .wc-block-components-radio-control-accordion-content select {
	width: auto !important;
	max-width: none !important;
	flex: 0 0 auto;
	min-width: 132px !important;
}

/* The theme prints "Produtos" / "Totais do carrinho" as ::before headings at 35px. */
.wp-block-woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar:before,
.wp-block-woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-main:before {
	font-size: 22px !important;
	margin-bottom: 14px !important;
}

/* "Completa o look" (cross-sells collection): same cards as the homepage rows. */
.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection {
	margin-top: 32px;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection h2 {
	font-size: 22px !important;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection .wc-block-product {
	text-align: left !important;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection .wc-block-components-product-image img {
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: 12px;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection .wp-block-post-title,
.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection .wp-block-post-title a {
	margin: 10px 0 4px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	text-align: left !important;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection .wc-block-components-product-price {
	justify-content: flex-start !important;
	margin: 0 0 8px !important;
	font-size: 14px !important;
	text-align: left !important;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection .wp-block-button,
.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection .wc-block-components-product-button {
	justify-content: flex-start !important;
	text-align: left !important;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection .wp-block-button__link,
.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection .wc-block-components-product-button__button {
	min-height: 0 !important;
	padding: 8px 14px !important;
	border: 1px solid #202025 !important;
	border-radius: 999px !important;
	background: transparent !important;
	color: #202025 !important;
	font-size: 13px !important;
	font-weight: 600 !important;
}

/* "Completa o look" swipe row in the cart (inserted by purchase-flow.js). */
.amless-cart-xs {
	margin: 32px 0 8px;
}

.amless-cart-xs .amless-cart-xs__title {
	margin: 0 0 14px;
	font-size: 22px !important;
	line-height: 1.3;
}

/* ---------- Cart (desktop + phone): one clean totals card, closed table ---------- */
.wp-block-woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar {
	align-self: flex-start;
	padding: 28px 32px 24px !important;
	border-radius: 16px;
	background: var(--mbf-layout-background, #f6f6f6);
}

.wp-block-woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar > * {
	padding-left: 0 !important;
	padding-right: 0 !important;
	background: transparent !important;
}

/* "Totais do carrinho" is already the card's heading. */
.wp-block-woocommerce-cart .wc-block-cart__totals-title {
	display: none !important;
}

.wp-block-woocommerce-cart .wc-block-components-totals-wrapper {
	padding-top: 12px !important;
	padding-bottom: 12px !important;
}

.wp-block-woocommerce-cart .wc-block-components-totals-item {
	margin: 0 !important;
	padding: 4px 0 !important;
}

.wp-block-woocommerce-cart .wc-block-cart__submit {
	margin: 8px 0 0 !important;
}

/* Items table: header in small caps, every row closed by one full-width line. */
.wp-block-woocommerce-cart .wc-block-cart-items th {
	padding: 10px 0 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--mbf-color-secondary, #79787f) !important;
}

.wp-block-woocommerce-cart .wc-block-cart-items td,
.wp-block-woocommerce-cart .wc-block-cart-items th {
	border-top: 0 !important;
	border-bottom: 1px solid var(--mbf-color-border, #e5e3e8) !important;
}

.wp-block-woocommerce-cart .wc-block-cart-items .wc-block-cart-item__total {
	vertical-align: top;
}

.wp-block-woocommerce-cart .wc-block-components-product-name {
	font-size: 15px !important;
	font-weight: 600 !important;
}

/* ---------- Checkout order summary ---------- */
/* Quantity badge on the thumbnail: was an empty white circle. */
.wc-block-checkout .wc-block-components-order-summary-item__quantity {
	min-width: 20px !important;
	height: 20px !important;
	padding: 0 5px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: #202025 !important;
	color: #fff !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	line-height: 20px !important;
	box-shadow: none !important;
}

.wc-block-checkout .wc-block-components-order-summary-item__quantity span[aria-hidden] {
	color: #fff !important;
}

/* "Poupa 1,40 €" badges were cut to "Poupa". */
.wc-block-components-sale-badge {
	width: auto !important;
	max-width: none !important;
	white-space: nowrap !important;
	overflow: visible !important;
}

.wc-block-checkout .wc-block-components-totals-item__label,
.wc-block-checkout .wc-block-components-totals-item__value {
	color: #202025 !important;
}

/* The theme lays rows out as grids, so per-cell borders end at different
   heights: draw one line per row instead, and keep the thumbnail size. */
.wp-block-woocommerce-cart .wc-block-cart-items td {
	border-bottom: 0 !important;
}

.wp-block-woocommerce-cart .wc-block-cart-items .wc-block-cart-items__row {
	border-bottom: 1px solid var(--mbf-color-border, #e5e3e8) !important;
}

.wp-block-woocommerce-cart .wc-block-cart-item__image,
.wp-block-woocommerce-cart .wc-block-cart-item__image img {
	width: 88px !important;
	min-width: 88px;
}

@media (max-width: 699px) {
	.wp-block-woocommerce-cart .wc-block-cart-item__image,
	.wp-block-woocommerce-cart .wc-block-cart-item__image img {
		width: 72px !important;
		min-width: 72px;
	}
}

/* Smaller cards in the cart's "Completa o look": ~2.5 per row on phones, 4–5 on desktop. */
.amless-cart-xs .amless-look__card {
	flex: 0 0 calc(38% - 8px) !important;
	width: auto !important;
}

.amless-cart-xs .amless-look__name,
.amless-cart-xs .amless-look__price {
	font-size: 13px !important;
}

@media (min-width: 700px) {
	.amless-cart-xs .amless-look__card {
		flex: 0 0 160px !important;
	}
}

/* Separate-border tables don't paint <tr> borders: draw the row line as a shadow. */
.wp-block-woocommerce-cart .wc-block-cart-items .wc-block-cart-items__row {
	box-shadow: inset 0 -1px 0 var(--mbf-color-border, #e5e3e8);
}

/* ---------- Site-wide: every button is a pill (as in the homepage banners) ---------- */
.button,
a.button,
button.button,
input[type="submit"],
input[type="button"],
.wp-block-button__link,
.wp-element-button,
.wc-block-components-button:not(.wc-block-components-panel__button):not(.wc-block-components-quantity-selector__button),
.single_add_to_cart_button,
.woocommerce-button,
.amless-quality__cta,
.amless-gc-banner__cta,
.amless-cta,
.mbf-button,
.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button,
.wc-block-components-totals-coupon__button,
.amless-look__cta {
	border-radius: 999px !important;
}

/* ---------- Login / Registar: a clear two-option switch ---------- */
body:not(.logged-in) .woocommerce-MyAccount-navigation {
	max-width: 480px;
	margin: 0 auto 28px !important;
	padding: 4px !important;
	border: 0 !important;
	border-radius: 999px;
	background: #f3efea !important;
}

body:not(.logged-in) .woocommerce-MyAccount-navigation ul {
	display: flex !important;
	gap: 4px;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

body:not(.logged-in) .woocommerce-MyAccount-navigation li {
	flex: 1 1 0;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

body:not(.logged-in) .woocommerce-MyAccount-navigation li a {
	display: block !important;
	padding: 12px 10px !important;
	border: 0 !important;
	border-radius: 999px;
	background: transparent !important;
	color: #55545b !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	text-align: center;
	text-decoration: none !important;
	box-shadow: none !important;
}

body:not(.logged-in) .woocommerce-MyAccount-navigation li.is-active a {
	background: #202025 !important;
	color: #fff !important;
}

body:not(.logged-in) .woocommerce-MyAccount-navigation li::before,
body:not(.logged-in) .woocommerce-MyAccount-navigation li a::before {
	display: none !important;
}

body:not(.logged-in) .woocommerce-MyAccount-content,
body:not(.logged-in) .woocommerce form.login,
body:not(.logged-in) .woocommerce form.register {
	max-width: 480px;
	margin-left: auto !important;
	margin-right: auto !important;
}

body:not(.logged-in) .woocommerce-MyAccount-navigation ul {
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	background: transparent !important;
}

body:not(.logged-in) .woocommerce-MyAccount-navigation li {
	width: auto !important;
	background: transparent !important;
}

/* ---------- Phones: one heading scale for the whole site ---------- */
@media (max-width: 781px) {
	/* Page titles ("Loja", "A minha conta", "Leggings"…). */
	.mbf-site-content h1,
	.woocommerce-products-header__title,
	.mbf-entry__title {
		font-size: 28px !important;
		line-height: 1.15 !important;
	}

	.single-product h1.product_title {
		font-size: 22px !important;
		line-height: 1.25 !important;
	}

	/* Section titles ("Também vais gostar", "Completa o look", "Descrição"…).
	   Not product card names: on shop/category pages those stay H2 (HeadingOutline). */
	.mbf-site-content h2:not(.wp-block-cover h2):not(.amless-ty__title):not(.woocommerce-loop-product__title),
	.woocommerce-panel-subheading,
	.related > h2,
	.up-sells > h2,
	.amless-look__title,
	.amless-cart-xs .amless-cart-xs__title {
		font-size: 22px !important;
		line-height: 1.2 !important;
		letter-spacing: -0.01em;
	}

	/* Banner headlines stay a step above section titles. */
	.amless-quality__title,
	.amless-gc-banner__title,
	.amless-featured__title,
	.amless-ty__title {
		font-size: 24px !important;
		line-height: 1.15 !important;
	}

	.mbf-site-content h3 {
		font-size: 18px !important;
		line-height: 1.3 !important;
	}

	/* The cart's "Produtos" / "Totais do carrinho" pseudo-headings. */
	.wp-block-woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar:before,
	.wp-block-woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-main:before {
		font-size: 20px !important;
	}
}
