/* =========================================================================
   XTRALIFE — Cabecera
   Dos franjas fijas a todo el ancho, siempre visibles:
     1. Franja verde de avisos (flechas + mensaje rotativo).
     2. Barra blanca: menú · logo · CATEGORIES + cuenta, buscador y carrito.

   Aquí viven también los tokens de marca que usan el pie (pz-footer.css),
   la franja de título (pz-page-title.css) y la tienda (woocommerce/…).
   ========================================================================= */

:root {
	/* Marca Xtralife. */
	--xl-green: #0e4d2c;        /* verde oscuro: franja, botones, banner   */
	--xl-green-700: #11663a;    /* verde medio: hover de superficies       */
	--xl-leaf: #006837;         /* verde hoja: fondo del pie               */
	--xl-leaf-soft: #0a8047;    /* marca de agua del pie                   */
	--xl-orange: #f26522;       /* naranja: precios, página activa, avisos */
	--xl-orange-dark: #d9551a;

	/* Dorado de marca: es el relleno de TODOS los botones de acción. El
	   naranja de arriba se queda solo para texto (precios, enlace activo) y
	   para las chapas/contadores, que no son botones. */
	--xl-gold-a: #bd8f32;
	--xl-gold-b: #d09f3b;
	--xl-gold: linear-gradient(90deg, var(--xl-gold-a) 0%, var(--xl-gold-b) 100%);
	--xl-gold-dark: linear-gradient(90deg, #a67a26 0%, #b98a2e 100%);

	--xl-sand: #e9ebdb;         /* fondo de las fotos de producto          */
	--xl-ink: #1e2a22;          /* texto                                   */
	--xl-muted: #5d6b62;        /* texto secundario                        */
	--xl-line: #e2e6df;         /* filetes                                 */
	--pz-white: #ffffff;

	/* Alias de compatibilidad con estilos heredados del tema. */
	--pz-navy: var(--xl-green);
	--pz-teal: var(--xl-orange);
	--pz-teal-dark: var(--xl-orange-dark);

	/* Altura real de las dos franjas: la escribe el JS; aquí el arranque. */
	--pz-header-h: 118px;
	--pz-announce-h: 40px;
	--pz-bar-h: 78px;

	--pz-gutter: clamp(16px, 3.2vw, 60px);
	--pz-ease: cubic-bezier(.4, 0, .2, 1);

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

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

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
   resetean el padding del body y ganarían por orden de carga. */

/* =========================================================================
   1. Contenedor fijo
   ========================================================================= */

.pz-header {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 1000;
	background: var(--pz-white);
	color: var(--xl-ink);
	box-shadow: 0 1px 0 rgba(14, 77, 44, .08);
}

/* 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; }
}

/* =========================================================================
   2. Franja de avisos
   ========================================================================= */

.pz-announce {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(28px, 20vw, 300px);
	height: var(--pz-announce-h);
	padding-inline: var(--pz-gutter);
	background: var(--xl-green);
	color: var(--pz-white);
}

.pz-announce__viewport {
	position: relative;
	min-width: 0;
	text-align: center;
}

.pz-announce__item {
	margin: 0;
	font-size: clamp(10px, .72vw, 12px);
	font-weight: 500;
	letter-spacing: .14em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

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

/* Cada frase entra con un fundido corto al tomar el relevo. */
.pz-announce__item.is-current {
	animation: pz-announce-in .45s var(--pz-ease) both;
}

@keyframes pz-announce-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: none; }
}

.pz-announce__nav {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: rgba(255, 255, 255, .85);
	cursor: pointer;
	transition: background-color .2s var(--pz-ease), color .2s var(--pz-ease);
}

.pz-announce__nav:hover,
.pz-announce__nav:focus-visible {
	background: rgba(255, 255, 255, .14);
	color: var(--pz-white);
}

/* Un solo aviso: las flechas no aportan nada. */
.pz-announce[data-pz-announce-single] .pz-announce__nav { visibility: hidden; }

/* =========================================================================
   3. Barra principal
   ========================================================================= */

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

/* ---- 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; }

/* El logo manda su propio ancho: `width: auto` + `max-width: none`. Con un
   `max-width: 100%` la caja quedaba limitada por la columna central y, al tener
   también el alto fijado, el logotipo se veía desproporcionado. Si el hueco
   aprieta, quien cede es el menú (columnas laterales `minmax(0, 1fr)`). */
.pz-logo img {
	display: block;
	width: auto;
	height: clamp(42px, 3.4vw, 58px);
	max-width: none;
	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(--xl-green);
}

/* ---- Menú (columna izquierda) ---- */

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

.pz-menu,
.pz-menu ul {
	display: flex;
	align-items: center;
	gap: clamp(12px, 1.7vw, 30px);
	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(--xl-ink);
	font-size: 18px;
	font-weight: 500;
	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(--xl-orange);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .24s var(--pz-ease);
}

.pz-menu a:hover,
.pz-menu a:focus-visible {
	color: var(--xl-green);
	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(--xl-green);
	font-weight: 600;
}

/* =========================================================================
   4. Acciones (columna derecha)
   ========================================================================= */

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

/* Botón dorado "Categories". */
.pz-cats { position: relative; }

.pz-cats__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border: 0;
	border-radius: 6px;
	background: var(--xl-gold);
	color: var(--pz-white);
	font-family: inherit;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: .01em;
	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(--xl-gold-dark); }

