/*
 * W1 · Catálogo: cajón de filtros + ajustes frente a Hub que faltaban en la barra superior
 * y en la tarjeta minimal-2 (lo base es de B2, assets/css/woo.css). Carga después de woo.css,
 * solo en tienda/categorías. Todo va acotado a .epic-shop-topbar, .epic-filter-* o
 * .epic-shop-style-minimal-2: en epicrides (sin barra ni cajón, estilo default) no aplica nada.
 */

/* Barra superior: el select de orden va a su texto (Hub: ~114x19). El CSS del cliente
 * de ixaga fuerza select { width: 100% !important }. */
.epic-shop-topbar .woocommerce-ordering select.orderby {
	width: auto !important;
	max-width: 100% !important;
	min-height: 0;
	height: auto;
	padding: 0 20px 0 0;
	line-height: 1.36;
	background-position: right center;
	text-overflow: ellipsis;
	field-sizing: content;
}

/* Botón del cajón */
.epic-filter-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 1px;
	text-transform: uppercase;
	white-space: nowrap;
	color: #5e5e5e;
	cursor: pointer;
}
.epic-filter-trigger:hover,
.epic-filter-trigger:focus-visible { color: #000; }
.epic-filter-trigger__bars {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	width: 18px;
	height: 18px;
	padding: 0 2px;
}
.epic-filter-trigger__bars i { display: block; height: 2px; background: #000; }
.epic-filter-trigger-wrap--mobile { display: none; }

/* Móvil (Hub < 768px): una fila, filtros a la izquierda y orden a la derecha;
 * sin vista, "Show" ni contador. Solo cuando hay cajón, que es el caso de Hub. */
@media (max-width: 767px) {
	.epic-filter-trigger-wrap--mobile { display: block; }
	body.epic-has-filter-drawer .epic-shop-topbar {
		flex-wrap: nowrap;
		gap: 0 16px;
		padding: 20px 0 10px;
	}
	body.epic-has-filter-drawer .epic-shop-topbar .epic-view-switch,
	body.epic-has-filter-drawer .epic-shop-topbar .epic-per-page,
	body.epic-has-filter-drawer .epic-shop-topbar .woocommerce-result-count,
	body.epic-has-filter-drawer .epic-shop-topbar .woocommerce-breadcrumb { display: none !important; }
	body.epic-has-filter-drawer .epic-shop-topbar > * { flex: 0 0 auto; margin-bottom: 10px; }
	body.epic-has-filter-drawer .epic-shop-topbar .woocommerce-ordering {
		flex: 1 1 0;
		min-width: 0;
		margin-left: auto;
		text-align: right;
	}

	/* minimal-2 en Hub: título y precio alineados a la izquierda también en móvil. */
	body.epic-shop-style-minimal-2 ul.products li.product,
	body.epic-shop-style-minimal-2 ul.products li.product .woocommerce-loop-product__title,
	body.epic-shop-style-minimal-2 ul.products li.product h3,
	body.epic-shop-style-minimal-2 ul.products li.product .price { text-align: left; }
	body.epic-shop-style-minimal-2 .related ul.products li.product,
	body.epic-shop-style-minimal-2 .upsells ul.products li.product { text-align: inherit; }
}

/* Cajón */
.epic-filter-drawer { position: fixed; inset: 0; z-index: 100000; visibility: hidden; }
.epic-filter-drawer[hidden] { display: none; }
.epic-filter-drawer.is-open { visibility: visible; }
.epic-filter-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .4);
	opacity: 0;
	transition: opacity .35s;
}
.epic-filter-drawer.is-open .epic-filter-drawer__backdrop { opacity: 1; }
.epic-filter-drawer__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: min(360px, 86vw);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	box-shadow: 0 0 40px rgba(0, 0, 0, .12);
	transform: translateX(-100%);
	transition: transform .45s cubic-bezier(.23, 1, .32, 1);
	outline: none;
}
.epic-filter-drawer.is-open .epic-filter-drawer__panel { transform: none; }
.epic-filter-drawer__inner { padding: 60px 30px 30px; }
.epic-filter-drawer__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.epic-filter-drawer__close span,
.epic-filter-drawer__close span::after {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 2px;
	margin: -1px 0 0 -9px;
	background: #000;
	transform: rotate(45deg);
}
.epic-filter-drawer__close span::after { content: ""; top: 0; left: 0; margin: 0; transform: rotate(90deg); }
.epic-filter-drawer .widget + .widget { margin-top: 40px; }
.epic-filter-drawer .widget-title {
	margin: 0 0 1.25em;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #000;
}
.epic-filter-drawer ul { margin: 0; padding: 0; list-style: none; }
.epic-filter-drawer .product-categories li { margin: 0 0 .6em; font-size: 14px; color: #5e5e5e; }
.epic-filter-drawer .product-categories .children { margin: .6em 0 0 1em; }
.epic-filter-drawer .product-categories a { color: #000; text-decoration: none; }
.epic-filter-drawer .product-categories a:hover,
.epic-filter-drawer .product-categories .current-cat > a { color: var(--color-primary, #184341); }
html.epic-filter-drawer-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
	.epic-filter-drawer__panel,
	.epic-filter-drawer__backdrop { transition: none; }
}

/* Barra lateral del catálogo (wc-archive-sidebar-one) */
.epic-shop-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 50px; }
.epic-shop-layout--left { grid-template-columns: 270px minmax(0, 1fr); }
.epic-shop-layout--left .epic-shop-sidebar { order: -1; }
.epic-shop-sidebar { padding-top: 20px; }
.epic-shop-sidebar .widget + .widget { margin-top: 40px; }
.epic-shop-sidebar .widget-title { margin: 0 0 1.25em; font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #000; }
.epic-shop-sidebar ul { margin: 0; padding: 0; list-style: none; }
.epic-shop-sidebar li { margin: 0 0 .6em; }
@media (max-width: 991px) {
	.epic-shop-layout,
	.epic-shop-layout--left { grid-template-columns: minmax(0, 1fr); }
	.epic-shop-layout--left .epic-shop-sidebar { order: 0; }
	.epic-shop-sidebar--hide-mobile { display: none; }
}
