/**
 * Inoforest Offer Banner
 *
 * Contents
 * 1. Banner (variables, grid, image position)
 * 2. Text: subtitle, title, text
 * 3. Countdown and offer-ended message
 * 4. Button
 * 5. Image, diagonal edge, discount badge
 * 6. Editor hints, screen-reader text
 * 7. Responsive and reduced motion
 *
 * Colours read the Design System (--inoforest-color-*) with the Travel26 design as fallback. Panel controls write the
 * --ino-offer-* variables or style the parts with the widget's wrapper class in front, so they win over these rules.
 * The banner itself does not clip (Advanced → Motion Effects and shadows keep working); the image side follows the
 * banner's corners instead.
 */

/* 1. Banner ---------------------------------------------------------------- */
.inoforest-offer-banner {
	--ino-offer-bg: var(--inoforest-color-accent, #ff6a3d);
	--ino-offer-heading: var(--inoforest-color-heading, #0d1b2a);
	--ino-offer-radius: 24px;
	--ino-offer-edge-width: 140px;
	--ino-offer-pad-split: 70px 64px;
	--ino-offer-pad-stacked: 54px 40px;
	--ino-offer-pad: var(--ino-offer-pad-split);
	--ino-offer-media-height-split: 420px;
	--ino-offer-media-height-stacked: 320px;
	--ino-offer-media-height: var(--ino-offer-media-height-split);
	--ino-offer-radius-split: 0 var(--ino-offer-radius) var(--ino-offer-radius) 0;
	--ino-offer-radius-stacked: 0 0 var(--ino-offer-radius) var(--ino-offer-radius);
	--ino-offer-media-radius: var(--ino-offer-radius-split);
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	color: rgba(255, 255, 255, 0.9);
	background: var(--ino-offer-bg);
	border-radius: var(--ino-offer-radius);
}

.inoforest-offer-banner[data-image-position="left"] {
	--ino-offer-radius-split: var(--ino-offer-radius) 0 0 var(--ino-offer-radius);
	--ino-offer-radius-stacked: var(--ino-offer-radius) var(--ino-offer-radius) 0 0;
}

.inoforest-offer-banner[data-image-position="left"] .inoforest-offer-banner__media {
	order: -1;
}

.inoforest-offer-banner.inoforest-offer-banner--no-image {
	grid-template-columns: minmax(0, 1fr);
}

/* 2. Text --------------------------------------------------------------------- */
.inoforest-offer-banner__content {
	--ino-offer-justify: flex-start;
	position: relative;
	z-index: 1;
	min-width: 0;
	padding: var(--ino-offer-pad);
}

.inoforest-offer-banner .inoforest-offer-banner__subtitle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 12px;
	font-family: "Caveat", cursive;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1;
	color: var(--ino-offer-heading);
}

.inoforest-offer-banner__subtitle[data-line="true"]::before {
	content: "";
	flex: none;
	width: 34px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
}

.inoforest-offer-banner .inoforest-offer-banner__title {
	margin: 0 0 0.6em;
	font-family: var(--inoforest-font-heading-family, inherit);
	font-size: clamp(2rem, 3.6vw, 3rem);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: #fff;
}

.inoforest-offer-banner .inoforest-offer-banner__text {
	margin: 0 0 28px;
	color: inherit;
}

/* 3. Countdown and offer-ended message --------------------------------------------- */
.inoforest-offer-banner .inoforest-offer-banner__countdown {
	--ino-offer-unit-width: 76px;
	display: flex;
	justify-content: var(--ino-offer-justify);
	gap: 12px;
	margin: 0 0 34px;
}

.inoforest-offer-banner .inoforest-offer-banner__countdown[hidden],
.inoforest-offer-banner .inoforest-offer-banner__expired[hidden],
.inoforest-offer-banner .inoforest-offer-banner__button[hidden] {
	display: none;
}

.inoforest-offer-banner__countdown .inoforest-offer-banner__unit {
	flex: 0 1 var(--ino-offer-unit-width);
	min-width: min-content;
	padding: 12px 8px;
	line-height: 1.75;
	text-align: center;
	background: rgba(255, 255, 255, 0.16);
	border-radius: 16px;
}

.inoforest-offer-banner__unit .inoforest-offer-banner__number {
	display: block;
	font-size: 1.8rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
	color: #fff;
}

.inoforest-offer-banner__unit .inoforest-offer-banner__label {
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.inoforest-offer-banner .inoforest-offer-banner__expired {
	margin: 0 0 34px;
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
}

/* 4. Button --------------------------------------------------------------------- */
.inoforest-offer-banner .inoforest-offer-banner__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 62px;
	padding: 18px 38px;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--ino-offer-heading);
	white-space: nowrap;
	text-decoration: none;
	background: #fff;
	border: 2px solid #fff;
	border-radius: 999px;
	transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.inoforest-offer-banner a.inoforest-offer-banner__button:hover,
.inoforest-offer-banner a.inoforest-offer-banner__button:focus-visible {
	color: #fff;
	background: var(--ino-offer-heading);
	border-color: var(--ino-offer-heading);
	transform: translateY(-2px);
	box-shadow: 0 12px 24px -10px var(--ino-offer-heading);
}

.inoforest-offer-banner a.inoforest-offer-banner__button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.inoforest-offer-banner__button svg,
.inoforest-offer-banner__button i {
	flex: none;
	width: 1.05em;
	height: 1.05em;
	font-size: 1.05em;
	fill: currentColor;
	transition: transform 0.35s ease;
}

.inoforest-offer-banner a.inoforest-offer-banner__button:hover svg,
.inoforest-offer-banner a.inoforest-offer-banner__button:hover i,
.inoforest-offer-banner a.inoforest-offer-banner__button:focus-visible svg,
.inoforest-offer-banner a.inoforest-offer-banner__button:focus-visible i {
	transform: translateX(3px);
}

/* 5. Image, diagonal edge, discount badge ------------------------------------------------ */
.inoforest-offer-banner__media {
	position: relative;
	min-width: 0;
	min-height: var(--ino-offer-media-height);
	overflow: hidden;
	border-radius: var(--ino-offer-media-radius);
}

.inoforest-offer-banner .inoforest-offer-banner__media .inoforest-offer-banner__image {
	position: absolute;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	object-fit: cover;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.inoforest-offer-banner__media::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 -1px;
	z-index: 1;
	display: var(--ino-offer-edge-display, block);
	width: var(--ino-offer-edge-width);
	pointer-events: none;
	background: var(--ino-offer-bg);
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

.inoforest-offer-banner[data-image-position="left"] .inoforest-offer-banner__media::before {
	inset: 0 -1px 0 auto;
	clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.inoforest-offer-banner[data-edge="false"] .inoforest-offer-banner__media::before {
	display: none;
}

.inoforest-offer-banner .inoforest-offer-banner__badge {
	position: absolute;
	top: 36px;
	right: var(--ino-offer-badge-side, 36px);
	z-index: 2;
	display: grid;
	place-content: center;
	width: 130px;
	height: 130px;
	line-height: 1;
	text-align: center;
	color: var(--ino-offer-heading);
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 14px 40px rgba(13, 27, 42, 0.1);
}

.inoforest-offer-banner[data-image-position="left"] .inoforest-offer-banner__badge {
	right: auto;
	left: var(--ino-offer-badge-side, 36px);
}

.inoforest-offer-banner__badge[data-float="true"] {
	animation: inoforest-offer-float 4s ease-in-out infinite;
}

.inoforest-offer-banner__badge .inoforest-offer-banner__badge-value {
	display: block;
	font-size: 2.6rem;
	font-weight: 800;
	line-height: 1;
	color: var(--ino-offer-bg);
}

.inoforest-offer-banner__badge .inoforest-offer-banner__badge-label {
	display: block;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

@keyframes inoforest-offer-float {
	0%,
	100% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(-12px);
	}
}

/* 6. Editor hints, screen-reader text -------------------------------------------------- */
.inoforest-offer-banner__hint {
	margin: 18px 0 0;
	padding: 8px 12px;
	font-size: 0.85rem;
	line-height: 1.5;
	color: #fff;
	background: rgba(13, 27, 42, 0.35);
	border-radius: 8px;
}

.inoforest-offer-banner__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* 7. Responsive and reduced motion ------------------------------------------------------- */
@media (max-width: 991px) {
	.inoforest-offer-banner {
		--ino-offer-pad: var(--ino-offer-pad-stacked);
		--ino-offer-media-height: var(--ino-offer-media-height-stacked);
		--ino-offer-media-radius: var(--ino-offer-radius-stacked);
		--ino-offer-edge-display: none;
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 767px) {
	/* The design's 15 px base font on phones. */
	.inoforest-offer-banner {
		font-size: 15px;
	}

	.inoforest-offer-banner .inoforest-offer-banner__countdown {
		--ino-offer-unit-width: 64px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.inoforest-offer-banner__badge[data-float="true"] {
		animation: none;
	}

	.inoforest-offer-banner .inoforest-offer-banner__button,
	.inoforest-offer-banner__button svg,
	.inoforest-offer-banner__button i {
		transition: none;
	}

	.inoforest-offer-banner a.inoforest-offer-banner__button:hover,
	.inoforest-offer-banner a.inoforest-offer-banner__button:focus-visible,
	.inoforest-offer-banner a.inoforest-offer-banner__button:hover svg,
	.inoforest-offer-banner a.inoforest-offer-banner__button:hover i,
	.inoforest-offer-banner a.inoforest-offer-banner__button:focus-visible svg,
	.inoforest-offer-banner a.inoforest-offer-banner__button:focus-visible i {
		transform: none;
	}
}
