/* =========================================================================
   POLIZUNCHO — Header
   Barra azul fija a todo el ancho, siempre visible: no se oculta al hacer
   scroll en ninguna dirección.

   Variables de marca:
     --OZ-Color-3  #01356a  azul
     --OZ-Color-1  #00a7a9  turquesa
   ========================================================================= */

:root {
	--pz-navy: var(--OZ-Color-3, #01356a);
	--pz-teal: var(--OZ-Color-1, #00a7a9);
	--pz-teal-dark: #018e90;
	--pz-white: #ffffff;

	/* Altura real de la barra: la escribe el JS, aquí va el valor de arranque. */
	--pz-header-h: 92px;
	--pz-gutter: clamp(16px, 3.2vw, 60px);
	--pz-ease: cubic-bezier(.4, 0, .2, 1);

	/* Fondo de la página; el footer lo usa para el efecto de revelado. */
	--pz-page-bg: #ffffff;
}

body.woocommerce,
body.woocommerce-page {
	--pz-page-bg: #eef1f3;
}

html {
	scroll-padding-top: calc(var(--pz-header-h) + 16px);
}

/* La barra es fija: el hueco lo reserva .pz-page (ver pz-footer.css).
   No se usa `body { padding-top }` porque los estilos globales de WordPress
   (global styles) resetean el padding del body y ganarían por orden de carga. */

/* =========================================================================
   1. Barra
   ========================================================================= */

.pz-header {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 1000;
	background: var(--pz-navy);
	color: var(--pz-white);
}

/* Con la barra de administración de WordPress. */
body.admin-bar .pz-header { top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .pz-header { top: 46px; }
}

.pz-header__bar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	height: var(--pz-header-h);
	padding-inline: var(--pz-gutter);
}

/* =========================================================================
   2. Logo (columna central)
   ========================================================================= */

.pz-header__logo {
	grid-column: 2;
	display: flex;
	justify-content: center;
	min-width: 0;
}

.pz-logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	line-height: 0;
}

.pz-logo:hover { text-decoration: none; }

.pz-logo img {
	display: block;
	width: auto;
	height: clamp(34px, 3.2vw, 54px);
	max-width: 100%;
	object-fit: contain;
}

.pz-logo--text {
	line-height: 1.1;
	font-size: clamp(18px, 2.2vw, 26px);
	font-weight: 800;
	letter-spacing: .01em;
	color: var(--pz-white);
}

/* =========================================================================
   3. Menú (escritorio, columna izquierda)
   ========================================================================= */

.pz-header__nav {
	grid-column: 1;
	min-width: 0;
}

.pz-menu,
.pz-menu ul {
	display: flex;
	align-items: center;
	gap: clamp(18px, 2.4vw, 44px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.pz-menu li { margin: 0; }

.pz-menu a {
	position: relative;
	display: inline-block;
	padding: 6px 0;
	color: var(--pz-white);
	font-size: clamp(14px, 1.05vw, 17px);
	font-weight: 400;
	line-height: 1.2;
	white-space: nowrap;
	text-decoration: none;
	transition: color .2s var(--pz-ease);
}

.pz-menu a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--pz-teal);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .24s var(--pz-ease);
}

.pz-menu a:hover,
.pz-menu a:focus-visible {
	color: var(--pz-teal);
	text-decoration: none;
}

.pz-menu a:hover::after,
.pz-menu a:focus-visible::after { transform: scaleX(1); }

.pz-menu .current-menu-item > a,
.pz-menu .current_page_item > a,
.pz-menu .current-menu-ancestor > a,
.pz-menu .current-menu-parent > a {
	color: var(--pz-teal);
	font-weight: 600;
}

/* =========================================================================
   4. Acciones (columna derecha): buscador + Categorías
   ========================================================================= */

.pz-header__actions {
	grid-column: 3;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: clamp(10px, 1.1vw, 18px);
	min-width: 0;
}

/* Botón lupa: cuadrado redondeado con borde turquesa. */
.pz-searchbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 2px solid var(--pz-teal);
	border-radius: 14px;
	background: transparent;
	color: var(--pz-teal);
	cursor: pointer;
	transition: background-color .2s var(--pz-ease), color .2s var(--pz-ease);
}

