/* Catálogo (Nuestros libros / categorías) — rediseño basado en el mockup
   "Astra catalog redesign" (desktop + mobile). Usa las fuentes y tamaños del
   sitio (no define font-family ni tamaños de título/precio en desktop); solo
   layout, color y espaciado. */

.post-type-archive-product,
.tax-product_cat {
	--bk-celeste: #3aa5e8;
	--bk-cta: #3e7dd4;
	--bk-line: #e2e8f0;
	--bk-line-soft: #f1f5f9;
	--bk-muted: #64748b;
	--bk-tint: #f0f7ff;
}

/* Elementos exclusivos de mobile: ocultos en desktop */
.bk-mtoolbar,
.bk-sheet-head,
.bk-sheet-foot,
.bk-sheet-overlay {
	display: none;
}

/* ── Hero "Nuestros libros": fondo blanco, letras negras ─────────────────── */
.post-type-archive-product .ast-archive-entry-banner[data-banner-layout],
.tax-product_cat .ast-archive-entry-banner[data-banner-layout] {
	background-image: none !important;
	background-color: #fff !important;
	border-bottom: 1px solid var(--bk-line);
	min-height: 0 !important;
	height: auto !important;
	padding: 56px 0 !important;
	text-align: center;
}

.post-type-archive-product .ast-archive-entry-banner h1,
.tax-product_cat .ast-archive-entry-banner h1,
.post-type-archive-product .ast-archive-entry-banner .ast-container,
.tax-product_cat .ast-archive-entry-banner .ast-container {
	color: #000 !important;
	margin: 0;
	text-align: center;
}

/* ── Contenido: filtros arriba (tablet/mobile) o sidebar a la derecha (desktop) ── */
.post-type-archive-product .site-content,
.tax-product_cat .site-content {
	background: #f8fafc;
	padding: 32px 0 64px;
}

.post-type-archive-product #content > .ast-container,
.tax-product_cat #content > .ast-container {
	display: flex !important;
	flex-direction: column !important;
	gap: 24px;
}

.post-type-archive-product #content #primary,
.tax-product_cat #content #primary,
.post-type-archive-product #content #secondary,
.tax-product_cat #content #secondary {
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

.post-type-archive-product #secondary,
.tax-product_cat #secondary {
	order: -1;
}

@media ( min-width: 922px ) {
	.post-type-archive-product #content > .ast-container,
	.tax-product_cat #content > .ast-container {
		flex-direction: row !important;
		align-items: flex-start;
		gap: 32px;
	}

	.post-type-archive-product #content #primary,
	.tax-product_cat #content #primary {
		flex: 1 1 0;
		width: auto !important;
		min-width: 0;
	}

	.post-type-archive-product #content #secondary,
	.tax-product_cat #content #secondary {
		flex: 0 0 260px;
		order: 0;
		width: 260px !important;
	}
}

/* ── Card de filtros ──────────────────────────────────────────────────────── */
.post-type-archive-product #secondary .sidebar-main,
.tax-product_cat #secondary .sidebar-main {
	background: #fff;
	border: 1px solid var(--bk-line);
	border-radius: 16px;
	padding: 20px 24px;
}

.post-type-archive-product #secondary .widget,
.tax-product_cat #secondary .widget {
	margin: 0;
}

.wpc-filters-section {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin: 0 !important;
}

.wpc-filters-section .wpc-filter-header {
	margin: 0;
}

.wpc-filters-section .wpc-filter-title {
	margin: 0;
	color: #94a3b8;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.wpc-filters-section .wpc-filter-content {
	flex: 1 1 auto;
}

.wpc-filters-ul-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.wpc-filters-ul-list li.wpc-term-item {
	margin: 0 !important;
	padding: 0 !important;
}

.wpc-term-item .wpc-term-item-content-wrapper {
	position: relative;
	display: block;
}

.wpc-term-item input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

