/**
 * Folklore Home Products — tarjetas editoriales y carrusel horizontal.
 * Las reglas visuales replican el sistema de tarjetas de la tienda.
 */

.folklore-home-products,
.folklore-product-collection {
	--folk-ink: #0d0b0c;
	--folk-ink-soft: #292725;
	--folk-surface: #fffdf7;
	--folk-wood: #d0a561;
	--folk-wood-dark: #8a5f26;
	--folk-line: #d6d0c6;
	--folk-muted: #706c65;
	--folk-image: #fff;
	--folk-font-display: "PP Monument", "Archivo", "Arial Narrow", sans-serif;
	--folk-font-body: "PP Monument Narrow", "Space Grotesk", sans-serif;
	--folk-rule: 1px solid var(--folk-line);
	--folklore-cards-gap: clamp(16px, 1.7vw, 26px);
	box-sizing: border-box;
	min-width: 0;
	font-family: var(--folk-font-body);
}

.folklore-home-products {
	display: grid;
	gap: clamp(3rem, 7vw, 6.5rem);
	width: 100%;
}

.folklore-product-collection :where(*, *::before, *::after) {
	box-sizing: border-box;
}

.folklore-product-collection__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.25rem;
	margin-block-end: clamp(1.25rem, 3vw, 2rem);
}

.folklore-product-collection__title {
	margin: 0;
	color: var(--folk-ink);
	font-family: var(--folk-font-display);
	font-size: clamp(1.75rem, 4vw, 3rem);
	font-weight: 800;
	letter-spacing: -.04em;
	line-height: 1;
}

.folklore-product-carousel__navigation {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
	margin-inline-start: auto;
}

.folklore-product-collection > .folklore-product-carousel__navigation {
	justify-content: flex-end;
	margin-block-end: 1rem;
}

.folklore-product-carousel__button {
	display: inline-grid;
	width: 44px;
	height: 44px;
	padding: 0;
	place-items: center;
	border: 1px solid var(--folk-ink);
	border-radius: 0;
	background: var(--folk-ink);
	color: var(--folk-surface);
	font: 400 20px/1 Arial, sans-serif;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .16s ease, color .16s ease, opacity .16s ease;
}

.folklore-product-carousel__button:hover:not(:disabled),
.folklore-product-carousel__button:focus-visible:not(:disabled) {
	background: var(--folk-wood);
	color: var(--folk-ink);
}

.folklore-product-carousel__button:focus-visible {
	outline: 2px solid var(--folk-wood);
	outline-offset: 3px;
}

.folklore-product-carousel__button:disabled {
	opacity: .32;
	cursor: default;
}

.folklore-product-carousel__button[hidden] {
	display: none;
}

.folklore-product-collection > ul.products.folklore-product-carousel__track {
	display: grid !important;
	grid-template-rows: 1fr;
	grid-auto-flow: column;
	gap: var(--folklore-cards-gap) !important;
	width: 100%;
	max-width: 100%;
	margin: 0 !important;
	padding: 0 0 8px !important;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
}

.folklore-product-collection > ul.products.folklore-product-carousel__track::-webkit-scrollbar {
	display: none;
}

.folklore-product-collection--columns-1 > ul.products.folklore-product-carousel__track { grid-auto-columns: 100%; }
.folklore-product-collection--columns-2 > ul.products.folklore-product-carousel__track { grid-auto-columns: calc((100% - var(--folklore-cards-gap)) / 2); }
.folklore-product-collection--columns-3 > ul.products.folklore-product-carousel__track { grid-auto-columns: calc((100% - 2 * var(--folklore-cards-gap)) / 3); }
.folklore-product-collection--columns-4 > ul.products.folklore-product-carousel__track { grid-auto-columns: calc((100% - 3 * var(--folklore-cards-gap)) / 4); }
.folklore-product-collection--columns-5 > ul.products.folklore-product-carousel__track { grid-auto-columns: calc((100% - 4 * var(--folklore-cards-gap)) / 5); }
.folklore-product-collection--columns-6 > ul.products.folklore-product-carousel__track { grid-auto-columns: calc((100% - 5 * var(--folklore-cards-gap)) / 6); }

.folklore-product-collection > ul.products::before,
.folklore-product-collection > ul.products::after {
	display: none !important;
	content: none !important;
}

.folklore-product-collection > ul.products > li.product {
	position: relative;
	display: grid;
	container-type: inline-size;
	float: none !important;
	grid-template-rows: auto minmax(2.45em, auto) auto auto;
	align-content: start;
	align-items: stretch !important;
	width: auto !important;
	min-width: 0;
	margin: 0 !important;
	padding: 9px 9px 12px !important;
	overflow: hidden;
	border: 1px solid var(--folk-line) !important;
	border-radius: 0 !important;
	background: var(--folk-surface) !important;
	box-shadow: none !important;
	scroll-snap-align: start;
	transition: border-color .18s ease;
}

.folklore-product-collection > ul.products > li.product:hover {
	border-color: var(--folk-ink) !important;
	box-shadow: none !important;
}