.pz-searchbtn:hover,
.pz-searchbtn[aria-expanded="true"] {
	background: var(--pz-teal);
	color: var(--pz-white);
}

/* Píldora "Categorías". */
.pz-cats { position: relative; }

.pz-cats__btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 13px 26px;
	border: 0;
	border-radius: 999px;
	background: var(--pz-teal);
	color: var(--pz-white);
	font-family: inherit;
	font-size: clamp(14px, 1vw, 16px);
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .2s var(--pz-ease);
}

.pz-cats__btn:hover,
.pz-cats__btn[aria-expanded="true"] { background: var(--pz-teal-dark); }

.pz-cats__btn .pz-i--bars { flex: 0 0 auto; }

/* El árbol de categorías vive ahora en un panel lateral (ver §6). */

.pz-cats__empty {
	margin: 0;
	padding: 14px;
	color: #5b6b80;
	font-size: 14px;
}

.pz-cats__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pz-cats__item {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
}

.pz-cats__link {
	grid-column: 1;
	display: block;
	padding: 11px 14px;
	border-radius: 12px;
	color: var(--pz-navy);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.pz-cats__link:hover,
.pz-cats__link:focus-visible {
	background: rgba(0, 167, 169, .12);
	color: var(--pz-navy);
	text-decoration: none;
}

.pz-cats__more {
	grid-column: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--pz-navy);
	cursor: pointer;
	transition: background-color .2s var(--pz-ease), transform .24s var(--pz-ease);
}

.pz-cats__more:hover { background: rgba(1, 53, 106, .08); }
.pz-cats__more[aria-expanded="true"] { transform: rotate(180deg); }

.pz-cats__sub {
	grid-column: 1 / -1;
	margin: 2px 0 8px;
	padding: 0 0 0 14px;
	list-style: none;
	border-left: 2px solid rgba(0, 167, 169, .3);
}

.pz-cats__sub[hidden] { display: none; }

.pz-cats__sub a {
	display: block;
	padding: 9px 12px;
	border-radius: 10px;
	color: #35506e;
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
}

.pz-cats__sub a:hover,
.pz-cats__sub a:focus-visible {
	background: rgba(0, 167, 169, .1);
	color: var(--pz-navy);
	text-decoration: none;
}

/* =========================================================================
   5. Buscador desplegable
   ========================================================================= */

/* `overflow` se queda en `visible`: el panel de sugerencias del buscador en
   vivo (.oz-ls__panel) es absoluto y cuelga por debajo de esta caja; con
   `overflow: hidden` quedaba recortado y parecía dibujarse tras la página. */
.pz-search {
	position: relative;
	z-index: 2;
	overflow: visible;
	background: var(--pz-white);
	border-top: 1px solid rgba(255, 255, 255, .12);
	box-shadow: 0 18px 40px rgba(1, 53, 106, .16);
}

.pz-search[hidden] { display: none; }

.pz-search__inner {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px var(--pz-gutter);
}

.pz-search__inner .oz-ls { flex: 1 1 auto; min-width: 0; }

.pz-search__inner .ozpls-figma__form {
	display: flex;
	align-items: center;
	gap: 10px;
}

.pz-search__inner .ozpls-figma__inputWrap { flex: 1 1 auto; min-width: 0; }

.pz-search__inner input[type="search"] {
	width: 100%;
	height: 48px;
	padding: 0 18px;
	border: 2px solid rgba(1, 53, 106, .16);
	border-radius: 12px;
	background: #fff;
	color: var(--pz-navy);
	font-family: inherit;
	font-size: 16px;
}

.pz-search__inner input[type="search"]:focus {
	outline: none;
	border-color: var(--pz-teal);
	box-shadow: 0 0 0 3px rgba(0, 167, 169, .18);
}

.pz-search__inner .ozpls-figma__btn {
	flex: 0 0 auto;
	height: 48px;
	padding: 0 26px;
	border: 0;
	border-radius: 12px;
	background: var(--pz-teal);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.pz-search__inner .ozpls-figma__btn:hover { background: var(--pz-teal-dark); }

.pz-search__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--pz-navy);
	cursor: pointer;
}