/* El plugin de filtros pinta sus labels de negro: se pisa con más especificidad */
#secondary .wpc-filters-main-wrap .wpc-term-item label {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 7px 16px !important;
	background: #fff !important;
	border: 1px solid var(--bk-line) !important;
	border-radius: 10px !important;
	color: #475569 !important;
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

#secondary .wpc-filters-main-wrap .wpc-term-item label a,
#secondary .wpc-filters-main-wrap .wpc-term-item label a:hover {
	color: inherit !important;
	text-decoration: none !important;
}

#secondary .wpc-filters-main-wrap .wpc-term-item label:hover {
	border-color: #94a3b8 !important;
	color: #0f172a !important;
}

#secondary .wpc-filters-main-wrap .wpc-term-item input:checked + label,
#secondary .wpc-filters-main-wrap .wpc-term-item.wpc-chosen label {
	background: var(--bk-celeste) !important;
	border-color: var(--bk-celeste) !important;
	color: #fff !important;
}

.wpc-term-item .wpc-term-count {
	display: none;
}

.wpc-term-item.wpc-term-count-0 label {
	opacity: 0.45;
	pointer-events: none;
}

/* ── Barra de orden / cantidad ────────────────────────────────────────────── */
.post-type-archive-product .ast-woocommerce-container,
.tax-product_cat .ast-woocommerce-container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.post-type-archive-product .ast-woocommerce-container > header,
.tax-product_cat .ast-woocommerce-container > header,
.post-type-archive-product .ast-woocommerce-container > .woocommerce-notices-wrapper,
.tax-product_cat .ast-woocommerce-container > .woocommerce-notices-wrapper,
.post-type-archive-product .ast-woocommerce-container > ul.products,
.tax-product_cat .ast-woocommerce-container > ul.products {
	flex: 0 0 100%;
}

.post-type-archive-product .woocommerce-result-count,
.tax-product_cat .woocommerce-result-count {
	display: block !important;
	float: none;
	margin: 0;
	color: var(--bk-muted);
}

.post-type-archive-product .woocommerce-ordering,
.tax-product_cat .woocommerce-ordering {
	float: none;
	margin: 0 0 0 auto;
}

.post-type-archive-product .woocommerce-ordering select,
.tax-product_cat .woocommerce-ordering select {
	padding: 8px 32px 8px 14px;
	background-color: #fff;
	border: 1px solid var(--bk-line);
	border-radius: 10px;
	cursor: pointer;
}

/* ── Grilla de libros ─────────────────────────────────────────────────────── */
.post-type-archive-product ul.products,
.tax-product_cat ul.products {
	display: grid !important;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) ) !important;
	gap: 24px;
	margin: 0 !important;
	padding: 0;
	list-style: none;
}

.post-type-archive-product ul.products::before,
.post-type-archive-product ul.products::after,
.tax-product_cat ul.products::before,
.tax-product_cat ul.products::after {
	display: none !important;
}

.post-type-archive-product ul.products li.product,
.tax-product_cat ul.products li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	background: #fff;
	border: 1px solid var(--bk-line);
	border-radius: 16px;
	overflow: hidden;
	text-align: center;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-type-archive-product ul.products li.product:hover,
.tax-product_cat ul.products li.product:hover {
	border-color: var(--bk-celeste);
	box-shadow: 0 12px 28px -12px rgba( 43, 116, 223, 0.25 );
}

/* Foto en un recuadro cuadrado fijo: todas las cards quedan del mismo alto sin
   importar el tamaño original de la imagen. */
.astra-shop-thumbnail-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	padding: 24px;
	background: var(--bk-tint);
	border-bottom: 1px solid var(--bk-line-soft);
	overflow: hidden;
}

.astra-shop-thumbnail-wrap a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.astra-shop-thumbnail-wrap img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0 auto;
	object-fit: contain;
}

