/* =========================================================================
   ARCORP — Cajón lateral de categorías (template-parts/site-header.php)
   Árbol plegado: categoría › subcategoría › tipo. Sin sombras: bordes finos.
   Carga después de style.css y pisa sus reglas antiguas del cajón.
   ========================================================================= */

.oz-cat-drawer {
	--cd-red: var(--ar-red, #e3131b);
	--cd-ink: #1a1a1a;
	--cd-muted: #6b6b6b;
	--cd-line: #ececec;
	--cd-soft: #f7f7f7;
	/* Debajo de la barra de administración de WordPress cuando está visible */
	top: var(--wp-admin--admin-bar--height, 0px);
}
.oz-cat-drawer .oz-cat-drawer__overlay { background: rgba(0, 0, 0, .55); }

.oz-cat-drawer .oz-cat-drawer__panel {
	width: min(360px, 88vw);
	background: #fff;
	box-shadow: none;
	border-right: 1px solid var(--cd-line);
	overflow: hidden;
}

/* Cabecera negra con línea roja, como el header */
.oz-cat-drawer .oz-cat-drawer__head {
	flex: none;
	position: static;
	padding: 18px 16px 18px 22px;
	background: #0b0b0b;
	border-bottom: 3px solid var(--cd-red);
}
.oz-cat-drawer .oz-cat-drawer__title {
	font-family: var(--ar-font-head, "Montserrat", sans-serif);
	font-size: 17px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: #fff;
}
.oz-cat-drawer .oz-cat-drawer__close { width: 36px; height: 36px; border-radius: 50%; }
.oz-cat-drawer .oz-cat-drawer__close:hover { background: rgba(255, 255, 255, .12); }
.oz-cat-drawer .oz-cat-drawer__close:focus-visible { outline: 2px solid var(--cd-red); outline-offset: 2px; }

.oz-cat-drawer .oz-cat-drawer__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.oz-cat-drawer .oz-cat-drawer__list,
.oz-cat-drawer .oz-cat-item__sub { list-style: none; margin: 0; padding: 0; background: none; }

/* Fila: enlace o botón que despliega */
.oz-cat-drawer .oz-cat-item { margin: 0; border: 0; }
.oz-cat-drawer .oz-cat-item__row {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 14px 18px 14px 22px;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	font: inherit;
	font-size: 15px;
	line-height: 1.3;
	color: var(--cd-ink);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}
.oz-cat-drawer .oz-cat-item__row:hover { background: var(--cd-soft); color: var(--cd-red); }
.oz-cat-drawer .oz-cat-item__row:focus-visible { outline: 2px solid var(--cd-red); outline-offset: -2px; }
.oz-cat-drawer .oz-cat-item__label { flex: 1 1 auto; min-width: 0; }
.oz-cat-drawer .oz-cat-item__chev { flex: none; color: #9a9a9a; transition: transform .2s ease, color .15s ease; }
.oz-cat-drawer .oz-cat-item.is-expanded > .oz-cat-item__row .oz-cat-item__chev { transform: rotate(180deg); color: var(--cd-red); }

/* Nivel 0: categorías principales */
.oz-cat-drawer .oz-cat-item--d0 { border-bottom: 1px solid var(--cd-line); }
.oz-cat-drawer .oz-cat-item--d0 > .oz-cat-item__row {
	font-family: var(--ar-font-head, "Montserrat", sans-serif);
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .02em;
}
.oz-cat-drawer .oz-cat-item--d0.is-expanded > .oz-cat-item__row {
	color: var(--cd-red);
	box-shadow: inset 3px 0 0 var(--cd-red);
}
.oz-cat-drawer .oz-cat-item--d0 > .oz-cat-item__sub {
	padding: 4px 0 10px;
	background: var(--cd-soft);
	border-top: 1px solid var(--cd-line);
}

/* Nivel 1: subcategorías (con su ícono) */
.oz-cat-drawer .oz-cat-item--d1 > .oz-cat-item__row { padding: 10px 18px 10px 22px; font-size: 14.5px; }
.oz-cat-drawer .oz-cat-item--d1 > .oz-cat-item__row:hover,
.oz-cat-drawer .oz-cat-item--all > .oz-cat-item__row:hover { background: #fff; }
.oz-cat-drawer .oz-cat-item--d1.is-expanded > .oz-cat-item__row { color: var(--cd-red); font-weight: 600; }
.oz-cat-drawer .oz-cat-item__icon {
	flex: none;
	width: 22px;
	height: 22px;
	object-fit: contain;
}
.oz-cat-drawer .oz-cat-item__icon--empty { display: inline-block; }
.oz-cat-drawer .oz-cat-item__row:hover .oz-cat-item__icon {
	/* Ícono negro → rojo de marca al pasar el mouse */
	filter: invert(15%) sepia(95%) saturate(6000%) hue-rotate(352deg) brightness(92%) contrast(105%);
}

/* Nivel 2: tipos (Cascos, Lentes…) */
.oz-cat-drawer .oz-cat-item--d1 > .oz-cat-item__sub { padding: 2px 0 6px; }
.oz-cat-drawer .oz-cat-item--d2 > .oz-cat-item__row { padding: 8px 18px 8px 56px; font-size: 14px; color: #444; }

/* Subcategoría con tipos: lista siempre abierta, el nombre hace de encabezado */
.oz-cat-drawer .oz-cat-item--d1.is-open-list > .oz-cat-item__row { font-weight: 600; padding-bottom: 6px; }
.oz-cat-drawer .oz-cat-item--d1.is-open-list > .oz-cat-item__sub { padding: 0 0 8px; }
.oz-cat-drawer .oz-cat-item--d1.is-open-list .oz-cat-item--d2 > .oz-cat-item__row {
	position: relative;
	padding-top: 6px;
	padding-bottom: 6px;
}
.oz-cat-drawer .oz-cat-item--d1.is-open-list .oz-cat-item--d2 > .oz-cat-item__row::before {
	content: "";
	position: absolute;
	left: 42px;
	top: 50%;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #c4c4c4;
	transform: translateY(-50%);
}
.oz-cat-drawer .oz-cat-item--d1.is-open-list .oz-cat-item--d2 > .oz-cat-item__row:hover::before { background: var(--cd-red); }

/* «Ver todo en …» al inicio de cada grupo */
.oz-cat-drawer .oz-cat-item--all > .oz-cat-item__row { padding-top: 10px; padding-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--cd-red); }
.oz-cat-drawer .oz-cat-item--d1 .oz-cat-item--all > .oz-cat-item__row { padding-left: 56px; }

/* Pie: ir a la tienda */
.oz-cat-drawer .oz-cat-drawer__shop {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 16px;
	padding: 13px 18px;
	background: var(--cd-red);
	border-radius: 999px;
	font-family: var(--ar-font-head, "Montserrat", sans-serif);
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	text-decoration: none;
}
.oz-cat-drawer .oz-cat-drawer__shop:hover { background: var(--ar-red-dark, #b80e14); color: #fff; }
.oz-cat-drawer .oz-cat-drawer__shop:focus-visible { outline: 2px solid var(--cd-ink); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.oz-cat-drawer .oz-cat-drawer__panel,
	.oz-cat-drawer .oz-cat-drawer__overlay,
	.oz-cat-drawer .oz-cat-item__chev { transition: none; }
}
