/* =========================================================
 * Header Sugar Sun — logo + menú principal + botón WhatsApp
 * Fijo, sin fondo. Al hacer scroll abajo: oculta con translateY.
 * Al hacer scroll arriba: muestra con fondo blanco.
 * ========================================================= */

:root {
	--oz-h-text:          #1a1a1a;
	--oz-h-accent:        #C8147C;      /* magenta/rosa Sugar Sun */
	--oz-h-accent-hover:  #a8106a;
	--oz-h-shadow:        0 4px 12px rgba(0, 0, 0, .08);
	--oz-h-trans:         .25s ease;
}

/* ---------- Reset puntual ---------- */
.oz-header,
.oz-header * {
	box-sizing: border-box;
}
.oz-header ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.oz-header a {
	text-decoration: none;
	color: inherit;
}
.oz-header button {
	font: inherit;
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
	padding: 0;
}

/* ---------- Layout base ---------- */
.oz-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 500;
	background: transparent;
	color: var(--oz-h-text);
	transform: translateY(0);
	transition: transform .35s ease, background-color .35s ease, box-shadow .35s ease;
	will-change: transform;
}

/* Estado: scroll hacia arriba después de bajar → fondo blanco visible */
.oz-header.is-scrolled {
	background: #ffffff;
	box-shadow: var(--oz-h-shadow);
}

/* Estado oculto: el JS aplica esta clase al hacer scroll hacia abajo. */
.oz-header.is-hidden {
	transform: translateY(-100%);
}

/* Spacer reserva el alto del header — el JS le inyecta la altura real. */
.oz-header-spacer {
	width: 100%;
	flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
	.oz-header { transition: none; }
}

.oz-header__bar {
	position: relative;
}

.oz-header__container {
	width: 100%;
	max-width: 1920px;
	margin: 0 auto;
	padding: 0 48px;
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 96px;
}

/* ---------- Hamburguesa (móvil/tablet) ---------- */
.oz-header__hamburger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	color: var(--oz-h-text);
	flex: 0 0 auto;
}
.oz-header__hamburger:hover { background: rgba(0, 0, 0, .06); }

.oz-header__hamburger-bars,
.oz-header__hamburger-bars::before,
.oz-header__hamburger-bars::after {
	display: block;
	width: 22px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform var(--oz-h-trans), top var(--oz-h-trans), bottom var(--oz-h-trans), opacity var(--oz-h-trans);
	position: relative;
}
.oz-header__hamburger-bars::before,
.oz-header__hamburger-bars::after {
	content: "";
	position: absolute;
	left: 0;
}
.oz-header__hamburger-bars::before { top: -7px; }
.oz-header__hamburger-bars::after  { bottom: -7px; }

.oz-header__hamburger[aria-expanded="true"] .oz-header__hamburger-bars { background: transparent; }
.oz-header__hamburger[aria-expanded="true"] .oz-header__hamburger-bars::before { transform: rotate(45deg); top: 0; }
.oz-header__hamburger[aria-expanded="true"] .oz-header__hamburger-bars::after  { transform: rotate(-45deg); bottom: 0; }

/* ---------- Logo ---------- */
.oz-header__logo {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}
.oz-header__logo .custom-logo-link,
.oz-header__logo a {
	display: inline-flex;
	align-items: center;
}
.oz-header__logo img {
	height: 48px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	display: block;
}
.oz-header__logo-text {
	font-weight: 800;
	font-size: 1.2rem;
	color: var(--oz-h-text);
}

/* =========================================================
 *  Menú principal
 * ========================================================= */
.oz-header__nav {
	flex: 1 1 auto;
	display: none; /* sólo desktop */
	justify-content: center;
}

/* Aplica el layout horizontal a cualquier <ul> dentro del nav,
   ya sea el render de wp_nav_menu (.oz-header__nav-list) o el
   fallback wp_page_menu (div.menu > ul). */
