/* ==========================================================================
   AVG — Tienda (woocommerce/archive-product.php)
   Banner «TIENDA», barra lateral de categorías/marcas, rejilla de tarjetas
   del Cotizador y paginación. Selectores con "html body" para ganar al CSS
   del tema padre y del plugin.
   ========================================================================== */

html body.avg-shop-page .site,
html body.avg-shop-page .site-main { max-width: none; margin: 0; padding: 0; background: var(--avg-black); }

.avg-shop {
	color: #fff;
	font-family: var(--avg-body);
}
.avg-shop *,
.avg-shop *::before,
.avg-shop *::after { box-sizing: border-box; }

.avg-shop__container {
	width: 100%;
	max-width: var(--avg-container);
	margin: 0 auto;
	padding: 0 24px;
}

/* ── Banner ────────────────────────────────────────────────────────────── */

.avg-shop-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: clamp(170px, 11.5vw, 220px);
	padding: 100px 0 clamp(18px, 1.6vw, 30px);
	background: #0b0b0b url('/wp-content/uploads/2026/09/baner_tienda.webp') center / cover no-repeat;
}
/* Funde el pie del banner con el negro de la página. */
.avg-shop-hero::after {
	content: '';
	position: absolute;
	inset: auto 0 0;
	height: 40%;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 100%);
	pointer-events: none;
}
html body .avg-shop-hero__title {
	position: relative;
	z-index: 1;
	margin: 0;
	color: #fff;
	font: 400 clamp(2.75rem, 3.4vw, 4rem)/.9 var(--avg-display);
	letter-spacing: -.005em;
	text-transform: uppercase;
}

/* ── Maquetación ───────────────────────────────────────────────────────── */

.avg-shop__layout {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 26px;
	align-items: start;
	padding-top: clamp(28px, 2.4vw, 44px);
	padding-bottom: clamp(56px, 5vw, 96px);
}

/* ── Barra lateral ─────────────────────────────────────────────────────── */

.avg-shop__sidebar {
	display: flex;
	flex-direction: column;
	gap: 22px;
}
/* shop-archive.css (tema padre) pone body { overflow-x: hidden !important },
   que convierte el body en contenedor de scroll y anula el sticky.
   clip recorta igual el desborde lateral sin crear contenedor de scroll. */
html body.avg-shop-page { overflow-x: clip !important; }

/* Escritorio: los filtros quedan fijos bajo el header mientras bajan los
   productos; si no caben en pantalla, hacen scroll por su cuenta. */
@media (min-width: 1025px) {
	.avg-shop__sidebar {
		--avg-side-top: 102px;
		position: sticky;
		top: var(--avg-side-top);
		max-height: calc(100vh - var(--avg-side-top) - 20px);
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: none;
	}
	.avg-shop__sidebar::-webkit-scrollbar { display: none; }
	.admin-bar .avg-shop__sidebar { --avg-side-top: 134px; }
}

.avg-filter {
	padding: 22px 12px 22px 24px;
	/* Borde con el degradado naranja de los botones: fondo liso en la caja
	   de relleno y el degradado asomando solo por el borde transparente. */
	border: 1px solid transparent;
	border-radius: 4px;
	background: linear-gradient(#050505, #050505) padding-box, var(--avg-grad) border-box;
}
/* En Inter (la regla global de avg-site.css pone los h2 en New Amsterdam). */
html body .avg-shop .avg-filter__title {
	margin: 0 0 18px;
	color: #fff;
	font: 600 1.4375rem/1.2 var(--avg-body) !important;
	letter-spacing: -.01em !important;
	text-transform: none !important;
}

.avg-filter__list,
.avg-filter__sub ul { margin: 0; padding: 0; list-style: none; }

/* Lista con scroll propio y barra fina, como en el diseño. */
.avg-filter__scroll {
	max-height: 336px;
	padding-right: 14px !important;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #d9d9d9 rgba(255, 255, 255, .12);
}
.avg-filter__scroll::-webkit-scrollbar { width: 4px; }
.avg-filter__scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, .12); border-radius: 4px; }
.avg-filter__scroll::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 4px; }

.avg-filter__row { display: flex; align-items: center; gap: 4px; }

