/* ==========================================================================
   Abastos Peruanos — base, header y footer (todo el sitio)
   La portada tiene sus estilos en ap-home.css. Se carga después de
   nuda-site.css: redefine sus variables para que tienda, ficha de producto
   y páginas internas tomen el rojo y la tipografía de la marca.
   ========================================================================== */

:root {
	--ap-red: #c3141b;
	--ap-red-dark: #9e0f15;
	--ap-ink: #141414;
	--ap-muted: #6f6f73;
	--ap-line: #e4e4e4;
	--ap-soft: #f3f3f3;
	--ap-dark: #121212;
	--ap-container: 1360px;
	--ap-gutter: 24px;
	--ap-font: 'DM Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--ap-ease: cubic-bezier(.22, 1, .36, 1);
	/* Escala de texto común a todo el sitio. */
	--ap-fs-body: .9375rem;   /* 15 px · párrafos y datos de tarjetas */
	--ap-lh-body: 1.6;
	--ap-fs-small: .875rem;   /* 14 px · texto secundario bajo un título */
	--ap-fs-lead: 1.125rem;   /* 18 px · frase de entrada bajo un título grande */
	--ap-body-color: #3c3c40;

	--nuda-red: var(--ap-red);
	--nuda-red-dark: var(--ap-red-dark);
	--nuda-ink: var(--ap-ink);
	--nuda-display: var(--ap-font);
	--nuda-body: var(--ap-font);
}

/* La marca es rojo, negro y blanco: nada naranja. Los acentos heredados de
   AVG (--avg-*) y el que imprime el Personalizador del tema padre para los
   filtros de la tienda pasan al rojo de Abastos. `html:root` gana al :root
   en línea del tema padre. */
html:root {
	--avg-orange: var(--ap-red);
	--avg-red: var(--ap-red);
	--avg-grad: linear-gradient(90deg, var(--ap-red) 0%, var(--ap-red-dark) 100%);
	--OZ-Shop-Filter-Title-Accent: var(--ap-red);
}
/* Aviso del formulario de cotización (OZ Cotizador lo pinta ámbar). */
html body .ozc-quote-cart__form-feedback:not(.ozc-quote-cart__form-feedback--success) {
	border-left-color: var(--ap-red);
	background: #fdf2f2;
	color: var(--ap-ink);
}

body { font-family: var(--ap-font); }

.ap-wrap {
	width: min(var(--ap-container), 100% - var(--ap-gutter) * 2);
	margin-inline: auto;
}

.ap-header,
.ap-header *,
.ap-footer,
.ap-footer * { box-sizing: border-box; }

/* ── Botones ────────────────────────────────────────────────────────────── */

