/**
 * Carrinho lateral, /carrinho/, checkout e área do cliente.
 * Marca: botão Comprar #C94836.
 */

:root {
	--cx-brand: #c94836;
	--cx-brand-dark: #a8382a;
	--cx-brand-soft: #f8f1ef;
	--cx-text: #1f2933;
	--cx-muted: #69727d;
	--cx-line: #e8e2dc;
	--cx-card: #ffffff;
	--cx-radius: 10px;
	--cx-shadow: 0 10px 32px rgba(31, 41, 51, 0.12);
}

/* ---------- Avisos ---------- */

.woocommerce-message,
.woocommerce-info,
.wc-block-components-notice-banner.is-success {
	border-radius: var(--cx-radius) !important;
	border-top: 0 !important;
	border-left: 4px solid var(--cx-brand) !important;
	background: var(--cx-brand-soft) !important;
	color: var(--cx-text) !important;
}

.woocommerce-message a.button,
.woocommerce-message .button {
	background: var(--cx-brand) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 8px !important;
	font-weight: 600;
}

/* ---------- Carrinho do header / painel lateral ---------- */

.elementor-menu-cart__toggle_button {
	gap: 6px;
}

.elementor-menu-cart__toggle .elementor-button-icon {
	color: var(--cx-text);
}

.elementor-menu-cart--items-indicator-bubble .elementor-button-icon-qty {
	background: var(--cx-brand) !important;
	color: #fff !important;
}

.elementor-menu-cart__container.elementor-lightbox {
	background: rgba(31, 41, 51, 0.45);
}

.elementor-menu-cart__main {
	width: min(420px, 100vw) !important;
	height: 100vh !important;
	max-height: 100dvh !important;
	padding: 0 !important;
	background: var(--cx-card);
	box-shadow: var(--cx-shadow);
	border-radius: 0;
	display: flex !important;
	flex-direction: column !important;
}

.elementor-menu-cart__main::before {
	content: none;
}

.cx-side-cart-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 22px 56px 18px 22px;
	border-bottom: 1px solid var(--cx-line);
	font-family: Roboto, sans-serif;
}

.cx-side-cart-head strong {
	font-size: 1.2rem;
	color: var(--cx-text);
}

.cx-side-cart-head span {
	font-size: 0.88rem;
	color: var(--cx-muted);
}

.elementor-menu-cart__close-button {
	top: 18px !important;
	right: 16px !important;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	background: var(--cx-brand-soft);
	z-index: 2;
}

.elementor-menu-cart__close-button:hover {
	background: #f0d9d4;
}

.elementor-menu-cart__main .widget_shopping_cart_content {
	display: flex !important;
	flex-direction: column !important;
	flex: 1 1 auto;
	padding: 0;
	min-height: 0;
}

.elementor-menu-cart__products {
	flex: 1 1 auto;
	overflow: auto;
	padding: 8px 22px;
}

.elementor-menu-cart__product {
	display: grid !important;
	grid-template-columns: 76px minmax(0, 1fr) 28px;
	grid-template-areas:
		"img name remove"
		"img price remove";
	gap: 4px 12px;
	align-items: start;
	margin: 10px 0;
	padding: 12px !important;
	border: 1px solid var(--cx-line);
	border-radius: 10px;
	background: #fff;
}

.elementor-menu-cart__product-image {
	grid-area: img;
}

.elementor-menu-cart__product-image img {
	width: 76px;
	height: 58px;
	object-fit: cover;
	border-radius: 8px;
	background: #f3f0ec;
}

.elementor-menu-cart__product-name {
	grid-area: name;
	font-weight: 600;
	line-height: 1.3;
	min-width: 0;
}

.elementor-menu-cart__product-name a {
	color: var(--cx-text);
	text-decoration: none;
}

.elementor-menu-cart__product-price {
	grid-area: price;
	color: var(--cx-muted);
	font-size: 0.92rem;
}

.elementor-menu-cart__product-remove {
	grid-area: remove;
	justify-self: end;
}

.elementor-menu-cart__product-remove a + a {
	display: none;
}

.elementor-menu-cart__product-remove a {
	width: 28px;
	height: 28px;
	border-radius: 999px;
	background: var(--cx-brand-soft);
}

.cx-side-cart-foot {
	margin-top: auto;
	background: #fff;
	box-shadow: 0 -8px 24px rgba(31, 41, 51, 0.06);
}

.elementor-menu-cart__footer {
	margin-top: auto;
}

.elementor-menu-cart__subtotal,
.elementor-menu-cart__footer-buttons {
	position: static !important;
	width: auto !important;
}

.elementor-menu-cart__subtotal {
	margin: 0;
	padding: 16px 22px;
	border-top: 1px solid var(--cx-line);
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 1.05rem;
	background: #fff;
}

