.cda-shop {
	--cda-pink: #f4c2d1;
	--cda-black: #1a1a1a;
	--cda-white: #ffffff;
	--cda-font-heading: 'Fredoka', Verdana, sans-serif;
	--cda-font-body: 'Quicksand', Verdana, sans-serif;

	padding: 32px 0 64px;
	font-family: var(--cda-font-body);
	color: var(--cda-black);
}

/* Título de la página (tienda / categoría / etiqueta / búsqueda) */
.cda-shop .page-title,
.cda-shop h1.woocommerce-products-header__title {
	font-family: var(--cda-font-heading);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	font-size: clamp(26px, 4vw, 40px);
	margin: 0 0 28px;
	text-align: center;
}

.cda-shop .term-description,
.cda-shop .woocommerce-products-header__description {
	max-width: 640px;
	margin: -14px auto 28px;
	text-align: center;
	color: #666;
	font-size: 14px;
}

/* -------------------------------------------------------------------------
 * Barra de filtros
 * ---------------------------------------------------------------------- */

.cda-shop-filters {
	margin-bottom: 36px;
}

.cda-shop-filters__toggle {
	display: none;
	width: 100%;
	padding: 13px 20px;
	background: var(--cda-black);
	color: var(--cda-white);
	border: 0;
	border-radius: 999px;
	font-family: var(--cda-font-body);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
}

.cda-shop-filters__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 12px;
	padding: 16px;
	background: #fdf3f6;
	border-radius: 14px;
}

.cda-filter {
	position: relative;
}

.cda-filter summary {
	list-style: none;
	cursor: pointer;
	padding: 10px 18px;
	background: var(--cda-white);
	border: 1px solid #eed9df;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.cda-filter summary::-webkit-details-marker {
	display: none;
}

.cda-filter summary::after {
	content: '';
	width: 7px;
	height: 7px;
	border-right: 1.5px solid var(--cda-black);
	border-bottom: 1.5px solid var(--cda-black);
	transform: rotate(45deg);
	margin-left: 4px;
	transition: transform 0.2s ease;
}

.cda-filter[open] summary::after {
	transform: rotate(-135deg);
}

.cda-filter[open] summary {
	background: var(--cda-black);
	color: var(--cda-white);
	border-color: var(--cda-black);
}

.cda-filter[open] summary::after {
	border-color: var(--cda-white);
}

.cda-filter__count {
	color: var(--cda-pink);
}

.cda-filter[open] .cda-filter__count {
	color: var(--cda-pink);
}

.cda-filter__panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 20;
	min-width: 200px;
	max-height: 280px;
	overflow-y: auto;
	background: var(--cda-white);
	border-radius: 10px;
	box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14);
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cda-filter__panel--price {
	flex-direction: row;
	gap: 12px;
	min-width: 220px;
}

.cda-filter__panel--price label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	color: #777;
}

.cda-filter__panel--price input {
	width: 90px;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-family: var(--cda-font-body);
}

.cda-filter__option {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	cursor: pointer;
	white-space: nowrap;
}

.cda-filter__option input {
	accent-color: var(--cda-pink);
	width: 16px;
	height: 16px;
}

