/* =========================================================
 * Header Rosvar — barra superior (contacto + redes) + barra
 * principal (logo + menú + buscador + botón WhatsApp).
 * Sticky blanco. Incluye overlay de búsqueda de productos.
 * ========================================================= */

:root {
	--oz-h-green:         #7AB51D;      /* verde corporativo Rosvar */
	--oz-h-green-dark:    #5f9214;
	--oz-h-green-deep:    #2E7D32;      /* verde oscuro del logo "ROS" */
	--oz-h-text:          #1f2937;
	--oz-h-muted:         #4b5563;
	--oz-h-fb:            #1877F2;
	--oz-h-yt:            #FF0000;
	--oz-h-border:        #ececec;
	--oz-h-shadow:        0 4px 14px rgba(0, 0, 0, .07);
	--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 (sticky blanco) ---------- */
.oz-header {
	position: sticky;
	top: 0;
	left: 0;
	right: 0;
	z-index: 500;
	background: #ffffff;
	color: var(--oz-h-text);
	transition: box-shadow .3s ease;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Sombra sólo cuando ya se hizo scroll */
.oz-header.is-scrolled {
	box-shadow: var(--oz-h-shadow);
}

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

/* =========================================================
 *  Barra superior — contacto + delivery + redes
 * ========================================================= */
.oz-topbar {
	border-bottom: 1px solid var(--oz-h-border);
	font-size: 15px;
	color: var(--oz-h-muted);
}
.oz-topbar__container {
	width: 100%;
	max-width: 1920px;
	margin: 0 auto;
	padding: 8px 48px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
}

.oz-topbar__contact {
	display: flex;
	align-items: center;
	gap: 28px;
	justify-self: start;
}
.oz-topbar__item { display: flex; align-items: center; }

.oz-topbar__delivery {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	justify-self: center;
	font-weight: 600;
	color: var(--oz-h-text);
	white-space: nowrap;
}
.oz-topbar__delivery .oz-topbar__icon { color: var(--oz-h-green); }

.oz-topbar__social {
	display: flex;
	align-items: center;
	gap: 24px;
	justify-self: end;
}

.oz-topbar__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--oz-h-muted);
	white-space: nowrap;
	transition: color var(--oz-h-trans);
}
.oz-topbar__link:hover { color: var(--oz-h-green); }
.oz-topbar__icon { color: var(--oz-h-green); flex: 0 0 auto; }

.oz-topbar__link--social { font-weight: 600; color: var(--oz-h-text); }
.oz-topbar__social-ico--fb { color: var(--oz-h-fb); }
.oz-topbar__social-ico--yt { color: var(--oz-h-yt); }
.oz-topbar__link--social:hover { color: var(--oz-h-green); }

/* =========================================================
 *  Barra principal
 * ========================================================= */
.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: 88px;
}

/* ---------- 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: 58px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	display: block;
}
.oz-header__logo-text {
	font-weight: 800;
	font-size: 1.4rem;
	color: var(--oz-h-green-deep);
}

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

.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-size: 15px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: normal;
	transition: color var(--oz-h-trans);
	white-space: nowrap;
}

/* Subrayado verde del item activo / hover */
.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-green);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform var(--oz-h-trans);
}
.oz-header__nav .current-menu-item > a,
.oz-header__nav .current-menu-ancestor > a,
.oz-header__nav .current_page_item > a,
.oz-header__nav a[aria-current="page"]:not(.oz-header__contact-btn),
.oz-header__nav a:hover,
.oz-header__nav-list a:hover { color: var(--oz-h-green); }

.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,
.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: 210px;
	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(122, 181, 29, .08);
	color: var(--oz-h-green);
}

/* =========================================================
 *  Acciones derecha: buscador + WhatsApp
 * ========================================================= */
.oz-header__actions {
	display: flex;
	align-items: center;
	gap: 18px;
	flex: 0 0 auto;
	margin-left: auto;
}

/* =========================================================
 *  Buscador inline (se expande dentro del header)
 * ========================================================= */
.oz-search {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

/* Botón lupa (visible cuando el campo está cerrado) */
.oz-header__search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var(--oz-h-text);
	transition: background-color var(--oz-h-trans), color var(--oz-h-trans);
	flex: 0 0 auto;
}
.oz-header__search-toggle:hover {
	background: rgba(122, 181, 29, .12);
	color: var(--oz-h-green);
}
/* Al abrir, la lupa-toggle se oculta (el icono pasa al campo). */
.oz-search.is-open .oz-header__search-toggle { display: none; }

/* Campo de búsqueda: oculto por defecto, se expande al abrir */
.oz-search__form {
	display: flex;
	align-items: center;
	width: 0;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
	border: 2px solid var(--oz-h-border);
	border-radius: 999px;
	background: #ffffff;
	transition: width var(--oz-h-trans), opacity var(--oz-h-trans), padding var(--oz-h-trans);
	padding: 0;
}
.oz-search.is-open .oz-search__form {
	width: 320px;
	opacity: 1;
	pointer-events: auto;
	padding: 0 4px 0 18px;
}
.oz-search__form:focus-within { border-color: var(--oz-h-green); }

