/* ─────────────────────────────────────────────────────────────
   CatAlert Frontend Styles
   ───────────────────────────────────────────────────────────── */

.catalert-bar {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99999;
	display: flex;
	align-items: stretch;
	box-sizing: border-box;
	width: 100%;
}

.catalert-bar--top    { top: 0; }
.catalert-bar--bottom { bottom: 0; }

/* Three-zone layout: left | center | right */
.catalert-bar__zone {
	display: flex;
	align-items: center;
	flex: 1;
	gap: 12px;
	padding: 8px 12px;
	box-sizing: border-box;
}
.catalert-bar__zone--left   { justify-content: flex-start; padding-left: 20px; }
.catalert-bar__zone--center { justify-content: center; }
/* Reserve space on the right for the close button */
.catalert-bar__zone--right  { justify-content: flex-end; padding-right: 48px; }

.catalert-bar__text {
	line-height: 1.4;
}

.catalert-bar__btn {
	display: inline-block;
	padding: 7px 18px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.3;
	transition: opacity .15s, transform .1s;
	white-space: nowrap;
	flex-shrink: 0;
}
.catalert-bar__btn:hover {
	opacity: .85;
	transform: translateY(-1px);
}

.catalert-bar__close {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	padding: 5px 7px;
	transition: opacity .15s, transform .1s;
	display: flex;
	align-items: center;
	justify-content: center;
}
.catalert-bar__close:hover {
	opacity: 1 !important;
	transform: translateY(-50%) scale(1.1);
	transition: background-color .15s, opacity .15s, transform .1s;
}

/* Smooth dismiss animation */
.catalert-bar--top.catalert-bar--hiding {
	animation: catalert-slide-up .3s ease forwards;
}
.catalert-bar--bottom.catalert-bar--hiding {
	animation: catalert-slide-down .3s ease forwards;
}

@keyframes catalert-slide-up {
	to { transform: translateY(-100%); opacity: 0; }
}
@keyframes catalert-slide-down {
	to { transform: translateY(100%); opacity: 0; }
}

/* Body offset so page content isn't hidden under a fixed top/bottom bar */
body.catalert-top-offset    { padding-top:    var(--catalert-height, 52px) !important; }
body.catalert-bottom-offset { padding-bottom: var(--catalert-height, 52px) !important; }

/* ── Mobile layout ────────────────────────────────────────────
   Dissolve the three zones so text + button participate directly
   in the bar's flex row. Text is always left, button always beside.
   ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
	.catalert-bar {
		padding: 6px 44px 6px 16px;
		gap: 10px;
		flex-wrap: nowrap;
		align-items: center;
	}

	/* Zones become invisible wrappers — children join the bar flex directly */
	.catalert-bar__zone {
		display: contents;
	}

	/* Text: always first, left-aligned, shrinks gracefully */
	.catalert-bar__text {
		order: 1;
		flex: 1 1 0;
		min-width: 0;
		text-align: left !important;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	/* Button: always second, right beside the text */
	.catalert-bar__btn {
		order: 2;
		flex-shrink: 0;
		padding: 5px 12px;
	}
}