.elementor-menu-cart__footer-buttons {
	display: flex !important;
	flex-direction: column !important;
	gap: 8px;
	margin: 0;
	padding: 0 22px 22px !important;
	background: #fff;
}

.elementor-menu-cart__footer-buttons .elementor-button {
	width: 100% !important;
	text-align: center;
	border-radius: 8px !important;
	font-weight: 700;
	padding: 13px 16px !important;
	transition: background 0.15s ease, color 0.15s ease;
}

.elementor-menu-cart__footer-buttons .elementor-button--view-cart {
	background: #fff !important;
	color: var(--cx-brand) !important;
	border: 1.5px solid var(--cx-brand) !important;
	order: 2;
}

.elementor-menu-cart__footer-buttons .elementor-button--checkout {
	background: var(--cx-brand) !important;
	color: #fff !important;
	border: 1.5px solid var(--cx-brand) !important;
	order: 1;
}

.elementor-menu-cart__footer-buttons .elementor-button--view-cart:hover,
.elementor-menu-cart__footer-buttons .elementor-button--checkout:hover {
	background: var(--cx-brand-dark) !important;
	color: #fff !important;
	border-color: var(--cx-brand-dark) !important;
}

/* ---------- Páginas Woo: largura e fundo ---------- */

.woocommerce-cart .site-main,
.woocommerce-checkout .site-main,
.woocommerce-account .site-main,
body.woocommerce-cart .elementor-location-single,
body.woocommerce-checkout .elementor-location-single,
body.woocommerce-account .elementor-location-single {
	background: #faf8f6;
}

.woocommerce-cart h1.wp-block-post-title,
.woocommerce-checkout h1.wp-block-post-title,
.woocommerce-account h1.wp-block-post-title,
.woocommerce-cart .entry-title,
.woocommerce-checkout .entry-title,
.woocommerce-account .entry-title {
	max-width: 1040px !important;
	width: 100%;
	margin: 8px auto 0 !important;
	padding: 8px 24px 0;
	box-sizing: border-box;
	font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.wp-block-woocommerce-cart,
.wp-block-woocommerce-cart.alignwide,
.wp-block-woocommerce-checkout,
.woocommerce-account .woocommerce {
	max-width: 1040px !important;
	width: 100%;
	margin: 8px auto 32px !important;
	padding: 8px 24px 8px;
	box-sizing: border-box;
}

/* ---------- Página do carrinho ---------- */

.wc-block-cart.wc-block-components-sidebar-layout,
.wp-block-woocommerce-filled-cart-block {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 24px !important;
	align-items: start !important;
	width: 100%;
}

.wc-block-cart__main,
.wc-block-cart__sidebar {
	flex: none !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
}

.wc-block-cart-items,
.wp-block-woocommerce-cart-order-summary-block,
.wc-block-cart__sidebar {
	background: var(--cx-card);
	border: 1px solid var(--cx-line);
	border-radius: 12px;
	padding: 8px 16px 16px;
	box-shadow: 0 1px 2px rgba(31, 41, 51, 0.04);
}

.wc-block-cart-items,
.wc-block-cart-items tbody {
	display: block;
	width: 100%;
}

.wc-block-cart-items__header {
	display: none;
}

.wc-block-cart-items__row {
	display: flex !important;
	align-items: center;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--cx-line);
}

.wc-block-cart-items__row:last-child {
	border-bottom: 0;
}

.wc-block-cart-item__image,
.wc-block-cart-item__product,
.wc-block-cart-item__total {
	display: block;
	width: auto;
	border: 0 !important;
	padding: 0 !important;
}

.wc-block-cart-item__product {
	flex: 1 1 auto;
	min-width: 0;
}

.wc-block-cart-item__total {
	flex: 0 0 auto;
	text-align: right;
	font-weight: 700;
	white-space: nowrap;
}

.wc-block-cart-item__image img {
	width: 76px;
	height: 76px;
	object-fit: cover;
	border-radius: 8px;
}

.wc-block-cart-item__wrap {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.wc-block-cart-item__product a {
	color: var(--cx-text);
	font-weight: 600;
	text-decoration: none;
}

.wc-block-components-product-metadata,
.wc-block-cart-item__product .wc-block-components-product-details {
	display: none !important;
}

.wc-block-cart-item__prices .price,
.wc-block-cart-item__prices .wc-block-components-product-price {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	line-height: 1.25;
}

.wc-block-cart-item__prices .price del,
.wc-block-cart-item__prices del {
	color: var(--cx-muted);
	font-size: 0.85em;
	font-weight: 400;
}

.wc-block-cart__submit-button,
.wc-block-cart__submit .wc-block-components-button,
a.checkout-button,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce #place_order {
	background: var(--cx-brand) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 8px !important;
	font-weight: 700 !important;
	min-height: 48px;
}

.wc-block-cart__submit-button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
	background: var(--cx-brand-dark) !important;
}