.oz-search__input {
	flex: 1 1 auto;
	border: 0;
	outline: none;
	font-size: 15px;
	color: var(--oz-h-text);
	background: transparent;
	height: 42px;
	min-width: 0;
}
.oz-search__input::placeholder { color: #9ca3af; }

.oz-search__submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	color: var(--oz-h-text);
	transition: background-color var(--oz-h-trans), color var(--oz-h-trans);
}
.oz-search__submit:hover { background: rgba(122, 181, 29, .12); color: var(--oz-h-green); }

/* =========================================================
 *  Preview de resultados en vivo
 * ========================================================= */
.oz-search__results {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	width: min(380px, 86vw);
	max-height: 420px;
	overflow-y: auto;
	background: #ffffff;
	border: 1px solid var(--oz-h-border);
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .16);
	padding: 8px;
	z-index: 300;
	scrollbar-width: thin;
}
.oz-search__results[hidden] { display: none; }

.oz-search__result {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	color: var(--oz-h-text);
	text-decoration: none;
	transition: background-color var(--oz-h-trans);
}
.oz-search__result:hover { background: rgba(122, 181, 29, .08); }

.oz-search__result-img {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 8px;
	object-fit: cover;
	background: #f1f3f5;
}
.oz-search__result-img--empty {
	display: inline-block;
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: #f1f3f5;
}
.oz-search__result-body { min-width: 0; flex: 1 1 auto; }
.oz-search__result-title {
	display: block;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.oz-search__result-price {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	color: var(--oz-h-green-dark);
	font-weight: 600;
}
.oz-search__result-price del { color: #9ca3af; font-weight: 400; margin-right: 6px; }

.oz-search__msg {
	padding: 16px 14px;
	text-align: center;
	font-size: 14px;
	color: var(--oz-h-muted);
}
.oz-search__viewall {
	display: block;
	margin-top: 6px;
	padding: 12px;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	color: #ffffff;
	background: var(--oz-h-green);
	border-radius: 10px;
	text-decoration: none;
	transition: background-color var(--oz-h-trans);
}
.oz-search__viewall:hover { background: var(--oz-h-green-dark); }

/* =========================================================
 *  Botón WhatsApp "Asesor en Línea" (pill verde sólido)
 * ========================================================= */
.oz-header__contact-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 52px;
	padding: 0 28px;
	background: var(--oz-h-green) !important;
	color: #ffffff !important;
	border: 0;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .01em;
	text-transform: none;
	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(122, 181, 29, .3);
}
.oz-header__contact-btn:hover {
	background: var(--oz-h-green-dark) !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(122, 181, 29, .4);
}
.oz-header__contact-btn::after { display: none !important; }
.oz-header__contact-ico { flex: 0 0 auto; }

/* =========================================================
 *  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-green); }
.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;
}

/* Contacto en drawer */
.oz-drawer__contact { display: flex; flex-direction: column; gap: 8px; }
.oz-drawer__contact a {
	color: var(--oz-h-muted);
	font-size: 14px;
	font-weight: 500;
}
.oz-drawer__contact a:hover { color: var(--oz-h-green); }

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

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

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

/* ----------- MÓVIL base (< 640px) ----------- */
.oz-topbar { display: none; } /* la topbar vive en el drawer en móvil */

.oz-header__container {
	min-height: 64px;
	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: 42px; max-width: 100%; }

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

.oz-header__actions { gap: 8px; margin-left: 0; }
.oz-header__search-toggle { width: 40px; height: 40px; }

/* En móvil el campo abierto se posiciona absoluto (anclado a .oz-search)
   para no empujar el logo ni el botón de WhatsApp. */
.oz-search.is-open .oz-search__form {
	position: absolute;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	width: min(78vw, 320px);
	z-index: 320;
}

/* En móvil el botón se reduce a sólo el icono de WhatsApp */
.oz-header__contact-btn {
	height: 40px;
	width: 40px;
	padding: 0;
	border-radius: 50%;
}
.oz-header__contact-btn span { display: none; }

/* ----------- MÓVIL S (≤ 380px) ----------- */
@media (max-width: 380px) {
	.oz-header__container { padding: 0 12px; gap: 8px; }
	.oz-header__logo img { height: 38px; }
}

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

	.oz-header__contact-btn {
		height: 46px;
		width: auto;
		padding: 0 22px;
		border-radius: 999px;
		font-size: 14px;
	}
	.oz-header__contact-btn span { display: inline; }
}

/* ----------- DESKTOP (≥ 1024px) — menú visible ----------- */
@media (min-width: 1024px) {
	.oz-topbar { display: block; }
	.oz-topbar__container { padding: 8px 32px; }

	.oz-header__hamburger { display: none; }

	.oz-header__container {
		position: relative;
		min-height: 92px;
		padding: 0 32px;
		gap: 24px;
	}

	/* Centra el menú respecto a la pantalla, ignorando ancho de logo/acciones */
	.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: 30px; }
	.oz-header__nav-list a { font-size: 14px; }

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

/* ----------- DESKTOP L (≥ 1280px) ----------- */
@media (min-width: 1280px) {
	.oz-topbar__container { padding: 9px 48px; }
	.oz-header__container {
		min-height: 96px;
		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 28px;
		font-size: 15px;
	}
}

/* ----------- PC ancho (≥ 1920px) ----------- */
@media (min-width: 1920px) {
	.oz-topbar__container { padding: 10px 96px; }
	.oz-header__container {
		min-height: 104px;
		padding: 0 96px;
	}
	.oz-header__logo img { height: 66px; }
}

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