/* Astra le da margen negativo abajo a la foto: se anula para que el resumen no la pise */
body.post-type-archive-product ul.products li.product .astra-shop-thumbnail-wrap,
body.tax-product_cat ul.products li.product .astra-shop-thumbnail-wrap {
	margin: 0 !important;
}

/* Resumen: título, precio, CTA (centrados) */
.astra-shop-summary-wrap {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 16px;
	text-align: center;
}

.astra-shop-summary-wrap .woocommerce-loop-product__title {
	margin: 0 0 11px;
	text-align: center;
}

.astra-shop-summary-wrap .price {
	display: block;
	margin-top: 0;
	margin-bottom: auto;
	padding-top: 14px;
	border-top: 1px solid var(--bk-line-soft);
	text-align: center !important;
}

/* Mismo CTA que los plugins (banner): azul, mayúsculas, hover negro */
.bk-loop-cta {
	display: flex !important;
	align-items: center;
	justify-content: center;
	align-self: center;
	width: auto;
	margin-top: 20px;
	padding: 13px 40px;
	background: var(--bk-cta) !important;
	border-radius: 30px;
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1.5px;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	text-transform: uppercase;
	transition: background-color 0.2s ease;
}

.bk-loop-cta:hover {
	background: #000 !important;
	color: #fff !important;
}

/* Sidebar de escritorio: categorías apiladas verticalmente */
@media ( min-width: 922px ) {
	.wpc-filters-section {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.wpc-filters-ul-list {
		flex-direction: column;
		gap: 8px;
	}

	#secondary .wpc-filters-main-wrap .wpc-term-item label {
		display: flex;
		width: 100%;
		justify-content: flex-start;
	}
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media ( min-width: 922px ) and ( max-width: 1099px ) {
	.post-type-archive-product ul.products,
	.tax-product_cat ul.products {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) ) !important;
	}
}

@media ( max-width: 921px ) {
	.post-type-archive-product ul.products,
	.tax-product_cat ul.products {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) ) !important;
	}
}

@media ( max-width: 600px ) {
	.post-type-archive-product .ast-archive-entry-banner[data-banner-layout],
	.tax-product_cat .ast-archive-entry-banner[data-banner-layout] {
		padding: 36px 0 !important;
	}
}

/* ══════════════════════════════════════════════════════════════════════════
   Mobile — diseño "Catálogo mobile": hero alineado a la izquierda, barra
   sticky con "Filtrar", filtros en bottom sheet, libro destacado + grilla
   de 2 columnas. (El plugin de filtros sigue siendo el que filtra.)
   ══════════════════════════════════════════════════════════════════════════ */
