/* Promotional banners (Marketing Admin > Promotional Banner).
   Used on the public landing pages and in the admin live preview. */

/* ---------- Banner wrapper: position, size, colors ---------- */
.promo-banner {
    --promo-bg: #6f2dbd;
    --promo-fg: #ffffff;
    --promo-btn: #ffb020;
    --promo-btn-fg: #1b0b33;
    --promo-width: 360px;
    --promo-height: auto;
    position: relative;
    box-sizing: border-box;
    color: var(--promo-fg);
    font-family: inherit;
}

.promo-banner *,
.promo-banner *::before,
.promo-banner *::after { box-sizing: border-box; }

.promo-banner.is-dismissed,
.promo-banner.is-expired { display: none !important; }

/* Sized banners (everything except the full-width positions) */
.promo-banner:not(.promo-banner--full) {
    width: min(var(--promo-width), calc(100vw - 2rem));
    max-width: 100%;
}

.promo-banner__inner {
    position: relative;
    height: var(--promo-height);
    overflow: hidden;
    background: var(--promo-bg);
}

.promo-banner:not(.promo-banner--full) .promo-banner__inner {
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(31, 12, 61, 0.22);
}

/* Floating (fixed on screen). Offsets are set by the script so banners stack. */
.promo-banner--fixed {
    position: fixed;
    z-index: 1085;
}

.promo-banner--fixed.promo-banner--full { left: 0; right: 0; width: 100%; }
.promo-banner--fixed.promo-banner--top_full { top: 0; }
.promo-banner--fixed.promo-banner--bottom_full { bottom: 0; }
.promo-banner--fixed.promo-banner--top_left,
.promo-banner--fixed.promo-banner--bottom_left { left: 1rem; }
.promo-banner--fixed.promo-banner--top_right,
.promo-banner--fixed.promo-banner--bottom_right { right: 1rem; }
.promo-banner--fixed.promo-banner--top_center,
.promo-banner--fixed.promo-banner--bottom_center { left: 50%; transform: translateX(-50%); }
.promo-banner--fixed[class*="promo-banner--top_"]:not(.promo-banner--full) { top: 1rem; }
.promo-banner--fixed[class*="promo-banner--bottom_"]:not(.promo-banner--full) { bottom: 1rem; }

/* Page offsets for full-width fixed bars so they never cover the navbar or footer */
body.has-promo-top { padding-top: var(--promo-top-offset, 0px); }
body.has-promo-top .sticky-top { top: var(--promo-top-offset, 0px); }
body.has-promo-bottom { padding-bottom: var(--promo-bottom-offset, 0px); }

/* In the page flow */
.promo-banner-flow { padding: 1rem 0; }
.promo-banner-flow .promo-banner { margin-right: auto; }
.promo-banner-flow .promo-banner[class*="_center"],
.promo-banner-flow .promo-banner--after_hero { margin-left: auto; margin-right: auto; }
.promo-banner-flow .promo-banner[class*="_right"] { margin-left: auto; margin-right: 0; }
.promo-banner-flow[data-placement="after_hero"] { display: none; padding: 1.5rem 0; }
.promo-banner-flow[data-placement="after_hero"].is-placed { display: block; }

/* ---------- Dismiss button ---------- */
.promo-banner__dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #1b0b33;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.promo-banner--marquee .promo-banner__dismiss {
    top: 50%;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1.15rem;
}

.promo-banner__dismiss:hover,
.promo-banner__dismiss:focus-visible { background: #ffffff; }

/* ---------- Shared bits ---------- */
.promo-banner__button {
    display: inline-block;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    background: var(--promo-btn);
    color: var(--promo-btn-fg) !important;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
}

.promo-banner__button:hover,
.promo-banner__button:focus-visible { filter: brightness(1.08); text-decoration: none; }

.promo-countdown {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- Marquee: scrolls right to left in an endless loop ---------- */
.promo-marquee {
    --promo-duration: 30s;
    --promo-gap: 3rem;
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
    user-select: none;
}

.promo-banner--has-dismiss .promo-marquee { padding-right: 2.5rem; }

.promo-marquee__group {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-around;
    gap: var(--promo-gap);
    min-width: 100%;
    padding: 0.85rem 0 0.85rem var(--promo-gap);
    animation: promo-marquee-scroll var(--promo-duration) linear infinite;
}

.promo-marquee:hover .promo-marquee__group,
.promo-marquee:focus-within .promo-marquee__group {
    animation-play-state: paused;
}

@keyframes promo-marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}

.promo-marquee__item {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    white-space: nowrap;
    font-size: 1.15rem;
    line-height: 1.3;
}

.promo-marquee__heading {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.01em;
    /* text-transform: uppercase; */
}

.promo-marquee__message { font-weight: 500; opacity: 0.95; }

@media (max-width: 575.98px) {
    .promo-marquee__item { font-size: 0.95rem; gap: 0.75rem; }
    .promo-marquee__heading { font-size: 1.05rem; }
    .promo-marquee { --promo-gap: 2rem; }
}

/* ---------- Photo ---------- */
.promo-photo {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.promo-photo__media { display: block; flex: 1 1 auto; min-height: 0; }

.promo-photo__img {
    display: block;
    width: 100%;
    height: auto;
}

.promo-banner--fixed-height .promo-photo__media { overflow: hidden; }
.promo-banner--fixed-height .promo-photo__img { height: 100%; object-fit: cover; }

.promo-photo__body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
}

.promo-photo__text { min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.promo-photo__heading { margin: 0; font-weight: 800; font-size: 1.15rem; color: inherit; line-height: 1.25; }
.promo-photo__message { margin: 0; opacity: 0.95; }
.promo-photo__text .promo-countdown { align-self: flex-start; }

@media (prefers-reduced-motion: reduce) {
    .promo-marquee__group { animation: none; }
    .promo-marquee { overflow-x: auto; }
}

/* ---------- Admin live preview ---------- */
.promo-preview {
    position: relative;
    border: 1px dashed rgba(67, 89, 113, 0.3);
    border-radius: 0.5rem;
    overflow: hidden;
    min-height: 4rem;
    padding: 0.75rem;
    background: #f5f5f9;
}

.promo-preview .promo-banner { position: relative !important; inset: auto !important; transform: none !important; margin: 0 auto; }
.promo-preview .promo-banner:not(.promo-banner--full) { width: min(var(--promo-width), 100%); }
.promo-preview__empty { padding: 1.25rem; color: #8592a3; text-align: center; }
