/**
 * NNCC — Carrito WooCommerce · FASE 3.3
 *
 * Hero + pulido incremental sobre style.css (tabla, cupón, totales, focos).
 * Alcance: body.nncc-wc-cart (inc/woocommerce.php). Tokens :root del tema.
 */

/* Understrap: .wrapper { padding: 1.5rem 0 } — page.php (#page-wrapper) o #woocommerce-wrapper */
body.nncc-wc-cart #page-wrapper.wrapper,
body.nncc-wc-cart #woocommerce-wrapper.wrapper {
	overflow-x: hidden;
	padding-top: 0 !important;
	margin-top: 0 !important;
}

body.nncc-wc-cart #content,
body.nncc-wc-cart #primary.content-area,
body.nncc-wc-cart .content-area,
body.nncc-wc-cart .site-main,
body.nncc-wc-cart article.post,
body.nncc-wc-cart article.page,
body.nncc-wc-cart .entry-content {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

body.nncc-wc-cart .entry-content > .woocommerce {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* -------------------------------------------------------------------------
   Hero (misma familia visual que tienda / single; sin imagen de fondo por defecto)
------------------------------------------------------------------------- */
body.nncc-wc-cart .nncc-wc-shop-hero.nncc-wc-cart-hero {
	margin-top: -1.5rem;
	position: relative;
	z-index: 1;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	margin-bottom: clamp(16px, 3vw, 32px);
	width: 100vw;
	max-width: 100vw;
	box-sizing: border-box;
	padding-top: 1.5rem;
	padding-left: 1.25rem;
	padding-right: 1.25rem;
	padding-bottom: clamp(20px, 3.5vw, 40px);
	background-color: var(--nncc-black);
	color: var(--nncc-white);
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

body.nncc-wc-cart .nncc-wc-cart-hero .nncc-wc-shop-hero__inner {
	max-width: 72rem;
	margin: 0 auto;
	padding: 0 0.25rem;
}

body.nncc-wc-cart .nncc-wc-cart-hero__breadcrumb {
	margin-bottom: 1rem;
}

body.nncc-wc-cart .nncc-wc-cart-hero .woocommerce-breadcrumb {
	margin-top: 0;
	margin-bottom: 0;
	font-size: 0.88rem;
	color: rgba(255, 255, 255, 0.78);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

body.nncc-wc-cart .nncc-wc-cart-hero .woocommerce-breadcrumb a {
	color: rgba(255, 255, 255, 0.92);
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

body.nncc-wc-cart .nncc-wc-cart-hero .woocommerce-breadcrumb a:hover {
	color: #fff;
	border-bottom-color: #fff;
}

body.nncc-wc-cart .nncc-wc-shop-hero.nncc-wc-cart-hero .nncc-wc-shop-hero__title {
	font-size: clamp(1.65rem, 2.8vw, 2.15rem);
	font-weight: 800;
	line-height: 1.2;
	color: var(--nncc-white);
	letter-spacing: -0.02em;
	margin: 0 0 0.5rem;
}

body.nncc-wc-cart .nncc-wc-shop-hero.nncc-wc-cart-hero .nncc-wc-shop-hero__title::after {
	content: '';
	display: block;
	width: 3rem;
	height: 4px;
	margin-top: 0.65rem;
	background: var(--nncc-yellow);
	border-radius: 2px;
}

body.nncc-wc-cart .nncc-wc-shop-hero.nncc-wc-cart-hero .nncc-wc-shop-hero__lead {
	font-size: 1.0625rem;
	line-height: 1.65;
	color: rgba(255, 255, 255, 0.88);
	margin: 0.35rem 0 0;
	max-width: 38rem;
}

@media (min-width: 768px) {
	body.nncc-wc-cart .nncc-wc-shop-hero.nncc-wc-cart-hero {
		padding-top: 2rem;
		padding-left: 1.5rem;
		padding-right: 1.5rem;
		padding-bottom: clamp(24px, 4vw, 44px);
	}
}

/* Aire entre notices globales y ficha (si Woo las imprime arriba del article) */
body.nncc-wc-cart .woocommerce-notices-wrapper {
	margin-bottom: clamp(0.75rem, 2vw, 1.25rem);
}

/* -------------------------------------------------------------------------
   Contenedor del shortcode: sin salto raro tras el hero
------------------------------------------------------------------------- */
body.nncc-wc-cart .entry-content > .woocommerce {
	margin-top: 0;
}

/* -------------------------------------------------------------------------
   Tabla: miniaturas, enlaces, remove, alineación
------------------------------------------------------------------------- */
body.nncc-wc-cart table.shop_table .product-thumbnail img {
	border-radius: 10px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	vertical-align: middle;
}

body.nncc-wc-cart table.shop_table td.product-name {
	line-height: 1.45;
}

body.nncc-wc-cart table.shop_table .product-remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 999px;
	font-size: 1.35rem;
	line-height: 1;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

body.nncc-wc-cart table.shop_table .product-remove a.remove:hover {
	background: rgba(0, 0, 0, 0.06);
	color: var(--nncc-black);
}

body.nncc-wc-cart table.shop_table .product-remove a.remove:focus-visible {
	outline: 2px solid var(--nncc-black);
	outline-offset: 2px;
}

body.nncc-wc-cart .quantity input.qty:focus-visible {
	outline: 2px solid var(--nncc-black);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Fila de acciones: cupón (secundario) vs actualizar (secundario explícito)
------------------------------------------------------------------------- */
body.nncc-wc-cart table.shop_table td.actions {
	padding-top: 1.25rem;
	padding-bottom: 1.25rem;
	vertical-align: middle;
}

body.nncc-wc-cart table.shop_table td.actions .coupon {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

body.nncc-wc-cart table.shop_table td.actions .coupon .input-text {
	min-height: 44px;
	border-radius: 10px;
	border: 1px solid rgba(0, 0, 0, 0.18);
	padding: 0.5rem 0.75rem;
}

body.nncc-wc-cart table.shop_table td.actions .coupon .input-text:focus {
	border-color: var(--nncc-black);
	box-shadow: 0 0 0 0.2rem rgba(255, 204, 0, 0.25);
	outline: none;
}

/* Colores/hover: ya definidos en style.css con !important; solo forma + foco */
body.nncc-wc-cart table.shop_table td.actions .button[name='apply_coupon'],
body.nncc-wc-cart table.shop_table td.actions .button[name='update_cart'] {
	border-radius: 999px;
	font-weight: 700;
	min-height: 44px;
	padding-left: 1.1rem;
	padding-right: 1.1rem;
}

body.nncc-wc-cart table.shop_table td.actions .button[name='apply_coupon']:focus-visible,
body.nncc-wc-cart table.shop_table td.actions .button[name='update_cart']:focus-visible {
	outline: 2px solid var(--nncc-black);
	outline-offset: 2px;
}

@media (max-width: 767.98px) {
	body.nncc-wc-cart table.shop_table_responsive tr td.actions {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 1rem;
	}

	body.nncc-wc-cart table.shop_table_responsive tr td.actions::before {
		display: none;
	}

	body.nncc-wc-cart table.shop_table td.actions .coupon {
		width: 100%;
		flex-direction: column;
		align-items: stretch;
	}

	body.nncc-wc-cart table.shop_table td.actions .coupon .input-text {
		width: 100%;
	}

	body.nncc-wc-cart table.shop_table td.actions .button[name='apply_coupon'],
	body.nncc-wc-cart table.shop_table td.actions .button[name='update_cart'] {
		width: 100%;
		justify-content: center;
	}
}

/* -------------------------------------------------------------------------
   Totales: jerarquía (refuerzo; base en style.css)
------------------------------------------------------------------------- */
body.nncc-wc-cart .cart-collaterals {
	margin-top: clamp(1rem, 3vw, 1.75rem);
}

body.nncc-wc-cart .cart-collaterals .cart_totals h2 {
	font-size: clamp(1.05rem, 1.6vw, 1.2rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0 0 0.75rem;
	color: var(--nncc-black);
}

body.nncc-wc-cart .cart-collaterals .cart_totals table.shop_table {
	margin-bottom: 0.75rem;
}

body.nncc-wc-cart .cart-collaterals .wc-proceed-to-checkout {
	margin-top: 0.5rem;
}

/* -------------------------------------------------------------------------
   Mensajes Woo en carrito
------------------------------------------------------------------------- */
body.nncc-wc-cart .woocommerce-message,
body.nncc-wc-cart .woocommerce-info,
body.nncc-wc-cart .woocommerce-error {
	border-radius: 12px;
}

body.nncc-wc-cart .woocommerce-message a.button,
body.nncc-wc-cart .woocommerce-info a.button {
	border-radius: 999px;
	font-weight: 700;
}

body.nncc-wc-cart .woocommerce-message a.button:focus-visible,
body.nncc-wc-cart .woocommerce-info a.button:focus-visible {
	outline: 2px solid var(--nncc-black);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Carrito vacío: botón volver a la tienda
------------------------------------------------------------------------- */
body.nncc-wc-cart .woocommerce .return-to-shop a.button {
	border-radius: 999px;
	font-weight: 700;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

body.nncc-wc-cart .woocommerce .return-to-shop a.button:focus-visible {
	outline: 2px solid var(--nncc-black);
	outline-offset: 3px;
}