.pz-cats__btn .pz-i { flex: 0 0 auto; transition: transform .24s var(--pz-ease); }
.pz-cats__btn[aria-expanded="true"] .pz-i { transform: rotate(180deg); }

/* Iconos de cuenta, buscador y carrito. */
.pz-act {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--xl-green);
	cursor: pointer;
	text-decoration: none;
	transition: background-color .2s var(--pz-ease), color .2s var(--pz-ease);
}

.pz-act:hover,
.pz-act:focus-visible,
.pz-act[aria-expanded="true"] {
	background: rgba(14, 77, 44, .07);
	color: var(--xl-orange);
	text-decoration: none;
}

.pz-cart__count {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--xl-orange);
	color: var(--pz-white);
	font-size: 10px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}

.pz-cart__count.is-empty { display: none; }

/* =========================================================================
   5. Árbol de categorías (cajón lateral y panel de escritorio)
   ========================================================================= */

.pz-cats__empty {
	margin: 0;
	padding: 14px;
	color: var(--xl-muted);
	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: 8px;
	color: var(--xl-green);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.pz-cats__link:hover,
.pz-cats__link:focus-visible {
	background: rgba(242, 101, 34, .1);
	color: var(--xl-orange);
	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: 8px;
	background: transparent;
	color: var(--xl-green);
	cursor: pointer;
	transition: background-color .2s var(--pz-ease), transform .24s var(--pz-ease);
}

.pz-cats__more:hover { background: rgba(14, 77, 44, .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(14, 77, 44, .18);
}

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

.pz-cats__sub a {
	display: block;
	padding: 9px 12px;
	border-radius: 8px;
	color: var(--xl-muted);
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
}

.pz-cats__sub a:hover,
.pz-cats__sub a:focus-visible {
	background: rgba(242, 101, 34, .08);
	color: var(--xl-green);
	text-decoration: none;
}

/* =========================================================================
   6. 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. */
/* Se despliega de arriba abajo bajo la barra: parte plegado (max-height 0) y
   el JS le pone `is-open`. Mientras crece necesita `overflow: hidden` para que
   el contenido no asome antes de tiempo; al terminar, la clase `is-done`
   devuelve `overflow: visible` para que el panel de sugerencias del buscador en
   vivo (.oz-ls__panel, absoluto) no quede recortado. */
.pz-search {
	position: relative;
	z-index: 2;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	background: var(--pz-white);
	border-top: 1px solid var(--xl-line);
	box-shadow: 0 18px 40px rgba(14, 77, 44, .14);
	transition: max-height .32s var(--pz-ease), opacity .24s var(--pz-ease);
}

.pz-search.is-open {
	max-height: 220px;
	opacity: 1;
}

.pz-search.is-done { overflow: visible; }

.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: 1.5px solid var(--xl-line);
	border-radius: 8px;
	background: #fff;
	color: var(--xl-ink);
	font-family: inherit;
	font-size: 16px;
}

.pz-search__inner input[type="search"]:focus {
	outline: none;
	border-color: var(--xl-green);
	box-shadow: 0 0 0 3px rgba(14, 77, 44, .14);
}

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

.pz-search__inner .ozpls-figma__btn:hover { background: var(--xl-gold); }

.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: 10px;
	background: transparent;
	color: var(--xl-green);
	cursor: pointer;
}