.pz-search__close:hover { background: rgba(1, 53, 106, .08); }

/* =========================================================================
   6. Hamburguesa + menú lateral (tablet / móvil)
   ========================================================================= */

.pz-burger {
	grid-column: 1;
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0 9px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	cursor: pointer;
}

.pz-burger span {
	display: block;
	height: 2.5px;
	border-radius: 3px;
	background: var(--pz-white);
	transition: transform .26s var(--pz-ease), opacity .2s var(--pz-ease);
}

.pz-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.pz-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.pz-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Velo y cajones van por encima de los flotantes del sitio (WhatsApp, carrito
   y subir: z-index 9997–9998) y por debajo del carrito lateral (1000000). */
.pz-scrim {
	position: fixed;
	inset: 0;
	z-index: 999990;
	background: rgba(1, 27, 53, .55);
	opacity: 0;
	transition: opacity .28s var(--pz-ease);
}

.pz-scrim[hidden] { display: none; }
.pz-scrim.is-open { opacity: 1; }

.pz-drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 999991;
	display: flex;
	flex-direction: column;
	width: min(340px, 88vw);
	padding: 0 0 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--pz-navy);
	color: var(--pz-white);
	transform: translateX(-100%);
	visibility: hidden;
	transition: transform .32s var(--pz-ease), visibility 0s linear .32s;
}

.pz-drawer.is-open {
	transform: translateX(0);
	visibility: visible;
	transition: transform .32s var(--pz-ease), visibility 0s;
}

body.admin-bar .pz-drawer { top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .pz-drawer { top: 46px; }
}

/* Bloqueo del scroll con el cajón abierto. Va en <html> (y no en <body>, que
   al recibir overflow:hidden pasaría a ser contenedor de scroll y afectaría a
   los elementos sticky de la página). */
html.pz-locked { overflow: hidden; }

.pz-drawer__head {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	background: var(--pz-navy);
	border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.pz-drawer__title {
	font-size: 17px;
	font-weight: 700;
	letter-spacing: .01em;
}

.pz-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: rgba(255, 255, 255, .1);
	color: var(--pz-white);
	cursor: pointer;
}

.pz-drawer__close:hover { background: rgba(255, 255, 255, .2); }

.pz-drawer__menu {
	margin: 0;
	padding: 12px 12px 0;
	list-style: none;
}

.pz-drawer__menu li { margin: 0; }

.pz-drawer__menu a {
	display: block;
	padding: 13px 14px;
	border-radius: 12px;
	color: var(--pz-white);
	font-size: 16px;
	font-weight: 500;
	text-decoration: none;
}

.pz-drawer__menu a:hover,
.pz-drawer__menu a:focus-visible {
	background: rgba(255, 255, 255, .1);
	text-decoration: none;
}

.pz-drawer__menu .current-menu-item > a,
.pz-drawer__menu .current_page_item > a { color: var(--pz-teal); font-weight: 600; }

.pz-drawer__cats {
	margin-top: 18px;
	padding: 18px 12px 0;
	border-top: 1px solid rgba(255, 255, 255, .16);
}

.pz-drawer__subtitle {
	margin: 0 0 8px;
	padding-inline: 14px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--pz-teal);
}

/* El árbol dentro del drawer va en claro sobre azul. */
.pz-cats__list--drawer .pz-cats__link { color: var(--pz-white); font-weight: 500; }
.pz-cats__list--drawer .pz-cats__link:hover,
.pz-cats__list--drawer .pz-cats__link:focus-visible { background: rgba(255, 255, 255, .1); color: var(--pz-white); }
.pz-cats__list--drawer .pz-cats__more { color: var(--pz-white); }
.pz-cats__list--drawer .pz-cats__more:hover { background: rgba(255, 255, 255, .12); }
.pz-cats__list--drawer .pz-cats__sub { border-left-color: rgba(0, 167, 169, .55); }
.pz-cats__list--drawer .pz-cats__sub a { color: rgba(255, 255, 255, .82); }
.pz-cats__list--drawer .pz-cats__sub a:hover,
.pz-cats__list--drawer .pz-cats__sub a:focus-visible { background: rgba(255, 255, 255, .1); color: var(--pz-white); }

