/*
 * Muebles DAJ - Estilos para el bloque nativo de Carrito de WooCommerce
 * (wc-block-cart). Solo CSS: no se toca ningún markup, así que el
 * comportamiento del bloque (React/Store API) queda intacto.
 * Reutiliza las variables --mdaj-* definidas en shop.css.
 */

.wp-block-woocommerce-cart {
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px 32px 60px;
}

/* El CSS base de WooCommerce Blocks arma el layout de 2 columnas con
   float + width:50% (no con flex/grid). Si esa hoja de estilo no llega a
   aplicarse (por ejemplo por optimización de CSS del hosting), lo
   garantizamos nosotros mismos con la misma técnica. */
.wc-block-components-sidebar-layout .wc-block-components-main {
	box-sizing: border-box;
	float: left;
	margin: 0;
	padding-right: 4.5283018868%;
	width: 50%;
}

.wc-block-components-sidebar-layout .wc-block-components-sidebar {
	box-sizing: border-box;
	float: right;
	margin: 0;
	width: 50%;
}

.wc-block-components-sidebar-layout::after {
	content: "";
	display: table;
	clear: both;
}

@media (max-width: 900px) {
	.wc-block-components-sidebar-layout .wc-block-components-main,
	.wc-block-components-sidebar-layout .wc-block-components-sidebar {
		float: none;
		width: 100%;
		padding-right: 0;
	}

	.wc-block-components-sidebar-layout .wc-block-components-sidebar {
		margin-top: 32px;
	}
}

/* Columna principal: tabla de productos */
.wc-block-cart__main {
	background: #fff;
	border: 1px solid var(--mdaj-border);
	border-radius: 14px;
	padding: 8px 24px;
}

.wc-block-cart-items {
	width: 100%;
	border-collapse: collapse;
}

.wc-block-cart-items__header th {
	text-align: left;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #9a958f;
	padding: 16px 8px;
	border-bottom: 1px solid var(--mdaj-border);
}

.wc-block-cart-items__row td {
	padding: 20px 8px;
	border-bottom: 1px solid var(--mdaj-border);
	vertical-align: top;
}

.wc-block-cart-item__image img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 10px;
	background: var(--mdaj-media-bg);
}

.wc-block-components-product-name {
	font-size: 15px;
	font-weight: 700;
	color: var(--mdaj-dark);
	text-decoration: none;
}

.wc-block-components-product-name:hover {
	color: var(--mdaj-orange);
}

.wc-block-cart-item__prices .wc-block-components-product-price,
.wc-block-cart-item__prices .wc-block-formatted-money-amount {
	font-size: 13px;
	color: #9a958f;
	font-weight: 500;
}

.wc-block-components-product-metadata__description p {
	font-size: 13px;
	color: #9a958f;
	margin: 4px 0 0;
}

/* Selector de cantidad */
.wc-block-components-quantity-selector {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--mdaj-border);
	border-radius: 999px;
	overflow: hidden;
	margin-top: 10px;
	width: fit-content;
}

.wc-block-components-quantity-selector__input {
	width: 40px;
	border: none;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--mdaj-dark);
	background: transparent;
	-moz-appearance: textfield;
}

.wc-block-components-quantity-selector__button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: var(--mdaj-media-bg);
	color: var(--mdaj-dark);
	font-size: 16px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wc-block-components-quantity-selector__button:hover {
	background: var(--mdaj-orange);
	color: #fff;
}

.wc-block-cart-item__remove-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin-top: 10px;
	margin-left: 8px;
	border: none;
	border-radius: 999px;
	background: var(--mdaj-media-bg);
	color: var(--mdaj-dark);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wc-block-cart-item__remove-link:hover {
	background: #e33;
	color: #fff;
}

.wc-block-cart-item__remove-link svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.wc-block-cart-item__total .wc-block-components-product-price {
	font-size: 15px;
	font-weight: 700;
	color: var(--mdaj-orange);
}

/* Sidebar: totales */
.wc-block-cart__sidebar {
	background: #fff;
	border: 1px solid var(--mdaj-border);
	border-radius: 14px;
	padding: 22px;
}

@media (min-width: 901px) {
	.wc-block-cart__sidebar {
		position: sticky;
		top: 24px;
	}
}

.wc-block-cart__totals-title {
	font-size: 18px;
	font-weight: 800;
	color: var(--mdaj-dark);
	margin: 0 0 16px;
}

.wc-block-components-totals-item {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--mdaj-border);
	font-size: 14px;
	color: var(--mdaj-dark);
}

.wc-block-components-totals-item__label {
	color: #6b6660;
}

.wc-block-components-totals-footer-item {
	border-bottom: none;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	font-size: 20px;
	font-weight: 800;
	color: var(--mdaj-green);
}

.wc-block-components-totals-shipping__via {
	font-size: 12px;
	color: #9a958f;
}

/* Acordeón de cupón */
.wc-block-components-totals-coupon .wc-block-components-panel__button {
	display: flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	padding: 12px 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--mdaj-orange);
	text-transform: uppercase;
	letter-spacing: 0.02em;
	cursor: pointer;
}

.wc-block-components-totals-coupon .wc-block-components-panel__button-icon {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Botón "Finalizar compra" */
.wc-block-cart__submit-button,
a.wc-block-cart__submit-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 16px 20px !important;
	background: var(--mdaj-orange) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 10px !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.wc-block-cart__submit-button:hover {
	background: #8a3f07 !important;
}

.wc-block-cart__submit-button:active {
	transform: scale(0.98);
}

/* Carrito vacío */
.wc-block-cart__empty-cart__title {
	font-size: 24px;
	font-weight: 800;
	color: var(--mdaj-dark);
}

.wc-block-cart__empty-cart .wc-block-components-button {
	background: var(--mdaj-orange) !important;
	border-radius: 10px !important;
}