.cda-shop-filters__submit {
	margin-left: auto;
	padding: 11px 26px;
	background: var(--cda-pink);
	color: var(--cda-black);
	border: 0;
	border-radius: 999px;
	font-family: var(--cda-font-body);
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.cda-shop-filters__submit:hover {
	opacity: 0.85;
}

.cda-shop-filters__reset {
	align-self: center;
	font-size: 13px;
	color: #888;
	text-decoration: underline;
}

.cda-shop-filters__reset:hover {
	color: var(--cda-black);
}

/* -------------------------------------------------------------------------
 * Grid de productos (igual lenguaje visual que "Novedades")
 * ---------------------------------------------------------------------- */

.cda-shop ul.products {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 28px 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* WooCommerce fija un ancho en % sobre <li> y sus enlaces/imágenes para su
   antiguo sistema de columnas flotantes (.columns-4 a, .columns-4 img...).
   Como usamos CSS Grid, ese % se recalcula sobre la celda y la deja diminuta:
   lo anulamos por completo dentro de la tarjeta. */
.cda-shop ul.products li.product,
.cda-shop ul.products li.product a,
.cda-shop ul.products li.product img {
	width: auto !important;
	max-width: none !important;
	float: none !important;
}

.cda-shop ul.products::before,
.cda-shop ul.products::after {
	content: none !important;
}

.cda-shop-card {
	display: flex;
	flex-direction: column;
	font-family: var(--cda-font-body);
}

.cda-shop ul.products li.product a.cda-shop-card__link,
.cda-shop ul.products li.product a.cda-shop-card__link:visited {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	width: 100% !important;
	max-width: none !important;
	color: var(--cda-black);
	text-decoration: none;
}

.cda-shop-card__img {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 10px;
	background: #f6f6f6;
	aspect-ratio: 3 / 4;
}

.cda-shop ul.products li.product .cda-shop-card__img img {
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.cda-shop-card__link:hover .cda-shop-card__img img {
	transform: scale(1.04);
}

.cda-shop-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: var(--cda-black);
	color: var(--cda-white);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 999px;
}

.cda-shop-card__name {
	margin-top: 12px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
	color: var(--cda-black);
	/* Reserva siempre el alto de 2 líneas (aunque el título quepa en 1), para
	   que ninguna tarjeta de la fila tenga que estirarse por culpa de otra
	   con un nombre más largo: así el botón queda siempre pegado al precio. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: calc(1.35em * 2);
}

.cda-shop-card__price {
	margin-top: 4px;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--cda-black);
}

.cda-shop-card__price del {
	margin-right: 6px;
	font-weight: 400;
	opacity: 0.55;
}

.cda-shop-card__price ins {
	text-decoration: none;
	color: var(--cda-black);
}

.cda-shop-card__action {
	margin-top: 12px;
}

.cda-shop ul.products li.product .cda-shop-card__action a.button,
.cda-shop ul.products li.product .cda-shop-card__action button.button {
	display: block;
	width: 100%;
	text-align: center;
	padding: 11px 14px;
	background-color: var(--cda-pink);
	background-image: none;
	color: var(--cda-black);
	border: 0;
	border-radius: 999px;
	font-family: var(--cda-font-body);
	font-weight: 700;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.2s ease;
	box-shadow: none;
}

.cda-shop ul.products li.product .cda-shop-card__action a.button:hover,
.cda-shop ul.products li.product .cda-shop-card__action button.button:hover {
	background-color: var(--cda-pink);
	color: var(--cda-black);
	opacity: 0.82;
}

.cda-shop-card__action .button.loading {
	opacity: 0.6;
}

.cda-shop-card__action .added_to_cart {
	display: block;
	margin-top: 6px;
	text-align: center;
	font-size: 11px;
	color: #888;
	text-decoration: underline;
}

/* Agotados */
.cda-shop-card--outofstock .cda-shop-card__img img {
	filter: grayscale(1);
	opacity: 0.55;
}

.cda-shop-card--outofstock .cda-shop-card__name,
.cda-shop-card--outofstock .cda-shop-card__price {
	color: #999;
}

.cda-shop-card__soldout {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 64px;
	line-height: 1;
	color: rgba(255, 255, 255, 0.9);
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
	font-family: var(--cda-font-body);
	pointer-events: none;
}

.cda-shop-card__soldout-label {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(26, 26, 26, 0.8);
	color: var(--cda-white);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 4px 12px;
	border-radius: 999px;
}

/* Sin resultados */
.cda-shop .woocommerce-info,
.cda-shop .woocommerce-notice {
	max-width: 640px;
	margin: 24px auto;
	padding: 16px 20px;
	background: #fdf3f6;
	border-radius: 10px;
	border: 0;
	text-align: center;
	list-style: none;
}

/* -------------------------------------------------------------------------
 * Paginación
 * ---------------------------------------------------------------------- */

.cda-shop nav.woocommerce-pagination {
	margin-top: 48px;
}

.cda-shop nav.woocommerce-pagination ul {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
	border: 0;
}

.cda-shop nav.woocommerce-pagination ul li {
	border: 0;
}

.cda-shop nav.woocommerce-pagination .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--cda-white);
	border: 1px solid #eee0e4;
	color: var(--cda-black);
	font-family: var(--cda-font-body);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
}

.cda-shop nav.woocommerce-pagination .page-numbers:hover {
	background: #fdf3f6;
}

.cda-shop nav.woocommerce-pagination .page-numbers.current {
	background: var(--cda-black);
	border-color: var(--cda-black);
	color: var(--cda-white);
}

.cda-shop nav.woocommerce-pagination .page-numbers.dots {
	background: transparent;
	border: 0;
}

/* -------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
	.cda-shop ul.products {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 782px) {
	.cda-shop-filters__toggle {
		display: block;
		margin-bottom: 12px;
	}

	.cda-shop-filters__bar {
		display: none;
		flex-direction: column;
		align-items: stretch;
	}

	.cda-shop-filters.is-open .cda-shop-filters__bar {
		display: flex;
	}

	.cda-filter summary {
		width: 100%;
		justify-content: space-between;
	}

	.cda-filter__panel {
		position: static;
		box-shadow: none;
		margin-top: 8px;
		border: 1px solid #f0dde3;
		max-height: none;
	}

	.cda-filter__panel--price {
		flex-direction: column;
	}

	.cda-shop-filters__submit {
		width: 100%;
	}

	.cda-shop-filters__reset {
		align-self: center;
	}
}

@media (max-width: 600px) {
	.cda-shop ul.products {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px 14px;
	}

	.cda-shop-card__name {
		font-size: 13px;
	}

	.cda-shop-card__soldout {
		font-size: 44px;
	}
}