.avg-filter__link {
	flex: 1;
	min-width: 0;
	display: block;
	padding: 12px 4px;
	border-radius: 4px;
	color: rgba(255, 255, 255, .82) !important;
	font-size: .8125rem;
	line-height: 1.35;
	letter-spacing: .005em;
	text-decoration: none !important;
	transition: color .2s, translate .35s var(--avg-ease);
}
.avg-filter__link:hover { color: #fff !important; translate: 3px 0; }
.avg-filter__link:active { color: var(--avg-orange) !important; transition-duration: .05s; }
.avg-filter__link.is-current { color: var(--avg-orange) !important; font-weight: 600; }
.avg-filter__link:focus-visible,
.avg-filter__toggle:focus-visible { outline: 2px solid var(--avg-orange); outline-offset: 1px; }

.avg-filter__count { color: rgba(255, 255, 255, .38); font-size: .75rem; }

.avg-filter__toggle {
	display: grid;
	place-items: center;
	flex: none;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: background-color .2s, scale .1s;
}
.avg-filter__toggle:hover { background: rgba(255, 255, 255, .08); }
.avg-filter__toggle:active { scale: .9; }
.avg-filter__toggle svg { transition: rotate .35s var(--avg-ease); }
.avg-filter__item.is-open > .avg-filter__row .avg-filter__toggle svg { rotate: 180deg; }

/* Subcategorías: se despliegan hacia abajo desde su categoría y vuelven a
   ella por el mismo camino (0fr ↔ 1fr), sin saltos de altura. */
.avg-filter__sub {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .4s var(--avg-ease);
}
.avg-filter__sub > ul {
	min-height: 0;
	overflow: hidden;
	padding-left: 12px;
	border-left: 1px solid #262626;
	margin-left: 4px;
	opacity: 0;
	/* Oculto también para el teclado cuando está cerrado. */
	visibility: hidden;
	transition: opacity .25s, visibility 0s .4s;
}
.avg-filter__item.is-open > .avg-filter__sub { grid-template-rows: 1fr; }
.avg-filter__item.is-open > .avg-filter__sub > ul { opacity: 1; visibility: visible; transition: opacity .25s .06s, visibility 0s; }
.avg-filter__sub .avg-filter__link { padding: 9px 4px; font-size: .78125rem; }

/* ── Rejilla de productos ──────────────────────────────────────────────── */

.avg-shop__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.avg-shop__cell { min-width: 0; margin: 0; }

/* Tarjeta del Cotizador con el look del diseño. */
html body .avg-shop .ozc-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 22px 22px 20px;
	border: 1px solid #d9d9d9;
	border-radius: 4px;
	background: #fff;
	color: #111;
	font-family: var(--avg-body);
	box-shadow: none;
	transition: translate .4s var(--avg-ease), box-shadow .4s var(--avg-ease);
}
@media (hover: hover) {
	html body .avg-shop .ozc-product-card:hover {
		translate: 0 -4px;
		box-shadow: 0 24px 40px -26px rgba(236, 103, 27, .75);
	}
	html body .avg-shop .ozc-product-card:hover .ozc-product-card__media img { scale: 1.05; }
}

/* Orden visual: imagen · categoría · nombre · precio · botón. */
html body .avg-shop .ozc-product-card__media { order: 1; }
html body .avg-shop .ozc-product-card__category { order: 2; }
html body .avg-shop .ozc-product-card__title { order: 3; }
html body .avg-shop .ozc-product-card__price { order: 4; }
html body .avg-shop .ozc-product-card__actions { order: 5; }

html body .avg-shop .ozc-product-card__section { margin: 0; padding: 0; }

html body .avg-shop .ozc-product-card__media {
	position: static;
	display: block;
	aspect-ratio: 1 / 1;
	margin: 0 0 18px;
	overflow: hidden;
	background: #fff;
}
html body .avg-shop .ozc-product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: scale .6s var(--avg-ease);
}
html body .avg-shop .ozc-product-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 2px;
	background: #f3f3f3;
}

/* Marca: etiqueta gris arriba a la derecha. */
html body .avg-shop .ozc-product-card__badge {
	position: absolute;
	top: 14px;
	right: 14px;
	left: auto;
	z-index: 1;
	max-width: calc(100% - 28px);
	padding: 5px 10px;
	border: 0;
	border-radius: 2px;
	background: #ececec;
	color: #333;
	font: 500 .625rem/1 var(--avg-body);
	letter-spacing: .03em;
	text-transform: uppercase;
}
html body .avg-shop .ozc-product-card__brand { display: none; }

