/* =============================================
   Zertia Topbar — banner naranja sobre el header
   ============================================= */

:root { --zertia-topbar-h: 40px; }

/* El body recibe la clase desde server (PHP body_class).
   Cuando el topbar está activo desplazamos el header hacia abajo. */
body.has-zertia-topbar .site-header {
	top: var(--zertia-topbar-h);
}

/* Cuando el header pasa a estado scrolled queremos que vuelva a top:0
   (el topbar sale fuera de pantalla en ese momento). */
body.has-zertia-topbar .site-header.is-scrolled {
	top: 0;
}

/* Topbar */
.zertia-topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1001;
	min-height: var(--zertia-topbar-h);
	background: var(--z-color-orange, #f97316);
	color: #fff;
	display: flex;
	align-items: center;
	transition: transform 0.35s ease, opacity 0.25s ease;
	will-change: transform;
}

.zertia-topbar__inner {
	width: 100%;
	max-width: var(--z-container, 90rem);
	margin: 0 auto;
	padding: 0.5rem var(--z-gap, 1.5rem);
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.zertia-topbar__text {
	margin: 0;
	flex: 1;
	font-family: var(--z-font-body);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.45;
	color: #fff;
}

.zertia-topbar__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--z-font-body);
	font-size: 0.875rem;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	padding: 0.375rem 0.875rem;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 999px;
	transition: background 0.18s ease, border-color 0.18s ease;
	white-space: nowrap;
}
.zertia-topbar__cta:hover,
.zertia-topbar__cta:focus-visible {
	background: rgba(255, 255, 255, 0.15);
	border-color: #fff;
	color: #fff;
}

.zertia-topbar__close {
	background: transparent;
	border: 0;
	color: rgba(255, 255, 255, 0.85);
	cursor: pointer;
	padding: 0.375rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: background 0.18s ease, color 0.18s ease;
	flex-shrink: 0;
}
.zertia-topbar__close:hover,
.zertia-topbar__close:focus-visible {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	outline: none;
}

.zertia-topbar.is-dismissed {
	transform: translateY(-100%);
	opacity: 0;
	pointer-events: none;
}

/* Cuando se hace scroll, el topbar se desliza fuera (header se queda solo). */
body.has-zertia-topbar:has(.site-header.is-scrolled) .zertia-topbar {
	transform: translateY(-100%);
}

/* Responsive — tablet/mobile */
@media (max-width: 768px) {
	:root { --zertia-topbar-h: 56px; }
	.zertia-topbar__inner {
		flex-wrap: wrap;
		gap: 0.625rem 0.875rem;
		padding: 0.5rem var(--z-gap, 1rem);
	}
	.zertia-topbar__text {
		flex: 1 1 100%;
		font-size: 0.8125rem;
	}
	.zertia-topbar__cta {
		font-size: 0.8125rem;
		padding: 0.3125rem 0.75rem;
	}
}