.comexito-pj-cart-banner {
	max-width: 1040px;
	width: 100%;
	margin: 0 auto 40px;
	padding: 14px 24px;
	box-sizing: border-box;
	background: var(--cx-brand-soft);
	color: var(--cx-text);
	border: 1px solid #efc4bd;
	border-radius: var(--cx-radius);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.comexito-pj-cart-banner p {
	margin: 0;
	flex: 1 1 240px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
}

.comexito-pj-cart-banner a {
	flex: 0 0 auto;
	display: inline-block;
	background: var(--cx-brand);
	color: #fff;
	font-weight: 700;
	font-size: 13px;
	text-decoration: none;
	padding: 8px 14px;
	border-radius: 8px;
	white-space: nowrap;
}

.comexito-pj-cart-banner a:hover {
	background: var(--cx-brand-dark);
	color: #fff;
}

.wp-block-woocommerce-cart .comexito-pj-cart-banner {
	max-width: none;
	margin: 16px 0 8px;
	padding: 14px 18px;
	grid-column: 1 / -1;
}

/* ---------- Checkout ---------- */

.wc-block-components-text-input input,
.wc-block-components-text-input textarea,
.wc-block-components-combobox input,
.wc-block-components-select select,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-form-login input,
.woocommerce-form-register input {
	border-radius: 8px !important;
	border-color: #d5cfc8 !important;
	min-height: 46px;
	background: #fff;
}

.wc-block-components-text-input input:focus,
.woocommerce form .form-row input.input-text:focus,
.woocommerce-form-login input:focus,
.woocommerce-form-register input:focus {
	border-color: var(--cx-brand) !important;
	box-shadow: 0 0 0 3px rgba(201, 72, 54, 0.16) !important;
	outline: none;
}

.wc-block-components-checkout-place-order-button,
.wc-block-components-checkout-step__next,
.wc-block-checkout__actions_row .wc-block-components-button {
	background: var(--cx-brand) !important;
	color: #fff !important;
	border-radius: 8px !important;
	font-weight: 700 !important;
	min-height: 48px;
}

.wp-block-woocommerce-checkout-order-summary-block,
.wc-block-components-order-summary {
	background: var(--cx-card);
	border: 1px solid var(--cx-line);
	border-radius: 12px;
	padding: 8px 4px 12px;
}

.cx-nf-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 4px 0 12px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--cx-brand);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.cx-nf-toggle:hover {
	color: var(--cx-brand-dark);
}

body.cx-nf-collapsed .cx-nf-field,
body.cx-nf-collapsed .wc-block-components-address-form button {
	display: none !important;
}

/* ---------- Minha conta ---------- */

.woocommerce-account .u-columns,
.woocommerce-account .col2-set {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 24px;
	align-items: start;
	width: 100%;
}

.woocommerce-account .col-1,
.woocommerce-account .col-2,
.woocommerce-account .u-column1,
.woocommerce-account .u-column2 {
	width: 100% !important;
	float: none !important;
	max-width: none !important;
}

.woocommerce-form-login,
.woocommerce-form-register,
.woocommerce-EditAccountForm,
.woocommerce-ResetPassword {
	background: var(--cx-card);
	border: 1px solid var(--cx-line);
	border-radius: 12px;
	padding: 24px;
	box-shadow: 0 1px 2px rgba(31, 41, 51, 0.04);
}

.woocommerce-form-login .woocommerce-button,
.woocommerce-form-register .woocommerce-button,
.woocommerce-EditAccountForm button,
.woocommerce-ResetPassword button,
.woocommerce-account .woocommerce-Button {
	background: var(--cx-brand) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 8px !important;
	font-weight: 700;
	padding: 10px 18px;
}

.woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.woocommerce-MyAccount-navigation li a {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--cx-line);
	color: var(--cx-text);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.92rem;
}

.woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-MyAccount-navigation li a:hover {
	background: var(--cx-brand);
	border-color: var(--cx-brand);
	color: #fff;
}

.woocommerce-MyAccount-content {
	background: var(--cx-card);
	border: 1px solid var(--cx-line);
	border-radius: 12px;
	padding: 20px 22px;
}

.woocommerce table.my_account_orders,
.woocommerce-orders-table {
	border: 1px solid var(--cx-line);
	border-radius: 10px;
	overflow: hidden;
}

.woocommerce table.shop_table th {
	background: #f6f3f0;
	font-size: 0.8rem;
	letter-spacing: 0.03em;
}

@media (max-width: 900px) {
	.wc-block-cart.wc-block-components-sidebar-layout,
	.wp-block-woocommerce-filled-cart-block {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 781px) {
	.elementor-menu-cart__main {
		width: 100% !important;
	}

	.woocommerce-MyAccount-content,
	.woocommerce-form-login,
	.woocommerce-form-register {
		padding: 16px;
	}
}