html body .avg-shop .ozc-product-card__category {
	margin-bottom: 6px;
	color: #3a3a3a;
	font: 400 .6875rem/1.3 var(--avg-body);
	letter-spacing: .06em;
	text-align: left;
	text-transform: uppercase;
}
html body .avg-shop .ozc-product-card__title {
	min-height: calc(1.2em * 2);
	margin: 0 0 6px;
	font: 600 1.25rem/1.2 var(--avg-body) !important;
	letter-spacing: -.012em;
	text-align: left;
	text-transform: none;
}
html body .avg-shop .ozc-product-card__title a { color: #111 !important; text-decoration: none !important; }
html body .avg-shop .ozc-product-card__price {
	color: #111;
	font: 600 1rem/1.3 var(--avg-body);
	text-transform: lowercase;
}
html body .avg-shop .ozc-product-card__price del { color: #888; font-weight: 400; margin-right: 6px; }
html body .avg-shop .ozc-product-card__price ins { text-decoration: none; }

html body .avg-shop .ozc-product-card__actions { margin-top: auto; padding-top: 16px; }

/* Botón «Cotizar»: responde al presionar (no al soltar) y confirma al agregar. */
html body .avg-shop .ozc-product-card__btn--primary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	min-height: 40px;
	padding: 0 14px;
	border: 0;
	border-radius: 3px;
	background: var(--avg-grad);
	color: #fff !important;
	font: 600 .875rem/1 var(--avg-body);
	letter-spacing: .01em;
	text-decoration: none !important;
	cursor: pointer;
	transition: filter .2s, scale .12s var(--avg-ease), opacity .2s;
}
html body .avg-shop .ozc-product-card__btn--primary::before {
	content: '';
	flex: none;
	width: 15px;
	height: 15px;
	margin: 0;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2.2l2.3 11h10.8l2-8H6.3'/%3E%3Ccircle cx='9.5' cy='19.5' r='1.5'/%3E%3Ccircle cx='17' cy='19.5' r='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2.2l2.3 11h10.8l2-8H6.3'/%3E%3Ccircle cx='9.5' cy='19.5' r='1.5'/%3E%3Ccircle cx='17' cy='19.5' r='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: scale .3s var(--avg-ease);
}
html body .avg-shop .ozc-product-card__btn--primary:hover { filter: brightness(1.08); }
html body .avg-shop .ozc-product-card__btn--primary:active { scale: .97; filter: brightness(.95); transition-duration: .06s; }
html body .avg-shop .ozc-product-card__btn--primary:focus-visible { outline: 2px solid var(--avg-orange); outline-offset: 2px; }
html body .avg-shop .ozc-product-card__btn--primary.loading,
html body .avg-shop .ozc-product-card__btn--loading { opacity: .7; pointer-events: none; }
html body .avg-shop .ozc-product-card__btn--primary.loading::before { animation: avg-shop-pulse .7s var(--avg-ease) infinite alternate; }
/* Agregado: el carrito se cambia por un check. */
html body .avg-shop .ozc-product-card__btn--primary.added::before,
html body .avg-shop .ozc-product-card__btn--added::before {
	content: '';
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
	font-weight: inherit;
}
html body .avg-shop .ozc-product-card a.added_to_cart { display: none; }
@keyframes avg-shop-pulse { to { scale: .7; } }

/* ── Paginación ────────────────────────────────────────────────────────── */

.avg-pagination { margin-top: clamp(36px, 3vw, 56px); }
.avg-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
}
.avg-pagination li { margin: 0; border: 0; }
html body .avg-pagination .page-numbers:is(a, span) {
	display: grid;
	place-items: center;
	min-width: 38px;
	height: 38px;
	padding: 0 8px;
	border: 1px solid #333;
	border-radius: 4px;
	background: transparent;
	color: rgba(255, 255, 255, .55);
	font: 500 .8125rem/1 var(--avg-body);
	text-decoration: none;
	transition: background-color .2s, border-color .2s, color .2s, scale .1s;
}
html body .avg-pagination a.page-numbers:hover { border-color: #666; color: #fff; }
html body .avg-pagination a.page-numbers:active { scale: .92; }
html body .avg-pagination a.page-numbers:focus-visible { outline: 2px solid var(--avg-orange); outline-offset: 2px; }
html body .avg-pagination .page-numbers.current { border-color: #3a3a3a; background: #3a3a3a; color: #fff; }
html body .avg-pagination .page-numbers.dots { border-color: #333; }

/* Scroll infinito (avg-site.js): la paginación queda solo como respaldo sin JS. */
.avg-infinite .avg-pagination { display: none; }
.avg-shop__loader {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	min-height: 1px;
	margin-top: clamp(28px, 2.4vw, 44px);
	color: rgba(255, 255, 255, .55);
	font: 500 .875rem/1 var(--avg-body);
}
.avg-shop__loader:not(.is-loading) > * { display: none; }
.avg-shop__loader-spin {
	width: 22px;
	height: 22px;
	border: 2px solid #333;
	border-top-color: var(--avg-orange);
	border-radius: 50%;
	animation: avg-shop-spin .8s linear infinite;
}
@keyframes avg-shop-spin { to { rotate: 360deg; } }

/* ── Sin productos ─────────────────────────────────────────────────────── */

.avg-shop__empty {
	display: grid;
	justify-items: center;
	gap: 22px;
	padding: 72px 24px;
	border: 1px dashed #333;
	border-radius: 4px;
	text-align: center;
}
.avg-shop__empty p { margin: 0; color: var(--avg-muted); font-size: 1rem; }

.avg-shop .woocommerce-notices-wrapper:not(:empty) { margin-bottom: 20px; }

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1280px) {
	.avg-shop__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.avg-shop__layout { grid-template-columns: 250px minmax(0, 1fr); }
}

/* Botón y panel de filtros: solo en tablet y móvil. */
.avg-filters-btn,
.avg-filters-scrim,
.avg-filters-head { display: none; }

@media (max-width: 1024px) {
	.avg-shop-hero { padding-top: 92px; }
	.avg-shop__layout { grid-template-columns: 1fr; gap: 20px; }

	.avg-filters-btn {
		display: inline-flex;
		align-items: center;
		justify-self: start;
		gap: 10px;
		height: 44px;
		padding: 0 20px;
		border: 1px solid #2c2c2c;
		border-radius: 4px;
		background: #0b0b0b;
		color: #fff;
		font: 600 .875rem/1 var(--avg-body);
		letter-spacing: .04em;
		text-transform: uppercase;
		cursor: pointer;
		transition: border-color .2s, scale .1s;
	}
	.avg-filters-btn svg { color: var(--avg-orange); }
	.avg-filters-btn:hover { border-color: var(--avg-orange); }
	.avg-filters-btn:active { scale: .97; }
	.avg-filters-btn:focus-visible { outline: 2px solid var(--avg-orange); outline-offset: 2px; }

	/* Panel lateral: entra desde la izquierda y vuelve por el mismo lado. */
	.avg-shop__sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 100000;
		display: flex;
		flex-direction: column;
		gap: 16px;
		width: min(86vw, 360px);
		padding: 0 16px 24px;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: #080808;
		box-shadow: 24px 0 48px -24px rgba(0, 0, 0, .9);
		translate: -102% 0;
		visibility: hidden;
		transition: translate .45s var(--avg-ease), visibility 0s linear .45s;
	}
	.avg-filters-open .avg-shop__sidebar {
		translate: 0 0;
		visibility: visible;
		transition: translate .45s var(--avg-ease), visibility 0s;
	}
	/* Dentro del panel no hay animación de entrada por scroll. */
	.avg-shop__sidebar .avg-reveal { opacity: 1 !important; translate: none !important; }
	.avg-filter__scroll { max-height: none; }

	.avg-filters-head {
		position: sticky;
		top: 0;
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0 -16px;
		padding: 18px 16px;
		border-bottom: 1px solid var(--avg-line);
		background: #080808;
	}
	.avg-filters-head__title { color: #fff; font: 400 1.75rem/1 var(--avg-display); text-transform: uppercase; }
	.avg-filters-head__close {
		display: grid;
		place-items: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 1px solid #2c2c2c;
		border-radius: 4px;
		background: transparent;
		color: #fff;
		cursor: pointer;
	}
	.avg-filters-head__close:hover { border-color: var(--avg-orange); color: var(--avg-orange); }

	.avg-filters-scrim {
		position: fixed;
		inset: 0;
		z-index: 99999;
		display: block;
		background: rgba(0, 0, 0, .6);
		opacity: 0;
		transition: opacity .3s ease;
	}
	.avg-filters-scrim[hidden] { display: none; }
	.avg-filters-open .avg-filters-scrim { opacity: 1; }
	.avg-filters-open { overflow: hidden; }
}

@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
	.avg-shop__sidebar,
	.avg-filters-open .avg-shop__sidebar { transition: none; }
}

@media (max-width: 768px) {
	.avg-shop__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	html body .avg-shop .ozc-product-card { padding: 14px 14px 14px; }
	html body .avg-shop .ozc-product-card__badge { top: 10px; right: 10px; }
	html body .avg-shop .ozc-product-card__title { font-size: 1rem !important; }
	html body .avg-shop .ozc-product-card__category { font-size: .625rem; }
	html body .avg-shop .ozc-product-card__price { font-size: .9375rem; }
	html body .avg-shop .ozc-product-card__actions { padding-top: 12px; }
}

@media (max-width: 600px) {
	.avg-shop__container { padding: 0 24px; }
	/* Celular: una tarjeta por fila, con aire dentro y entre tarjetas. */
	.avg-shop__grid { grid-template-columns: 1fr; gap: 18px; }
	html body .avg-shop .ozc-product-card { padding: 20px 20px 20px; }
	.avg-filter { padding: 18px 10px 16px 18px; }
	html body .avg-filter__title { margin-bottom: 10px; font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
	.avg-filter__sub,
	.avg-filter__sub > ul,
	.avg-filter__toggle svg,
	.avg-filter__link,
	html body .avg-shop .ozc-product-card,
	html body .avg-shop .ozc-product-card__media img { transition: none; }
	html body .avg-shop .ozc-product-card:hover { translate: none; }
	html body .avg-shop .ozc-product-card__btn--primary.loading::before { animation: none; }
}