.oz-header__nav > ul,
.oz-header__nav > div > ul,
.oz-header__nav-list {
	display: flex;
	align-items: center;
	gap: 40px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.oz-header__nav li,
.oz-header__nav-list li { position: relative; }
.oz-header__nav a,
.oz-header__nav-list a {
	position: relative;
	display: inline-block;
	padding: 8px 0;
	color: var(--oz-h-text);
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	line-height: normal;
	transition: color var(--oz-h-trans);
	white-space: nowrap;
}

/* Subrayado del item activo (página actual) */
.oz-header__nav a::after,
.oz-header__nav-list a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 2px;
	background: var(--oz-h-text);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform var(--oz-h-trans);
}
.oz-header__nav .current-menu-item > a::after,
.oz-header__nav .current-menu-ancestor > a::after,
.oz-header__nav .current_page_item > a::after,
.oz-header__nav .current_page_parent > a::after,
.oz-header__nav a[aria-current="page"]::after,
.oz-header__nav-list .current-menu-item > a::after,
.oz-header__nav-list .current-menu-ancestor > a::after,
.oz-header__nav-list a[aria-current="page"]::after {
	transform: scaleX(1);
}
.oz-header__nav a:hover::after,
.oz-header__nav-list a:hover::after {
	transform: scaleX(1);
}

/* Submenús del menú principal */
.oz-header__nav-list .sub-menu {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	min-width: 200px;
	background: #ffffff;
	color: var(--oz-h-text);
	box-shadow: 0 10px 22px rgba(0, 0, 0, .12);
	border-radius: 10px;
	padding: 8px 0;
	display: none;
	z-index: 200;
}
.oz-header__nav-list li:hover > .sub-menu,
.oz-header__nav-list li:focus-within > .sub-menu { display: block; }
.oz-header__nav-list .sub-menu a {
	display: block;
	padding: 10px 18px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0;
	font-size: 14px;
}
.oz-header__nav-list .sub-menu a::after { display: none; }
.oz-header__nav-list .sub-menu a:hover {
	background: rgba(200, 20, 124, .06);
	color: var(--oz-h-accent);
}

/* =========================================================
 *  Botón WhatsApp (pill rosa sólido)
 * ========================================================= */
.oz-header__contact-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	padding: 0 36px;
	background: var(--oz-h-accent) !important;
	color: #ffffff !important;
	border: 0;
	border-radius: 999px;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--oz-h-trans), transform var(--oz-h-trans), box-shadow var(--oz-h-trans);
	flex: 0 0 auto;
	box-shadow: 0 4px 14px rgba(200, 20, 124, .25);
}
.oz-header__contact-btn:hover {
	background: var(--oz-h-accent-hover) !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(200, 20, 124, .35);
}

/* =========================================================
 *  DRAWER móvil
 * ========================================================= */
.oz-drawer { position: fixed; inset: 0; z-index: 1500; }
.oz-drawer[hidden] { display: none; }

.oz-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .5);
	opacity: 0;
	transition: opacity var(--oz-h-trans);
}
.oz-drawer.is-open .oz-drawer__backdrop { opacity: 1; }

.oz-drawer__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	width: min(360px, 92vw);
	background: #fff;
	color: #1a1a1a;
	box-shadow: 0 0 30px rgba(0, 0, 0, .25);
	transition: transform var(--oz-h-trans);
	display: flex;
	flex-direction: column;
}
.oz-drawer__panel--left  { left: 0;  transform: translateX(-100%); }
.oz-drawer__panel--right { right: 0; transform: translateX(100%); }

.oz-drawer.is-open .oz-drawer__panel { transform: translateX(0); }