.folklore-product-collection > ul.products > li.product figure {
	position: relative;
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	aspect-ratio: 1 / 1;
	margin: 0 0 15px !important;
	overflow: hidden;
	background: #fff !important;
}

.folklore-product-collection > ul.products > li.product figure::after {
	content: none;
}

.folklore-product-collection > ul.products > li.product .folklore-product-code {
	margin: 0 4px 7px !important;
	color: var(--folk-muted);
	font-size: 11px;
	line-height: 1.3;
	text-align: left;
}

.folklore-product-collection > ul.products > li.product .ct-media-container {
	position: absolute !important;
	inset: 0;
	display: grid !important;
	width: 100% !important;
	height: 100% !important;
	place-items: center;
	padding: clamp(8px, 1vw, 15px) !important;
	background: #fff !important;
}

.folklore-product-collection > ul.products > li.product img {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	margin: 0 auto !important;
	object-fit: contain !important;
	object-position: center center !important;
	transform: scale(1);
	transition: transform .42s cubic-bezier(.22, .75, .24, 1);
}

.folklore-product-collection > ul.products > li.product:hover img { transform: none; }

.folklore-product-collection > ul.products > li.product .woocommerce-loop-product__title {
	min-width: 0;
	margin: 0 4px 8px !important;
	color: var(--folk-ink) !important;
	font-family: var(--folk-font-body) !important;
	font-size: clamp(15px, 1.15vw, 18px) !important;
	font-weight: 650 !important;
	line-height: 1.18 !important;
	letter-spacing: -.025em;
	text-align: left !important;
}

.folklore-product-collection > ul.products > li.product .woocommerce-loop-product__title a { color: inherit; }

.folklore-product-collection > ul.products > li.product .entry-meta {
	margin: 0 4px 14px !important;
	color: var(--folk-muted) !important;
	font-family: var(--folk-font-body);
	font-size: 10px !important;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: .14em;
	text-align: left !important;
	text-transform: uppercase;
}

.folklore-product-collection > ul.products > li.product .entry-meta a { color: inherit !important; }

.folklore-product-collection > ul.products > li.product .ct-woo-card-actions {
	display: grid !important;
	grid-template-columns: 1fr !important;
	align-items: stretch !important;
	gap: 9px !important;
	width: 100% !important;
	min-width: 0 !important;
	margin: auto 0 0 !important;
	padding: 13px 4px 0 !important;
	overflow: visible !important;
	border-top: var(--folk-rule);
}

.folklore-product-collection > ul.products > li.product .price {
	display: block !important;
	grid-column: 1 !important;
	width: 100% !important;
	min-width: 0 !important;
	min-height: 30px;
	margin: 0 !important;
	padding: 3px 0 2px 2px !important;
	overflow: visible !important;
	color: var(--folk-wood-dark) !important;
	font-family: var(--folk-font-body);
	font-size: 25px !important;
	font-weight: 700 !important;
	line-height: 1.25 !important;
	letter-spacing: -.025em;
	text-align: left !important;
	white-space: normal;
	overflow-wrap: anywhere;
}

.folklore-product-collection > ul.products > li.product .price :where(bdi, .woocommerce-Price-amount) {
	display: inline !important;
	overflow: visible !important;
	white-space: normal;
	font-variant-numeric: tabular-nums;
}

.folklore-product-collection > ul.products > li.product .woocommerce-Price-currencySymbol {
	display: inline-block;
	min-width: .85em;
	margin-right: .12em;
	overflow: visible;
	font-size: .74em;
	font-family: Arial, sans-serif;
	line-height: 1;
	white-space: nowrap;
}

.folklore-product-collection > ul.products > li.product .button {
	position: relative;
	display: flex !important;
	grid-column: 1 !important;
	align-items: center;
	justify-content: space-between;
	width: 100% !important;
	min-height: 44px;
	margin: 0 !important;
	padding: 10px 40px 10px 13px !important;
	overflow: visible !important;
	border: 1px solid var(--folk-ink) !important;
	border-radius: 0 !important;
	background: var(--folk-ink) !important;
	color: var(--folk-surface) !important;
	font-family: var(--folk-font-body) !important;
	font-size: 11px !important;
	font-weight: 600 !important;
	line-height: 1.1 !important;
	letter-spacing: .025em;
	text-align: left !important;
	text-transform: none;
	box-shadow: none !important;
	transition: background-color .16s ease, color .16s ease !important;
}

.folklore-product-collection > ul.products > li.product .button::after {
	position: absolute;
	top: 50%;
	right: 13px;
	font-family: Arial, sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
	content: "→";
	transform: translateY(-52%);
}

.folklore-product-collection > ul.products > li.product .button:hover {
	background: var(--folk-wood) !important;
	color: var(--folk-ink) !important;
	transform: none !important;
}

.folklore-product-collection > ul.products > li.product img:is(.woocommerce-placeholder, [src*="woocommerce-placeholder"]) {
	opacity: .38;
	filter: grayscale(1) contrast(.88);
}

