/**
 * Tarjeta de producto (colecciones con la clase dd-products).
 * Diseño: componente ProductCard.
 */
.dd-products .wc-block-product-template {
	gap: var(--wp--preset--spacing--50);
}

.dd-products .wc-block-product {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--preset--color--base);
	box-shadow: var(--wp--preset--shadow--card);
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.dd-products .wc-block-product:hover {
	border-color: #C9D8E4;
	box-shadow: var(--wp--preset--shadow--card-hover);
}

/* Imagen */
.dd-products .dd-product-card__image {
	position: relative;
	margin: 0;
	background: var(--wp--preset--color--surface);
}

.dd-products .dd-product-card__image img {
	display: block;
	width: 100%;
}

/* Insignias (oferta / agotado) arriba a la izquierda */
.dd-products .wc-block-components-product-image__inner-container {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
}

.dd-products .wc-block-components-product-sale-badge,
.dd-products .dd-stock-badge {
	margin: 0;
	padding: 0.25rem 0.625rem;
	border: 0;
	border-radius: var(--wp--custom--radius--sm);
	background: var(--wp--preset--color--sale);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	text-transform: none;
}

/* Cuerpo */
.dd-products .dd-product-card__body {
	flex: 1;
	gap: 0.375rem;
	padding: 1rem;
}

.dd-products .dd-product-card__body > * {
	margin: 0;
}

.dd-product-card__brand {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.dd-product-card__brand a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.dd-products .dd-product-card__title {
	display: -webkit-box;
	min-height: 2.5rem;
	overflow: hidden;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	line-height: 1.43;
	text-wrap: pretty;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.dd-products .dd-product-card__title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.dd-products .dd-product-card__title a:hover {
	color: var(--wp--preset--color--primary);
}

/* Precio: actual en azul, anterior tachado en gris */
.dd-products .dd-product-card__price {
	margin-top: 0.25rem;
}

.dd-products .dd-product-card__price .wc-block-components-product-price {
	display: flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	align-items: baseline;
	gap: 0.5rem;
	color: var(--wp--preset--color--primary);
	font-size: 1.125rem;
	font-weight: 700;
}

.dd-products .dd-product-card__price del {
	color: #7A8CA0;
	font-size: 0.8125rem;
	font-weight: 400;
	opacity: 1;
}

.dd-products .dd-product-card__price ins {
	text-decoration: none;
}

/* Botón al fondo, a lo ancho */
.dd-products .dd-product-card__button {
	align-self: stretch;
	margin-top: auto;
	padding-top: 0.625rem;
}

.dd-products .dd-product-card__button .wp-block-button__link,
.dd-products .dd-product-card__button .wc-block-components-product-button__button {
	--dd-icon: url(../../../icons/shopping-cart.svg);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	height: var(--wp--custom--control-height--sm);
	padding: 0 1rem;
	border-radius: var(--wp--custom--radius--md);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	white-space: nowrap;
}

.dd-products .dd-product-card__button .wp-block-button__link::before,
.dd-products .dd-product-card__button .wc-block-components-product-button__button::before {
	content: "";
	flex: none;
	width: 1.125rem;
	height: 1.125rem;
	background-color: currentColor;
	-webkit-mask: var(--dd-icon) center / contain no-repeat;
	mask: var(--dd-icon) center / contain no-repeat;
}

/*
 * Agotado: etiqueta oscura y texto "Avisarme" (los pone el plugin), imagen
 * apagada, precio en gris y botón de contorno con campana.
 */
.dd-products .dd-stock-badge--sold-out {
	width: fit-content; /* el contenedor de Woo es flex y la estiraría */
	background: var(--wp--preset--color--sold-out);
}

.dd-products .outofstock .dd-product-card__image img {
	opacity: 0.55;
	filter: grayscale(1);
	transition: opacity 0.15s ease, filter 0.15s ease;
}

.dd-products .outofstock:hover .dd-product-card__image img {
	opacity: 0.8;
}

.dd-products .outofstock .dd-product-card__title a {
	color: var(--wp--preset--color--body);
}

.dd-products .outofstock .dd-product-card__price .wc-block-components-product-price {
	color: var(--wp--preset--color--muted);
}

.dd-products .outofstock .dd-product-card__button .wp-block-button__link,
.dd-products .outofstock .dd-product-card__button .wc-block-components-product-button__button {
	--dd-icon: url(../../../icons/bell.svg);
	border: 1.5px solid var(--wp--preset--color--primary);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--primary);
}

/* Móvil (2 columnas angostas) */
@media (max-width: 600px) {
	.dd-products .wc-block-product-template {
		gap: 0.75rem;
	}

	.dd-products .dd-product-card__body {
		padding: 0.75rem;
	}

	.dd-products .dd-product-card__price .wc-block-components-product-price {
		flex-wrap: wrap;
		gap: 0 0.375rem;
		font-size: 1rem;
	}

	.dd-products .dd-product-card__button .wp-block-button__link,
	.dd-products .dd-product-card__button .wc-block-components-product-button__button {
		padding: 0 0.5rem;
		font-size: 0.8125rem;
	}

	.dd-products .dd-product-card__button .wp-block-button__link::before,
	.dd-products .dd-product-card__button .wc-block-components-product-button__button::before {
		display: none;
	}
}