.oz-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #e5e7eb;
}
.oz-drawer__title {
	font-size: 16px;
	font-weight: 700;
}
.oz-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
}
.oz-drawer__close:hover { background: #f1f3f5; }

.oz-drawer__body {
	padding: 16px 18px 24px;
	overflow-y: auto;
	flex: 1 1 auto;
}

.oz-drawer__section + .oz-drawer__section { margin-top: 24px; }
.oz-drawer__section-title {
	font-size: 11px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #64748b;
	margin: 0 0 10px;
	font-weight: 700;
}

/* Menú principal en drawer */
.oz-drawer__nav-list {
	display: flex;
	flex-direction: column;
}
.oz-drawer__nav-list li { border-bottom: 1px solid #f1f5f9; }
.oz-drawer__nav-list a {
	display: block;
	padding: 14px 4px;
	color: #1a1a1a;
	font-weight: 600;
	font-size: 15px;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.oz-drawer__nav-list a:hover,
.oz-drawer__nav-list .current-menu-item > a { color: var(--oz-h-accent); }
.oz-drawer__nav-list .sub-menu {
	display: block;
	margin: 4px 0 8px;
	padding-left: 12px;
}
.oz-drawer__nav-list .sub-menu a {
	padding: 10px 4px;
	color: #475569;
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0;
}

.oz-drawer__quote {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 24px;
	padding: 16px;
	background: var(--oz-h-accent);
	color: #fff !important;
	border-radius: 999px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	font-size: 14px;
}
.oz-drawer__quote:hover { background: var(--oz-h-accent-hover); }

/* Bloqueo de scroll cuando un drawer está abierto */
body.oz-drawer-open { overflow: hidden; }

/* =========================================================
 *  MEDIA QUERIES — Responsive
 * ========================================================= */

/* Empuja el contenido del sitio para que arranque debajo del header fijo.
   El valor por breakpoint coincide con .oz-header__container min-height. */
.site { padding-top: 72px; }

/* ----------- MÓVIL base (< 640px) ----------- */
.oz-header__container {
	min-height: 72px;
	padding: 0 16px;
	gap: 12px;
}
.oz-header__hamburger { width: 40px; height: 40px; flex: 0 0 40px; }
.oz-header__logo { flex: 1 1 auto; min-width: 0; justify-content: flex-start; }
.oz-header__logo img { height: 40px; max-width: 100%; }

.oz-header__nav { display: none; } /* vive en el drawer */

.oz-header__contact-btn {
	height: 40px;
	padding: 0 18px;
	font-size: 12px;
	letter-spacing: .04em;
}

/* ----------- MÓVIL S (≤ 380px) — botón compacto ----------- */
@media (max-width: 380px) {
	.oz-header__container { padding: 0 12px; gap: 8px; }
	.oz-header__logo img { height: 36px; }
	.oz-header__contact-btn {
		height: 38px;
		padding: 0 14px;
		font-size: 11px;
	}
}

/* ----------- TABLET (≥ 640px) ----------- */
@media (min-width: 640px) {
	.site { padding-top: 84px; }
	.oz-header__container {
		min-height: 84px;
		padding: 0 24px;
		gap: 16px;
	}
	.oz-header__logo img { height: 52px; }

	.oz-header__contact-btn {
		height: 46px;
		padding: 0 28px;
		font-size: 13px;
	}
}

/* ----------- DESKTOP (≥ 1024px) — menú visible, sin hamburguesa ----------- */
@media (min-width: 1024px) {
	.site { padding-top: 92px; }
	.oz-header__hamburger { display: none; }

	/* El contenedor es referencia para centrar absolutamente el menú. */
	.oz-header__container {
		position: relative;
		min-height: 92px;
		padding: 0 32px;
		gap: 24px;
	}

	/* Centrar el nav respecto a la pantalla (no entre logo y botón).
	   position: absolute + left: 50% + translateX(-50%) ignora el ancho
	   asimétrico de logo vs. botón y siempre lo deja en el centro real. */
	.oz-header__nav {
		display: flex;
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		flex: 0 0 auto;
	}
	.oz-header__logo img { height: 56px; }

	.oz-header__nav-list { gap: 32px; }
	.oz-header__nav-list a { font-size: 14px; }

	.oz-header__contact-btn {
		height: 50px;
		padding: 0 32px;
		font-size: 13px;
	}
}

/* ----------- DESKTOP L (≥ 1280px) ----------- */
@media (min-width: 1280px) {
	.site { padding-top: 100px; }
	.oz-header__container {
		min-height: 100px;
		padding: 0 48px;
		gap: 32px;
	}
	.oz-header__logo img { height: 60px; }
	.oz-header__nav-list { gap: 40px; }
	.oz-header__nav-list a { font-size: 15px; }
	.oz-header__contact-btn {
		height: 52px;
		padding: 0 36px;
		font-size: 14px;
	}
}

/* ----------- PC ancho (≥ 1920px) ----------- */
@media (min-width: 1920px) {
	.site { padding-top: 112px; }
	.oz-header__container {
		min-height: 112px;
		padding: 0 96px;
	}
	.oz-header__logo img { height: 68px; }
}

/* Reduce-motion */
@media (prefers-reduced-motion: reduce) {
	.oz-drawer__panel,
	.oz-drawer__backdrop,
	.oz-header__nav-list a::after,
	.oz-header__contact-btn { transition: none !important; }
}