@media ( max-width: 767px ) {

	/* Hero */
	.post-type-archive-product .ast-archive-entry-banner[data-banner-layout],
	.tax-product_cat .ast-archive-entry-banner[data-banner-layout] {
		padding: 26px 20px 24px !important;
		border-bottom: 0;
		text-align: left;
	}

	.post-type-archive-product .ast-archive-entry-banner .ast-container,
	.tax-product_cat .ast-archive-entry-banner .ast-container {
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
		text-align: left;
	}

	.post-type-archive-product .ast-archive-entry-banner h1,
	.tax-product_cat .ast-archive-entry-banner h1 {
		color: #000 !important;
		font-size: 34px;
		line-height: 1.1;
		text-align: left;
	}

	.post-type-archive-product .ast-archive-entry-banner .ast-container::after,
	.tax-product_cat .ast-archive-entry-banner .ast-container::after {
		content: "Elegí una historia y hacé a tu peque protagonista.";
		display: block;
		margin-top: 8px;
		color: #333;
		font-size: 15px;
		line-height: 1.5;
	}

	/* Contenedor a ancho completo, fondo blanco */
	.post-type-archive-product .site-content,
	.tax-product_cat .site-content {
		background: #fff;
		padding: 0 0 40px;
	}

	.post-type-archive-product #content > .ast-container,
	.tax-product_cat #content > .ast-container {
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
		gap: 0;
	}

	.post-type-archive-product .woocommerce-result-count,
	.tax-product_cat .woocommerce-result-count,
	.post-type-archive-product .woocommerce-ordering,
	.tax-product_cat .woocommerce-ordering {
		display: none !important;
	}

	.post-type-archive-product .ast-woocommerce-container,
	.tax-product_cat .ast-woocommerce-container {
		gap: 0;
	}

	/* Barra sticky: botón "Filtrar" + cantidad */
	.bk-mtoolbar {
		position: sticky;
		top: var( --bk-sticky-top, 0px );
		z-index: 20;
		display: flex;
		flex: 0 0 100%;
		align-items: center;
		gap: 10px;
		padding: 10px 20px;
		background: rgba( 255, 255, 255, 0.94 );
		border-bottom: 1px solid #eef3f8;
		-webkit-backdrop-filter: blur( 8px );
		backdrop-filter: blur( 8px );
	}

	.bk-mtoolbar .bk-mtoolbar__btn {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		height: 44px;
		padding: 0 16px !important;
		background: #fff !important;
		border: 1px solid #d9e6f2 !important;
		border-radius: 999px !important;
		color: #2764b3 !important;
		font-size: 14px !important;
		font-weight: 700;
		letter-spacing: 0;
		line-height: 1;
		text-transform: none;
		cursor: pointer;
	}

	.bk-mtoolbar .bk-mtoolbar__btn:hover,
	.bk-mtoolbar .bk-mtoolbar__btn:focus {
		background: #f0f7ff !important;
		border-color: #7dc0e0 !important;
		color: #2764b3 !important;
	}

	.bk-mtoolbar__btn svg {
		width: 17px;
		height: 17px;
		flex: none;
	}

	.bk-mtoolbar .bk-mtoolbar__badge {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 20px;
		height: 20px;
		padding: 0 6px;
		background: #3e7dd4;
		border-radius: 999px;
		color: #fff;
		font-size: 12px;
	}

	.bk-mtoolbar .bk-mtoolbar__badge[hidden] {
		display: none;
	}

	.bk-mtoolbar__count {
		flex: 1;
		min-width: 0;
		color: #8aa0b4;
		font-size: 13px;
		text-align: right;
	}

	/* Filtros como bottom sheet */
	.post-type-archive-product #secondary,
	.tax-product_cat #secondary {
		position: fixed !important;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 100001;
		order: 0;
		max-height: 86vh;
		overflow-y: auto;
		background: #fff;
		border-radius: 22px 22px 0 0 !important;
		box-shadow: 0 -12px 40px -16px rgba( 23, 61, 112, 0.4 );
		transform: translateY( 110% );
		visibility: hidden;
		transition: transform 0.22s ease-out, visibility 0s linear 0.22s;
	}

	body.bk-sheet-open #secondary {
		transform: none;
		visibility: visible;
		transition: transform 0.22s ease-out, visibility 0s;
	}

	.post-type-archive-product #secondary .sidebar-main,
	.tax-product_cat #secondary .sidebar-main {
		padding: 0;
		border: 0;
		border-radius: 0;
	}

	.bk-sheet-overlay {
		position: fixed;
		inset: 0;
		z-index: 100000;
		display: block;
		background: rgba( 23, 61, 112, 0.35 );
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.22s ease-out;
	}

	body.bk-sheet-open .bk-sheet-overlay {
		opacity: 1;
		pointer-events: auto;
	}

	.bk-sheet-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 18px 20px 8px;
	}

	.bk-sheet-title {
		color: #2f3a46;
		font-size: 18px;
		font-weight: 700;
	}

	.bk-sheet-head .bk-sheet-clear {
		padding: 0 !important;
		background: none !important;
		border: 0 !important;
		border-radius: 0 !important;
		color: #7b8c9c !important;
		font-size: 14px !important;
		font-weight: 400;
		letter-spacing: 0;
		text-transform: none;
		cursor: pointer;
	}

	.bk-sheet-head .bk-sheet-clear:hover {
		background: none !important;
		color: #2764b3 !important;
	}

	.bk-sheet-foot {
		display: block;
		padding: 20px;
	}

	.bk-sheet-foot .bk-sheet-apply {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 52px;
		padding: 0 !important;
		background: #3e7dd4 !important;
		border: 0 !important;
		border-radius: 999px !important;
		color: #fff !important;
		font-size: 16px !important;
		font-weight: 700;
		letter-spacing: 0;
		text-transform: none;
		cursor: pointer;
	}

	.bk-sheet-foot .bk-sheet-apply:hover {
		background: #2764b3 !important;
		color: #fff !important;
	}

	.wpc-filters-section {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
		padding: 8px 20px 0;
	}

	.wpc-filters-section .wpc-filter-title {
		font-size: 12px;
		font-weight: 700;
	}

	.wpc-filters-section .wpc-filter-content {
		width: 100%;
	}

	#secondary .wpc-filters-main-wrap .wpc-term-item label {
		height: 40px;
		padding: 0 16px !important;
		border-radius: 999px !important;
		border-color: #d9e6f2 !important;
		color: #5a6b7b !important;
		font-size: 14px;
		font-weight: 500;
	}

	.wpc-filters-open-button-container {
		display: none !important;
	}

	/* Grilla de 2 columnas: foto, título, precio, CTA */
	.post-type-archive-product ul.products,
	.tax-product_cat ul.products {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) ) !important;
		gap: 28px 14px;
		padding: 20px 20px 0 !important;
	}

	.post-type-archive-product ul.products li.product,
	.tax-product_cat ul.products li.product {
		background: none;
		border: 0;
		border-radius: 0;
		overflow: visible;
		box-shadow: none;
	}

	.post-type-archive-product ul.products li.product:hover,
	.tax-product_cat ul.products li.product:hover {
		border-color: transparent;
		box-shadow: none;
	}

	.astra-shop-thumbnail-wrap {
		display: flex;
		align-items: center;
		justify-content: center;
		aspect-ratio: 1 / 1;
		padding: 14px;
		background: #f0f7ff;
		border: 0;
		border-radius: 16px;
		overflow: hidden;
	}

	.astra-shop-thumbnail-wrap a {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 100%;
	}

	.astra-shop-thumbnail-wrap img {
		width: 100%;
		height: 100%;
		object-fit: contain;
	}

	.astra-shop-summary-wrap {
		padding: 0;
		text-align: center;
	}

	/* Orden: título, precio, CTA (la foto ya va antes) */
	.astra-shop-summary-wrap > a {
		order: 1;
	}

	.astra-shop-summary-wrap > .price {
		order: 3;
		margin-top: 0;
		margin-bottom: auto;
		padding-top: 0;
		border-top: 0;
		text-align: center !important;
	}

	.astra-shop-summary-wrap > .bk-loop-cta {
		order: 4;
	}

	.astra-shop-summary-wrap .woocommerce-loop-product__title {
		margin: 12px 0 5px;
		color: #2f3a46;
		font-size: 18px !important;
		font-weight: 700;
		line-height: 1.25;
		text-align: center;
	}

	/* Precio compacto (el markup del precio trae estilos inline) */
	.astra-shop-summary-wrap .price .precio-transferencia-principal {
		font-size: 17px !important;
	}

	.astra-shop-summary-wrap .price .precio-transferencia-principal span {
		display: block;
		font-size: 12px !important;
	}

	.astra-shop-summary-wrap .price .precio-otros-medios {
		font-size: 12px !important;
	}

	.bk-loop-cta {
		margin-top: 20px;
		max-width: 100%;
		padding: 13px clamp( 16px, calc( 9vw - 8px ), 40px );
		font-size: 12px;
		letter-spacing: 1px;
	}
}