@media (max-width: 1024px) {
	.folklore-product-collection > ul.products.folklore-product-carousel__track {
		grid-auto-columns: calc((100% - 12px) / 2);
		gap: 12px !important;
	}

	.folklore-product-collection--columns-1 > ul.products.folklore-product-carousel__track { grid-auto-columns: 100%; }
	.folklore-product-collection > ul.products > li.product { padding: 7px 7px 10px !important; }
	.folklore-product-collection > ul.products > li.product .woocommerce-loop-product__title { margin-inline: 2px !important; font-size: 14px !important; }
	.folklore-product-collection > ul.products > li.product :is(.entry-meta, .ct-woo-card-actions) { margin-inline: 2px !important; }
}

@media (max-width: 560px) {
	.folklore-product-collection__header { align-items: center; }
	.folklore-product-collection__title { font-size: clamp(1.65rem, 9vw, 2.25rem); }
	.folklore-product-carousel__button { width: 40px; height: 40px; }

	.folklore-product-collection > ul.products.folklore-product-carousel__track,
	.folklore-product-collection--columns-1 > ul.products.folklore-product-carousel__track {
		grid-auto-columns: min(82vw, 310px);
		gap: 10px !important;
	}

	.folklore-product-collection > ul.products > li.product { padding: 7px 7px 10px !important; }
	.folklore-product-collection > ul.products > li.product figure { margin-bottom: 9px !important; }
	.folklore-product-collection > ul.products > li.product .ct-media-container { padding: 6px !important; background: #fff !important; }

	.folklore-product-collection > ul.products > li.product .woocommerce-loop-product__title {
		display: -webkit-box;
		min-height: 2.36em;
		margin: 0 2px 6px !important;
		overflow: hidden;
		font-size: 14px !important;
		line-height: 1.18 !important;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.folklore-product-collection > ul.products > li.product .entry-meta { margin: 0 2px 8px !important; font-size: 8px !important; letter-spacing: .11em; }
	.folklore-product-collection > ul.products > li.product .ct-woo-card-actions { gap: 6px !important; padding: 8px 2px 0 !important; }
	.folklore-product-collection > ul.products > li.product .price { min-height: 28px; padding: 1px 0 !important; }
	.folklore-product-collection > ul.products > li.product .button { min-height: 44px; padding: 8px 23px 8px 7px !important; font-size: 11px !important; }
	.folklore-product-collection > ul.products > li.product .button::after { right: 9px; }
}

@container (max-width: 190px) {
	.folklore-product-collection > ul.products > li.product .price {
		font-size: 20px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.folklore-product-collection > ul.products.folklore-product-carousel__track { scroll-behavior: auto; }
	.folklore-product-carousel__button,
	.folklore-product-collection > ul.products > li.product,
	.folklore-product-collection > ul.products > li.product img,
	.folklore-product-collection > ul.products > li.product .button { transition: none !important; }
}

/* WooCommerce inserts this link after the AJAX add-to-cart button.
 * It replaces the completed action in the same grid cell so cards never jump. */
.folklore-product-collection > ul.products > li.product .ct-woo-card-actions > .price {
	grid-row: 1 !important;
}

.folklore-product-collection > ul.products > li.product .ct-woo-card-actions > :is(.button, a.added_to_cart) {
	box-sizing: border-box;
	height: 44px !important;
	min-height: 44px;
}

.folklore-product-collection > ul.products > li.product .ct-woo-card-actions > .button {
	grid-row: 2 !important;
}

.folklore-product-collection > ul.products > li.product .ct-woo-card-actions > .button.added {
	display: none !important;
}

/* El enlace posterior es la señal estable de que WooCommerce terminó,
 * incluso si Blocksy no añadió la clase auxiliar `.added` al CTA original. */
.folklore-product-collection > ul.products > li.product .ct-woo-card-actions:has(> a.added_to_cart) > .button {
	display: none !important;
}

.folklore-product-collection > ul.products > li.product .ct-woo-card-actions > a.added_to_cart {
	display: flex !important;
	position: static !important;
	grid-column: 1 !important;
	grid-row: 2 !important;
	align-items: center;
	justify-content: center;
	justify-self: stretch;
	box-sizing: border-box;
	width: 100% !important;
	min-width: 0 !important;
	min-height: 44px;
	margin: 0 !important;
	padding: 10px 12px !important;
	border: 1px solid var(--folk-ink) !important;
	border-radius: 0 !important;
	background: var(--folk-ink) !important;
	color: var(--folk-surface) !important;
	font-family: var(--folk-font-body) !important;
	font-size: 12px !important;
	font-weight: 600;
	line-height: 1.25 !important;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: none !important;
	transform: none !important;
}

.folklore-product-collection > ul.products > li.product .ct-woo-card-actions > a.added_to_cart:is(:hover, :focus-visible) {
	background: var(--folk-wood) !important;
	color: var(--folk-ink) !important;
}

.folklore-product-collection > ul.products > li.product .ct-woo-card-actions > a.added_to_cart:focus-visible {
	outline: 2px solid var(--folk-ink);
	outline-offset: 2px;
}