/* Panel lateral de categorías (escritorio): mismo cajón, pero por la derecha,
   más ancho (para que el árbol se lea cómodo) y en claro — fondo blanco con
   los acentos de marca. El árbol usa los estilos base de .pz-cats__list
   (enlaces en azul, hover turquesa), sin la variante --drawer. */
.pz-drawer--cats {
	right: 0;
	left: auto;
	width: min(460px, 92vw);
	background: var(--pz-white);
	color: var(--pz-navy);
	box-shadow: -18px 0 48px rgba(1, 53, 106, .18);
	transform: translateX(100%);
}

.pz-drawer--cats.is-open { transform: translateX(0); }

/* Cabecera: título azul y filo turquesa como separador. */
.pz-drawer--cats .pz-drawer__head {
	background: var(--pz-white);
	border-bottom: 2px solid rgba(0, 167, 169, .28);
}

.pz-drawer--cats .pz-drawer__title { color: var(--pz-navy); }

.pz-drawer--cats .pz-drawer__close {
	background: rgba(0, 167, 169, .12);
	color: var(--pz-teal);
}

.pz-drawer--cats .pz-drawer__close:hover {
	background: var(--pz-teal);
	color: var(--pz-white);
}

/* Es el único bloque del panel: sin separador ni margen superior. */
.pz-drawer__cats--solo {
	margin-top: 0;
	padding: 14px 12px 0;
	border-top: 0;
}

/* Algo más de aire que en el desplegable original: aquí sobra ancho. */
.pz-drawer--cats .pz-cats__link { padding: 13px 16px; font-size: 16px; }
.pz-drawer--cats .pz-cats__more { width: 38px; height: 38px; color: var(--pz-teal); }
.pz-drawer--cats .pz-cats__sub a { padding: 10px 14px; font-size: 15px; }

/* =========================================================================
   7. Responsive
   ========================================================================= */

/* Portátiles pequeños: menos aire entre elementos. */
@media (max-width: 1279px) {
	:root { --pz-header-h: 84px; }
	.pz-cats__btn { padding: 12px 20px; gap: 9px; }
	.pz-searchbtn { width: 42px; height: 42px; border-radius: 12px; }
}

/* Tablet y móvil: menú al cajón lateral, "Categorías" también. */
@media (max-width: 1024px) {
	:root { --pz-header-h: 76px; }

	.pz-burger { display: flex; }
	.pz-header__nav { display: none; }
	.pz-cats,
	.pz-drawer--cats { display: none; }

	.pz-header__bar { grid-template-columns: 44px minmax(0, 1fr) 46px; gap: 12px; }
	.pz-header__actions { grid-column: 3; }
}

@media (max-width: 640px) {
	:root { --pz-header-h: 66px; }

	.pz-logo img { height: 34px; }
	.pz-searchbtn { width: 40px; height: 40px; border-radius: 11px; border-width: 2px; }
	.pz-header__bar { grid-template-columns: 40px minmax(0, 1fr) 40px; }

	.pz-search__inner { flex-wrap: wrap; padding: 14px var(--pz-gutter); }
	.pz-search__inner .ozpls-figma__btn { padding: 0 18px; }

	/* En móvil no cabe sin pisar el botón "Buscar": se quita. El buscador se
	   cierra igual con la lupa, tocando fuera o con Escape. */
	.pz-search__close { display: none; }
}

@media (max-width: 420px) {
	.pz-search__inner .ozpls-figma__form { flex-wrap: wrap; }
	.pz-search__inner .ozpls-figma__btn { width: 100%; }
}

/* =========================================================================
   8. Ajustes de convivencia
   ========================================================================= */

/* Elementos sticky del sitio: deben respetar la barra fija. */
.ozc-quoter__aside { top: calc(var(--pz-header-h) + 20px) !important; }

/* Panel de resultados del buscador en vivo dentro del header. */
.pz-search__inner .oz-ls__panel { top: calc(100% + 10px); }

@media (prefers-reduced-motion: reduce) {
	.pz-drawer,
	.pz-scrim,
	.pz-menu a::after,
	.pz-cats__more,
	.pz-burger span { transition-duration: .01ms !important; }
}
