/* Promo Top Bar – frontend */
.ptb-bar {
	--ptb-bg: #111827;
	--ptb-color: #ffffff;
	--ptb-fs: 14px;
	--ptb-py: 10px;
	--ptb-btn-fs: 13px;
	--ptb-btn-radius: 4px;
	--ptb-btn-py: 6px;
	--ptb-btn-px: 14px;
	--ptb-close: #ffffff;

	position: relative;
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: var(--ptb-py) 16px;
	background: var(--ptb-bg);
	color: var(--ptb-color);
	font-size: var(--ptb-fs);
	line-height: 1.4;
	text-align: center;
	z-index: 10;
}

.ptb-bar *,
.ptb-bar *::before,
.ptb-bar *::after {
	box-sizing: border-box;
}

.ptb-bar.ptb-has-close {
	padding-left: 44px;
	padding-right: 44px;
}

/* Oculta hasta que el JS decide qué mensaje mostrar; si el JS falla, aparece a los 1,5 s. */
.ptb-bar.ptb-pending {
	visibility: hidden;
	animation: ptb-reveal 0s linear 1.5s forwards;
}

@keyframes ptb-reveal {
	to {
		visibility: visible;
	}
}

/* Barra fija al hacer scroll (sticky: ocupa su sitio en el flujo y luego se queda arriba). */
.ptb-bar.ptb-sticky {
	position: sticky;
	top: var(--ptb-top, 0px);
	z-index: 9999;
}

.admin-bar .ptb-bar.ptb-sticky {
	top: calc(var(--ptb-top, 0px) + 32px);
}

@media (max-width: 782px) {
	.admin-bar .ptb-bar.ptb-sticky {
		top: calc(var(--ptb-top, 0px) + 46px);
	}
}

@media (max-width: 600px) {
	.admin-bar .ptb-bar.ptb-sticky {
		top: var(--ptb-top, 0px);
	}
}

/* El visitante ya la cerró (la marca el script de <head>). */
.ptb-dismissed .ptb-bar {
	display: none !important;
}

.ptb-inner {
	display: flex;
	align-items: center;
	max-width: 1200px;
	margin: 0 auto;
}

.ptb-full .ptb-inner {
	max-width: none;
}

.ptb-items {
	flex: 1 1 auto;
	min-width: 0;
}

.ptb-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 14px;
}

.ptb-align-left .ptb-item {
	justify-content: flex-start;
	text-align: left;
}

.ptb-align-right .ptb-item {
	justify-content: flex-end;
	text-align: right;
}

.ptb-item[hidden] {
	display: none !important;
}

/* Modo slide: transiciones al cambiar de mensaje. */
@keyframes ptb-in-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes ptb-in-slide {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

.ptb-item.ptb-in-fade {
	animation: ptb-in-fade 0.45s ease both;
}

.ptb-item.ptb-in-slide {
	animation: ptb-in-slide 0.45s ease both;
}

.ptb-text {
	min-width: 0;
	overflow-wrap: anywhere;
}

.ptb-bar .ptb-text s {
	opacity: 0.75;
	text-decoration-thickness: 1.5px;
}

.ptb-bar .ptb-text a {
	color: inherit;
	text-decoration: underline;
}

.ptb-bar .ptb-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: var(--ptb-btn-py) var(--ptb-btn-px);
	border: 0;
	border-radius: var(--ptb-btn-radius);
	background: var(--ptb-btn-bg, #ffffff);
	color: var(--ptb-btn-color, #111827);
	font-size: var(--ptb-btn-fs);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: none;
	transition: filter 0.15s ease;
}

.ptb-bar .ptb-cta:hover,
.ptb-bar .ptb-cta:focus {
	color: var(--ptb-btn-color, #111827);
	text-decoration: none;
	filter: brightness(0.92);
}

.ptb-bar .ptb-cta:focus-visible,
.ptb-bar .ptb-close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ptb-bar .ptb-icon {
	flex: none;
	width: 1.1em;
	height: 1.1em;
}

.ptb-bar .ptb-close {
	position: absolute;
	top: 50%;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	box-shadow: none;
	color: var(--ptb-close);
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
	transform: translateY(-50%);
}

.ptb-bar .ptb-close:hover {
	background: transparent;
	color: var(--ptb-close);
	opacity: 1;
}

.ptb-bar .ptb-close .ptb-icon {
	width: 18px;
	height: 18px;
}

@media (max-width: 600px) {
	.ptb-bar {
		padding-left: 12px;
		padding-right: 12px;
	}

	.ptb-bar.ptb-has-close {
		padding-left: 40px;
		padding-right: 40px;
	}

	.ptb-bar .ptb-close {
		right: 6px;
	}

	.ptb-item {
		gap: 8px 12px;
	}

	.ptb-bar .ptb-cta {
		max-width: 100%;
		white-space: normal;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ptb-bar .ptb-cta {
		transition: none;
	}
}