.pz-search__close:hover { background: rgba(14, 77, 44, .08); }

/* =========================================================================
   7. Hamburguesa + cajones laterales
   ========================================================================= */

.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: 10px;
	background: transparent;
	cursor: pointer;
}

.pz-burger span {
	display: block;
	height: 2.5px;
	border-radius: 3px;
	background: var(--xl-green);
	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 (z-index 9997–9998)
   y por debajo del carrito lateral (1000000). */
.pz-scrim {
	position: fixed;
	inset: 0;
	z-index: 999990;
	background: rgba(6, 32, 18, .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(--xl-green);
	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). */
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(--xl-green);
	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: 10px;
	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: 10px;
	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(--xl-orange); 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(--xl-orange);
}

/* El árbol dentro del cajón va en claro sobre verde. */
.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(255, 255, 255, .3); }
.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 de categorías (escritorio): mismo cajón, por la derecha y en claro. */
.pz-drawer--cats {
	right: 0;
	left: auto;
	width: min(460px, 92vw);
	background: var(--pz-white);
	color: var(--xl-ink);
	box-shadow: -18px 0 48px rgba(14, 77, 44, .18);
	transform: translateX(100%);
}

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

.pz-drawer--cats .pz-drawer__head {
	background: var(--pz-white);
	border-bottom: 2px solid rgba(14, 77, 44, .14);
}

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

.pz-drawer--cats .pz-drawer__close {
	background: rgba(189, 143, 50, .14);
	color: var(--xl-gold-a);
}

.pz-drawer--cats .pz-drawer__close:hover {
	background: var(--xl-gold);
	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;
}

.pz-drawer--cats .pz-cats__link { padding: 13px 16px; font-size: 16px; }
.pz-drawer--cats .pz-cats__more { width: 38px; height: 38px; }
.pz-drawer--cats .pz-cats__sub a { padding: 10px 14px; font-size: 15px; }

/* =========================================================================
   8. Responsive
   ========================================================================= */

@media (max-width: 1279px) {
	:root { --pz-bar-h: 72px; --pz-header-h: 112px; }
	.pz-cats__btn { padding: 10px 16px; }
	.pz-act { width: 36px; height: 36px; }
}

/* Tablet y móvil: menú y categorías al cajón lateral. */
@media (max-width: 1024px) {
	:root { --pz-bar-h: 66px; --pz-announce-h: 36px; --pz-header-h: 102px; }

	.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) auto; gap: 10px; }
	.pz-announce { gap: clamp(16px, 10vw, 80px); }
}

@media (max-width: 640px) {
	:root { --pz-bar-h: 60px; --pz-announce-h: 34px; --pz-header-h: 94px; }

	.pz-logo img { height: 36px; }
	.pz-act { width: 34px; height: 34px; }
	.pz-announce__item { font-size: 10px; letter-spacing: .08em; }

	.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%; }
}

/* =========================================================================
   9. 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 de la cabecera. */
.pz-search__inner .oz-ls__panel { top: calc(100% + 10px); }

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

	.pz-announce__item.is-current { animation: none; }
}