.ap-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 0 26px;
	border: 1.5px solid transparent;
	border-radius: 999px;
	font: 600 .875rem/1 var(--ap-font);
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s, translate .2s var(--ap-ease);
}
.ap-btn:hover { translate: 0 -1px; }
.ap-btn--sm { min-height: 30px; padding: 0 20px; font-size: .875rem; }
.ap-btn--light { background: #fff; color: var(--ap-ink); }
.ap-btn--light:hover { background: var(--ap-red); color: #fff; }
.ap-btn--outline { border-color: var(--ap-red); background: #fff; color: var(--ap-ink); }
.ap-btn--outline:hover { background: var(--ap-red); color: #fff; }

/* Iconos de línea (máscara SVG): se pintan con el color del texto. */
.ap-ico::before {
	content: '';
	flex: 0 0 auto;
	display: inline-block;
	width: var(--ap-ico-size, 22px);
	height: var(--ap-ico-size, 22px);
	background: var(--ap-ico-color, currentColor);
	-webkit-mask: var(--ap-ico) center / contain no-repeat;
	mask: var(--ap-ico) center / contain no-repeat;
}
.ap-ico--shield { --ap-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 6v5.5c0 4.4 3 8 7 9.5 4-1.5 7-5.1 7-9.5V6l-7-3Z'/%3E%3Cpath d='m9 12 2.2 2.2L15.5 10'/%3E%3C/svg%3E"); }
.ap-ico--box { --ap-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8 12 3 3 8v8l9 5 9-5V8Z'/%3E%3Cpath d='m3 8 9 5 9-5M12 13v8'/%3E%3C/svg%3E"); }
.ap-ico--target { --ap-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='12' cy='12' r='1.4' fill='%23000'/%3E%3C/svg%3E"); }
.ap-ico--truck { --ap-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6h11.5v10.5H2.5zM14 10h4l3.5 3.5v3H14'/%3E%3Ccircle cx='7' cy='17.5' r='1.8'/%3E%3Ccircle cx='17.5' cy='17.5' r='1.8'/%3E%3C/svg%3E"); }
.ap-ico--headset { --ap-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14v-2a8 8 0 0 1 16 0v2'/%3E%3Crect x='3' y='13' width='4' height='6' rx='1.2'/%3E%3Crect x='17' y='13' width='4' height='6' rx='1.2'/%3E%3Cpath d='M20 19a3 3 0 0 1-3 3h-3'/%3E%3C/svg%3E"); }
.ap-ico--gear { --ap-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1'/%3E%3C/svg%3E"); }

/* ── Header ─────────────────────────────────────────────────────────────── */

/* El header no es fijo: el contenido no necesita hueco arriba. */
body .site { padding-top: 0 !important; }

.ap-header {
	position: relative;
	z-index: 1000;
	background: #fff;
	color: var(--ap-ink);
	font-family: var(--ap-font);
}
.ap-header__row { display: flex; align-items: center; gap: 28px; }
.ap-header__top .ap-header__row { min-height: 82px; }

.ap-header__logo { flex: 0 0 auto; display: block; line-height: 0; }
.ap-header__logo img { width: 168px; height: auto; }
.ap-header__logo-text { font: 700 1.375rem/1 var(--ap-font); color: var(--ap-red); }

.ap-header__nav { flex: 1 1 auto; }
.ap-header__nav > ul {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px 34px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ap-header__link {
	display: inline-flex;
	align-items: center;
	padding: 8px 0;
	border: 0;
	background: none;
	color: var(--ap-ink);
	font: 500 .9375rem/1 var(--ap-font);
	text-decoration: none;
	cursor: pointer;
	transition: color .2s;
}
.ap-header__link:hover,
.ap-header__link.is-current,
.ap-header__link[aria-expanded="true"] { color: var(--ap-red); }
.ap-header__link--drop::after {
	content: '';
	width: 5px;
	height: 5px;
	margin: -3px 0 0 8px;
	border: solid currentColor;
	border-width: 0 1.5px 1.5px 0;
	transform: rotate(45deg);
	transition: transform .2s, margin .2s;
}
.ap-header__link--drop[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(-135deg); }

.ap-header__phones { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; color: var(--ap-ink); }
.ap-header__phones svg { color: var(--ap-red); }
.ap-header__phones p { display: grid; gap: 3px; margin: 0; font: 500 .875rem/1.2 var(--ap-font); }
.ap-header__phones a { color: var(--ap-ink); text-decoration: none; white-space: nowrap; }
.ap-header__phones a:hover { color: var(--ap-red); }

/* Panel de marcas (megamenú). */
.ap-header .ap-mega {
	position: absolute;
	top: 100%;
	left: 50%;
	z-index: 30;
	width: min(var(--ap-container), 100% - var(--ap-gutter) * 2);
	padding: 24px;
	border: 1px solid var(--ap-line);
	border-radius: 0 0 14px 14px;
	background: #fff;
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .3);
	transform: translateX(-50%);
	animation: ap-drop .25s var(--ap-ease);
}
.ap-header .ap-mega[hidden] { display: none; }
/* Los paneles nacen del botón que los abre (transform-origin en cada uno). */
@keyframes ap-drop { from { opacity: 0; translate: 0 -6px; scale: .985; } }
.ap-header .ap-mega { transform-origin: top center; }
.ap-header__cats-panel { transform-origin: top left; }
.ap-mega__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ap-mega__brand {
	display: grid;
	place-items: center;
	height: 72px;
	padding: 12px 16px;
	border: 1px solid var(--ap-line);
	border-radius: 999px;
	background: #fff;
	transition: border-color .2s, translate .2s var(--ap-ease);
}
.ap-mega__brand:hover { border-color: var(--ap-red); translate: 0 -2px; }
.ap-mega__logo { width: auto; max-width: 75%; height: 30px; object-fit: contain; }
.ap-mega__name { color: var(--ap-ink); font: 600 .875rem/1.2 var(--ap-font); text-align: center; }

/* Barra roja: categorías + buscador. */
.ap-header__bar { --ap-bar-h: 60px; background: var(--ap-red); color: #fff; }
.ap-header__bar .ap-header__row { justify-content: space-between; min-height: var(--ap-bar-h); }

.ap-header__cats { position: relative; }
.ap-header__cats-btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	height: var(--ap-bar-h);
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	font: 600 1.0625rem/1 var(--ap-font);
	cursor: pointer;
}
.ap-header__cats-btn svg { width: 20px; height: 20px; }
.ap-header__cats-btn::after {
	content: '';
	width: 6px;
	height: 6px;
	margin: -3px 0 0 2px;
	border: solid currentColor;
	border-width: 0 1.5px 1.5px 0;
	transform: rotate(45deg);
	transition: transform .2s, margin .2s;
}
.ap-header__cats-btn[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(-135deg); }

.ap-header__cats-panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 20;
	width: min(720px, calc(100vw - var(--ap-gutter) * 2));
	padding: 14px;
	border: 1px solid var(--ap-line);
	border-radius: 0 0 14px 14px;
	background: #fff;
	box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .3);
	animation: ap-drop .25s var(--ap-ease);
}
.ap-header__cats-panel[hidden] { display: none; }
.ap-header__cats-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Cabecera (título + X) de los paneles laterales; solo se ve en móvil. */
.ap-drawer__head { display: none; }
.ap-header__scrim { display: none; }
.ap-header__cats-panel a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	color: var(--ap-ink);
	font: 500 .875rem/1.25 var(--ap-font);
	text-decoration: none;
}
.ap-header__cats-panel a:hover { background: var(--ap-soft); color: var(--ap-red); }
.ap-header__cat-ico { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px; background: var(--ap-soft); }
.ap-header__cat-ico img { width: 22px; height: 22px; object-fit: contain; }

html body .ap-header .ap-header__search {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 1 520px;
	min-width: 0;
	max-width: 520px;
	margin: 0;
}
html body .ap-header .ap-header__search input[type="search"] {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: 40px;
	margin-right: -20px;
	padding: 0 32px 0 20px;
	border: 0;
	border-radius: 999px 0 0 999px;
	background: #fff;
	color: var(--ap-ink);
	font: 400 .9375rem/1 var(--ap-font);
	box-shadow: none;
	outline: none;
}
.ap-header__search input::placeholder { color: #9a9a9a; }
html body .ap-header .ap-header__search button {
	position: relative;
	flex: 0 0 auto;
	width: auto;
	min-width: 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	background: var(--ap-ink);
	color: #fff;
	font: 600 .9375rem/1 var(--ap-font);
	cursor: pointer;
	transition: background-color .2s;
}
html body .ap-header .ap-header__search button svg { width: 17px; height: 17px; }
html body .ap-header .ap-header__search button:hover { background: #000; }

/* OZ Cotizador: el carrito lateral cerrado dejaba su sombra en el borde derecho. */
.ozc-sidecart:not(.ozc-sidecart--open) .ozc-sidecart__panel { box-shadow: none; }
.ap-header__search .nuda-search-results { top: calc(100% + 8px); }

.ap-header__burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	margin-left: auto;
	padding: 0 11px;
	border: 1px solid var(--ap-line);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
}
.ap-header__burger span { display: block; height: 2px; border-radius: 2px; background: var(--ap-ink); transition: transform .3s var(--ap-ease), opacity .2s; }
.ap-header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ap-header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ap-header__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1180px) {
	.ap-header__phones p span + span { display: none; }
	.ap-header__nav > ul { gap: 6px 22px; }
}

@media (max-width: 1024px) {
	.ap-header__top .ap-header__row { flex-wrap: wrap; gap: 14px; min-height: 68px; }
	.ap-header__logo img { width: 140px; }
	.ap-header__phones { margin-left: auto; }
	.ap-header__burger { display: flex; margin-left: 0; }
	/* Paneles laterales: el menú entra por la derecha y las categorías por la
	   izquierda (nuda-site.js pone .is-open y .has-drawer en el header). */
	.ap-header.has-drawer { z-index: 100000; }
	html.ap-drawer-open { overflow: hidden; }
	.ap-header__nav,
	.ap-header__cats-panel,
	.ap-header__cats-panel[hidden] {
		display: block;
		position: fixed;
		top: 0;
		bottom: 0;
		z-index: 2;
		width: min(340px, 86vw);
		height: 100vh;
		height: 100dvh;
		margin: 0;
		padding: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		border: 0;
		border-radius: 0;
		background: #fff;
		animation: none;
		visibility: hidden;
		transition: transform .35s var(--ap-ease), visibility .35s;
	}
	.ap-header__nav { right: 0; box-shadow: -8px 0 30px rgba(0, 0, 0, .22); transform: translateX(100%); }
	.ap-header__cats-panel,
	.ap-header__cats-panel[hidden] { left: 0; box-shadow: 8px 0 30px rgba(0, 0, 0, .22); transform: translateX(-100%); }
	.ap-header__nav.is-open,
	.ap-header__cats-panel.is-open { transform: none; visibility: visible; }

	.ap-drawer__head {
		position: sticky;
		top: 0;
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 14px 16px 14px 20px;
		background: var(--ap-red);
		color: #fff;
		font: 600 1rem/1 var(--ap-font);
	}
	.ap-drawer__close {
		display: grid;
		place-items: center;
		width: 36px;
		height: 36px;
		padding: 0;
		border: 0;
		border-radius: 8px;
		background: transparent;
		color: #fff;
		cursor: pointer;
	}
	.ap-drawer__close:hover { background: rgba(255, 255, 255, .16); }

	.ap-header__scrim {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 1;
		background: rgba(0, 0, 0, .5);
		opacity: 0;
		visibility: hidden;
		transition: opacity .3s, visibility .3s;
	}
	.ap-header.has-drawer .ap-header__scrim { opacity: 1; visibility: visible; }

	.ap-header__nav > ul { flex-direction: column; align-items: stretch; gap: 0; padding: 6px 20px 20px; }
	.ap-header__nav .ap-header__link { display: flex; width: 100%; padding: 14px 0; border-bottom: 1px solid #f0f0f0; font-size: .9375rem; text-align: left; }
	.ap-header__cats-list { grid-template-columns: 1fr; padding: 10px; }
	.ap-header .ap-mega { position: static; width: auto; padding: 12px 0 4px; border: 0; border-radius: 0; box-shadow: none; transform: none; }
	.ap-mega__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.ap-mega__brand { height: 56px; padding: 8px; }
	.ap-mega__logo { height: 22px; }
}

@media (max-width: 640px) {
	.ap-header__phones { display: none; }
	.ap-header__burger { margin-left: auto; }
	.ap-header__bar .ap-header__row { gap: 14px; }
	html body .ap-header .ap-header__search { flex: 1 1 auto; max-width: none; }
	html body .ap-header .ap-header__search button { padding: 0 14px; font-size: 0; gap: 0; }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.ap-footer {
	background: var(--ap-dark);
	color: #b3b3b8;
	font: 400 .875rem/1.6 var(--ap-font);
}
.ap-footer__grid {
	display: grid;
	grid-template-columns: 1.5fr 1fr 1fr 1fr;
	gap: 40px;
	padding: 70px 0 56px;
}
.ap-footer__logo {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: #fff;
	font: 700 .9375rem/1 var(--ap-font);
	letter-spacing: .02em;
	text-decoration: none;
	text-transform: uppercase;
}
.ap-footer__logo-img { display: block; width: 210px; max-width: 100%; height: auto !important; }
.ap-footer__brand p { max-width: 340px; margin: 20px 0 0; }
.ap-footer__social { display: flex; gap: 10px; margin-top: 22px; }
.ap-footer__social a {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #2a2a2e;
	color: #fff;
	transition: background-color .2s;
}
.ap-footer__social a:hover { background: var(--ap-red); }

/* Título de columna con una línea roja corta debajo. */
html body .ap-footer .ap-footer__title {
	position: relative;
	margin: 0 0 22px;
	padding-bottom: 12px;
	color: #fff;
	font: 600 .9375rem/1.2 var(--ap-font);
	letter-spacing: 0 !important;
	text-transform: none;
}
html body .ap-footer .ap-footer__title::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 28px;
	height: 2px;
	border-radius: 2px;
	background: var(--ap-red);
}
.ap-footer__col ul { margin: 0; padding: 0; list-style: none; }
.ap-footer__col li { margin: 0 0 8px; }
.ap-footer__col a { color: #b3b3b8; text-decoration: none; transition: color .2s; }
.ap-footer__col a:hover { color: #fff; }

/* Enlaces de columna: flecha roja que avanza al pasar el mouse. */
.ap-footer__link { display: inline-flex; align-items: center; gap: 8px; }
.ap-footer__link svg { flex: none; color: var(--ap-red); transition: translate .2s var(--ap-ease); }
.ap-footer__link:hover svg { translate: 3px 0; }

/* Información: icono rojo en círculo a la izquierda de cada bloque. */
.ap-footer__info-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; align-items: start; margin-bottom: 16px; }
.ap-footer__info-row:last-child { margin-bottom: 0; }
.ap-footer__info-ico {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #2a2a2e;
	color: var(--ap-red);
}
.ap-footer__info-row :is(ul, p) { margin: 0; padding-top: 5px; overflow-wrap: anywhere; }
.ap-footer__info li { margin-bottom: 2px; }

.ap-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	padding: 22px 0 34px;
	border-top: 1px solid #26262a;
}
.ap-footer__bottom p { margin: 0; color: #66666b; font-size: .875rem; }
/* Crédito: en el mismo gris; el nombre se aclara y pasa a rojo al pasar el mouse. */
/* Crédito discreto: mismo tono y peso que el texto de al lado; se aclara al pasar el mouse. */
html body .ap-footer__credit a { color: inherit; font-weight: 400; text-decoration: none; transition: color .2s; }
html body .ap-footer__credit a:hover { color: #d4d4d8; }
html body .ap-footer__credit a:focus-visible { outline: 2px solid var(--ap-red); outline-offset: 2px; border-radius: 2px; }

@media (max-width: 1024px) {
	.ap-footer__grid { grid-template-columns: 1fr 1fr; padding: 56px 0 40px; }
	.ap-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
	.ap-footer__grid { grid-template-columns: 1fr; gap: 30px; }
}

/* ── Botones de todo el sitio: sin sombras y con respuesta al presionar ─── */

html body :is(
	button, .button, [type="submit"], [type="button"],
	.ap-btn, .avg-btn, a[class*="btn"], a[class*="__btn"], [class*="-btn"],
	.single_add_to_cart_button, .add_to_cart_button, .added_to_cart, .checkout-button,
	.wc-block-components-button, .wp-element-button, .wp-block-button__link
) {
	box-shadow: none !important;
}

/* Respuesta instantánea en pointer-down: el botón se hunde un poco. */
html body :is(
	button, .button, [type="submit"],
	.ap-btn, .avg-btn, a[class*="btn"], a[class*="__btn"],
	.single_add_to_cart_button, .add_to_cart_button, .checkout-button,
	.wc-block-components-button, .wp-element-button
):not(:disabled):active {
	scale: .97;
	transition-duration: .1s;
}
.ap-btn { transition-property: background-color, color, border-color, translate, scale; }

/* Un botón nunca se subraya (el tema subraya los enlaces al pasar el mouse). */
html body a:is(.button, .ap-btn, .avg-btn, [class*="btn"], [class*="__btn"]):is(:hover, :focus, :active) { text-decoration: none !important; }
/* Carruseles de productos de OZ Sliders (Más vendidos, Productos relacionados…):
   wc-products.css del plugin recorta el carril con overflow-x: clip, y así el
   dedo no puede deslizarlo en celular (solo funcionaban las flechas). Se vuelve
   a dejar desplazable, como el resto de carruseles; la barra sigue oculta. */
html body .ozs.ozs--wc-products:not(.ozs--no-drag) ul.products.ozs__track {
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	touch-action: pan-x pan-y;
}

/* Menú y teléfonos del header: sin subrayado (el tema lo pone al pasar el mouse). */
html body .ap-header a:is(:link, :visited, :hover, :focus, :active) { text-decoration: none !important; }

/* Con el foco del teclado, un anillo claro en vez de sombra. */
html body :is(button, .button, .ap-btn, a[class*="btn"], a[class*="__btn"]):focus-visible {
	outline: 2px solid var(--ap-red);
	outline-offset: 2px;
}

/* ── Marcas en carrusel infinito ([avg_marcas … estilo="ap"]) ─────────────
   Portada y «Nosotros»: fila 1 hacia la izquierda, fila 2 a la derecha.
   Cada pista lleva su juego de logos dos veces; desplazarla un -50% deja la
   segunda mitad exactamente donde empezaba la primera, sin salto. La
   separación va como margen de cada logo (no `gap`) para que las dos mitades
   midan lo mismo. Sale del contenedor hasta los bordes de la pantalla y se
   desvanece en ellos. */
html body .ap-brand-marquee {
	--ap-logo-w: 210px;
	--ap-logo-gap: 18px;
	display: grid;
	gap: 4px;
	margin: 0 calc(-1 * max(var(--ap-gutter), (100vw - var(--ap-container)) / 2));
	-webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
	mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
/* Aire arriba/abajo para el lift y la sombra del hover (la fila recorta). */
html body .ap-brand-marquee__row { overflow: hidden; padding: 4px 0 12px; }
html body .ap-brand-marquee__track {
	display: flex;
	width: max-content;
	margin: 0;
	padding: 0;
	list-style: none;
	/* Velocidad constante (~70 px/s) sea cual sea el número de logos. */
	animation: ap-brand-marquee calc(var(--n) * 3.2s) linear infinite;
}
/* Mismo prefijo que la regla de arriba: con menos especificidad, su shorthand
   `animation` devolvía dirección y estado a los valores por defecto. */
html body .ap-brand-marquee__row--right .ap-brand-marquee__track { animation-direction: reverse; }
/* Se detiene bajo el puntero o con el foco del teclado, para poder hacer clic. */
html body .ap-brand-marquee__row:is(:hover, :focus-within) .ap-brand-marquee__track { animation-play-state: paused; }
@keyframes ap-brand-marquee { to { transform: translateX(-50%); } }
html body .ap-brand-marquee__track > li { flex: 0 0 var(--ap-logo-w); width: auto; margin: 0 var(--ap-logo-gap) 0 0; padding: 0; }
html body .ap-brand-marquee .avg-brand-grid__item {
	box-sizing: border-box;
	display: grid;
	place-items: center;
	width: 100%;
	min-width: 0;
	height: 64px;
	padding: 10px 22px;
	border: 1px solid #e6e6e6;
	border-radius: 999px;
	background: #fff;
	transition: border-color .2s, translate .2s var(--ap-ease), box-shadow .2s;
}
html body .ap-brand-marquee .avg-brand-grid__item:hover {
	border-color: var(--ap-red);
	translate: 0 -2px;
	box-shadow: 0 12px 24px -20px rgba(0, 0, 0, .5);
}
html body .ap-brand-marquee .avg-brand-grid__logo {
	width: auto;
	max-width: 80%;
	height: 30px;
	object-fit: contain;
	filter: none;
	opacity: 1;
}
html body .ap-brand-marquee .avg-brand-grid__name { color: var(--ap-ink); font: 600 .9375rem/1.2 var(--ap-font); }
@media (max-width: 600px) {
	html body .ap-brand-marquee { --ap-logo-w: 150px; --ap-logo-gap: 10px; }
	html body .ap-brand-marquee .avg-brand-grid__item { height: 52px; padding: 8px 16px; }
}

/* ── Tarjeta de producto (OZ Cotizador) — la misma en todo el sitio ────────
   Tienda, «Más vendidos», «Productos por Categoría» y «Productos Relacionados».
   Marca en etiqueta negra arriba a la derecha, imagen, nombre, precio en rojo
   y botón de borde rojo a todo el ancho. */

html body .ozc-product-card {
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
	padding: 16px 16px 18px;
	border: 1px solid #cfcfcf;
	border-radius: 10px;
	background: #fff;
	box-shadow: none;
	color: var(--ap-ink);
	font-family: var(--ap-font);
	text-align: left;
	translate: none;
	transition: border-color .2s;
}
html body .ozc-product-card * { box-sizing: border-box; }
html body .ozc-product-card:hover { border-color: #9a9a9a; box-shadow: none; translate: none; }

html body .ozc-product-card .ozc-product-card__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / .92;
	margin: 0;
	padding: 18px 8px 4px;
	border: 0;
	border-radius: 0;
	background: #fff;
}
html body .ozc-product-card .ozc-product-card__media img {
	display: block;
	width: 100%;
	height: 100% !important;
	max-height: none;
	margin: 0;
	border: 0;
	background: transparent;
	object-fit: contain;
	transition: scale .4s var(--ap-ease);
}
html body .ozc-product-card:hover .ozc-product-card__media img { scale: 1.03; }

html body .ozc-product-card .ozc-product-card__badge {
	position: absolute;
	top: 0;
	right: 0;
	left: auto;
	bottom: auto;
	z-index: 1;
	display: inline-block;
	width: auto;
	max-width: 70%;
	margin: 0;
	padding: 5px 10px;
	border: 0;
	border-radius: 2px;
	background: #111;
	color: #fff;
	font: 500 .9375rem/1.2 var(--ap-font);
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* La marca ya va en la etiqueta: sin categoría ni «Marca: …». */
html body .ozc-product-card :is(.ozc-product-card__category, .ozc-product-card__brand) { display: none !important; }

/* .ozc-product-card__section suma especificidad: el maquetador pone sus h3 en negrita. */
html body .ozc-product-card .ozc-product-card__title.ozc-product-card__section {
	min-height: 0;
	margin: 18px 0 0 !important;
	padding: 0 8px;
	font: 500 1.125rem/1.3 var(--ap-font);
	letter-spacing: -.005em;
	text-align: left;
	text-transform: none;
	/* Máximo dos líneas con «…»; max-height corta cualquier asomo de una tercera. */
	display: -webkit-box !important;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2 !important;
	line-clamp: 2;
	overflow: hidden !important;
	height: auto !important;
	max-height: 2.6em !important;
}
html body .ozc-product-card .ozc-product-card__title a { display: inline !important; color: var(--ap-ink); text-decoration: none; transition: color .2s; }
html body .ozc-product-card .ozc-product-card__title a:hover { color: var(--ap-red); }

html body .ozc-product-card :is(.ozc-product-card__price, .price) {
	margin: 6px 0 0;
	padding: 0 8px;
	color: var(--ap-red);
	font: 500 1.375rem/1.2 var(--ap-font);
	text-align: left;
}
html body .ozc-product-card .ozc-product-card__price .price { margin: 0; padding: 0; }
html body .ozc-product-card :is(.ozc-product-card__price, .price) del { margin-right: 6px; color: #9a9a9a; font-size: .75em; }
html body .ozc-product-card :is(.ozc-product-card__price, .price) ins { text-decoration: none; }

html body .ozc-product-card .ozc-product-card__actions { margin-top: auto; padding: 18px 0 0; }
html body .ozc-product-card .ozc-product-card__btn--primary {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--ap-red);
	border-radius: 8px;
	background: #fff;
	box-shadow: none;
	color: var(--ap-ink);
	font: 400 1.1875rem/1 var(--ap-font);
	letter-spacing: 0;
	text-decoration: none;
	text-transform: none;
	transition: background-color .2s, color .2s, scale .1s ease-out;
}
html body .ozc-product-card .ozc-product-card__btn--primary:hover { background: var(--ap-red); color: #fff; }
html body .ozc-product-card .ozc-product-card__btn--primary.loading { opacity: .6; pointer-events: none; }
html body .ozc-product-card .ozc-product-card__btn--primary.added { background: var(--ap-red); color: #fff; }
/* WooCommerce añade «Ver carrito» tras agregar; basta con el estado del botón. */
html body .ozc-product-card .added_to_cart { display: none; }

@media (max-width: 600px) {
	html body .ozc-product-card { padding: 12px 12px 14px; }
	html body .ozc-product-card .ozc-product-card__title.ozc-product-card__section { margin-top: 12px !important; padding: 0 4px; font-size: 1rem; }
	html body .ozc-product-card :is(.ozc-product-card__price, .price) { padding: 0 4px; font-size: 1.125rem; }
	html body .ozc-product-card .ozc-product-card__badge { font-size: .8125rem; padding: 4px 8px; }
	html body .ozc-product-card .ozc-product-card__btn--primary { min-height: 42px; font-size: 1rem; }
}

/* ── Páginas internas del maquetador (carrito, checkout…): fondo claro ────
   avg-site.css las pinta de negro (diseño AVG anterior). */

html body:is(.avg-pb-page, .woocommerce-cart, .woocommerce-checkout),
html body:is(.avg-pb-page, .woocommerce-cart, .woocommerce-checkout) .site,
html body:is(.avg-pb-page, .woocommerce-cart, .woocommerce-checkout) .site-main,
html body:is(.avg-pb-page, .woocommerce-cart, .woocommerce-checkout) .site-main > article,
html body:is(.avg-pb-page, .woocommerce-cart, .woocommerce-checkout) .entry-content,
html body:is(.avg-pb-page, .woocommerce-cart, .woocommerce-checkout) .entry-content > .oz-pb-root { background: #fff !important; }
html body.avg-pb-page .oz-pb-root { color: var(--ap-ink); font-family: var(--ap-font); }

/* ── Carrito vacío ──────────────────────────────────────────────────────── */

html body.woocommerce-cart .wc-empty-cart-message {
	width: min(560px, 100% - var(--ap-gutter) * 2);
	margin: clamp(56px, 8vw, 110px) auto 0;
	text-align: center;
	animation: ap-cart-in .45s var(--ap-ease) both;
}
html body.woocommerce-cart .wc-empty-cart-message .cart-empty.woocommerce-info {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--ap-muted);
	font: 400 1.0625rem/1.5 var(--ap-font);
	text-align: center;
}
/* El icono de aviso de WooCommerce pasa a ser un carrito grande dentro de un círculo. */
html body.woocommerce-cart .wc-empty-cart-message .cart-empty.woocommerce-info::before {
	content: '';
	position: static;
	display: block;
	width: 96px;
	height: 96px;
	margin: 0 0 18px;
	border-radius: 50%;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c3141b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2.4 10.2a1.5 1.5 0 0 0 1.5 1.1h8.3a1.5 1.5 0 0 0 1.4-1.1L20.5 8H6.2'/%3E%3Ccircle cx='9.5' cy='19.5' r='1.3'/%3E%3Ccircle cx='17' cy='19.5' r='1.3'/%3E%3C/svg%3E") center / 44px no-repeat,
		#fdf0f0;
	color: transparent;
	font-size: 0;
}
html body.woocommerce-cart .cart-empty strong {
	display: block;
	color: var(--ap-ink);
	font: 700 clamp(1.625rem, 2.6vw, 2.25rem)/1.15 var(--ap-font);
	letter-spacing: -.02em;
}
html body.woocommerce-cart .cart-empty span { display: block; max-width: 420px; }

html body.woocommerce-cart .return-to-shop {
	margin: 30px 0 clamp(64px, 9vw, 120px);
	text-align: center;
	animation: ap-cart-in .45s .08s var(--ap-ease) both;
}
html body.woocommerce-cart .return-to-shop .button.wc-backward {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 32px;
	border: 0;
	border-radius: 6px;
	background: var(--ap-red);
	color: #fff;
	font: 600 1.0625rem/1 var(--ap-font);
	text-decoration: none;
	transition: background-color .2s, scale .1s ease-out;
}
html body.woocommerce-cart .return-to-shop .button.wc-backward::after {
	content: '';
	width: 16px;
	height: 16px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: translate .2s var(--ap-ease);
}
html body.woocommerce-cart .return-to-shop .button.wc-backward:hover { background: var(--ap-red-dark); color: #fff; }
html body.woocommerce-cart .return-to-shop .button.wc-backward:hover::after { translate: 3px 0; }

@keyframes ap-cart-in { from { opacity: 0; translate: 0 10px; } }
@media (prefers-reduced-motion: reduce) {
	html body.woocommerce-cart :is(.wc-empty-cart-message, .return-to-shop) { animation-name: ap-fade-only; }
}

/* ── 404: colores de la tienda (el marcado y las animaciones son del tema padre) ── */

html body .error-404-page { background: var(--ap-soft); font-family: var(--ap-font); }
html body .error-404-page .error-particle { background: rgba(195, 20, 27, .18); }
html body .error-404-page .error-404-wrapper {
	background: #fff;
	border-color: var(--ap-line);
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .18);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}
html body .error-404-page .error-ring { stroke: rgba(195, 20, 27, .3); }
html body .error-404-page .error-ring--inner { stroke: rgba(195, 20, 27, .15); }
html body .error-404-page .error-shield :is(path, line) { stroke: var(--ap-red); }
html body .error-404-page .error-dash { stroke: rgba(195, 20, 27, .25); }
html body .error-404-page .error-code { color: var(--ap-ink); font-family: var(--ap-font); text-shadow: none; }
html body .error-404-page .error-code::before { color: var(--ap-red); }
html body .error-404-page .error-code::after { color: #bdbdbd; }
html body .error-404-page .error-title { color: var(--ap-ink); font-family: var(--ap-font); }
html body .error-404-page .error-message { color: #6b6b6b; }
html body .error-404-page .error-btn { font-family: var(--ap-font); }
html body .error-404-page .error-btn--primary { background: var(--ap-ink); border-color: var(--ap-ink); color: #fff; }
html body .error-404-page .error-btn--primary:hover { background: #000; box-shadow: 0 8px 30px rgba(0, 0, 0, .2); color: #fff; }
html body .error-404-page .error-btn--accent { background: var(--ap-red); border-color: var(--ap-red); color: #fff; }
html body .error-404-page .error-btn--accent:hover { background: var(--ap-red-dark); box-shadow: 0 8px 30px rgba(195, 20, 27, .3); color: #fff; }

/* ── Movimiento reducido: sin desplazamientos, solo cambios de opacidad ─── */

@keyframes ap-fade-only { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
	html body :is(button, .button, .ap-btn, a[class*="btn"], a[class*="__btn"]):active { scale: none; }
	.ap-btn:hover,
	.ap-mega__brand:hover { translate: none; }
	.ap-header .ap-mega,
	.ap-header__cats-panel { animation-name: ap-fade-only; }
	.ap-header__nav, .ap-header__cats-panel, .ap-header__scrim { transition-duration: .01s; }
	/* Marcas: sin desplazamiento; solo los logos originales, centrados. */
	html body .ap-brand-marquee { margin: 0; -webkit-mask: none; mask: none; }
	html body .ap-brand-marquee__track { flex-wrap: wrap; justify-content: center; gap: 10px var(--ap-logo-gap); width: auto; animation: none; }
	html body .ap-brand-marquee__track > li { margin: 0; }
	html body .ap-brand-marquee__track > li.is-clone { display: none; }
}
