/* =====================================================================
   NEOPLANET Core - Regalos por importe
   Se carga en carrito y checkout. Las filas de regalo llevan la clase
   .np-regalo y la primera, ademas, .np-regalo-primero.
   En el carrito se destacan con fondo y separador; en el checkout se
   ven como un producto mas, solo con la etiqueta REGALO.
   ===================================================================== */

body.woocommerce-cart,
body.woocommerce-checkout {
	--np-r-marca: #342345;
	--np-r-texto: #2d1a3e;
	--np-r-fondo: #f6f3fb;
	--np-r-borde: #d9cbe9;
	--np-r-suave: #8a7f96;
}

.np-regalo-etiqueta {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--np-r-marca, #342345);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	line-height: 1.2;
	white-space: nowrap;
}

/* Linea "Pedido +70€" bajo el nombre (vale tambien para el mini carrito) */
.np-regalo-tramo {
	display: block;
}


/* ---------------------------------------------------------------
   Carrito
   --------------------------------------------------------------- */

body.woocommerce-cart table.shop_table.cart tr.cart_item.np-regalo {
	position: relative;
	background: var(--np-r-fondo);
	border-bottom-color: var(--np-r-borde);
}

/* Fila anterior al primer regalo: sin linea (la sustituye la discontinua)
   y con mas aire abajo para que la pastilla "Tus regalos" no se pegue
   al selector de cantidad. */
body.woocommerce-cart table.shop_table.cart tr.cart_item:has(+ tr.np-regalo-primero) {
	border-bottom: 0;
	padding-bottom: 34px;
}

/* El ultimo regalo no necesita linea: debajo esta el borde de la tarjeta */
body.woocommerce-cart table.shop_table.cart tr.cart_item.np-regalo:not(:has(+ tr.cart_item)) {
	border-bottom: 0;
}

body.woocommerce-cart table.shop_table.cart tr.cart_item.np-regalo-primero {
	border-top: 1px dashed var(--np-r-borde);
	padding-top: 26px;
}

body.woocommerce-cart table.shop_table.cart tr.cart_item.np-regalo-primero::before {
	content: "Tus regalos";
	position: absolute;
	top: 0;
	left: 18px;
	transform: translateY(-50%);
	padding: 3px 12px;
	border: 1px solid var(--np-r-borde);
	border-radius: 999px;
	background: #fff;
	color: var(--np-r-marca);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	line-height: 1.4;
	text-transform: uppercase;
}

/* El precio unitario sobra: la etiqueta ya va en el subtotal */
body.woocommerce-cart table.shop_table.cart tr.np-regalo td.product-price {
	display: none !important;
}

/* Miniatura sin enlace: mismo marco que el <a> del resto de filas */
body.woocommerce-cart table.shop_table.cart td.product-thumbnail > .np-regalo-thumb {
	position: relative;
	display: block !important;
	width: 88px !important;
	height: 88px !important;
	overflow: hidden;
	border-radius: 10px;
	background: #fff;
}

/* Nombre sin enlace: la celda tiene font-size 0, se le devuelve el tamano */
body.woocommerce-cart table.shop_table.cart td.product-name > .np-regalo-nombre {
	display: block;
	margin: 0 !important;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--np-r-texto);
}

body.woocommerce-cart table.shop_table.cart td.product-name > .np-regalo-tramo {
	margin: 4px 0 0 !important;
	font-size: 13px;
	line-height: 1.45;
	color: var(--np-r-marca);
}

.np-regalo-cantidad {
	display: inline-block;
	margin-top: 4px;
	font-size: 13px;
	color: var(--np-r-suave);
}

@media (max-width: 767px) {

	body.woocommerce-cart table.shop_table.cart tr.cart_item:has(+ tr.np-regalo-primero) {
		padding-bottom: 30px;
	}

	body.woocommerce-cart table.shop_table.cart tr.cart_item.np-regalo-primero {
		padding-top: 24px;
	}

	body.woocommerce-cart table.shop_table.cart td.product-thumbnail > .np-regalo-thumb {
		width: 72px !important;
		height: 72px !important;
	}

	body.woocommerce-cart table.shop_table.cart td.product-name > .np-regalo-nombre {
		font-size: 14px;
	}
}


/* ---------------------------------------------------------------
   Checkout: tabla "Tu pedido"
   Sin fondo ni separador. WooCommerce imprime un &nbsp; detras del
   nombre: con el nombre en bloque y la linea del tramo en linea, ese
   espacio queda al final de "Pedido +70€" en vez de crear una linea
   vacia debajo.
   --------------------------------------------------------------- */

body.woocommerce-checkout .woocommerce-checkout-review-order-table tr.np-regalo .np-regalo-nombre {
	display: block;
	margin-bottom: 4px;
}

body.woocommerce-checkout .woocommerce-checkout-review-order-table tr.np-regalo .np-regalo-tramo {
	display: inline;
	font-size: .85em;
	color: var(--np-r-suave);
}