/* Announcement bars — Components/Shared/AnnouncementBarSlot.razor, behaviour in /js/announcement-bar.js.
   Colours come from the bar (--ann-*); a bar on the site's own colours falls back to the portal theme. */

.dyl-ann-slot {
    position: relative;
    z-index: 1001;
    --ann-bg-d: var(--pcal-primary, #4f46e5);
}
.dyl-ann-slot[hidden] { display: none !important; }
.dyl-ann-slot.is-sticky.dyl-ann-pos-top { position: sticky; top: 0; }
.dyl-ann-slot.is-sticky.dyl-ann-pos-bottom { position: fixed; left: 0; right: 0; bottom: 0; }
.dyl-ann-slot.is-floating {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: min(760px, calc(100vw - 24px));
    z-index: 1045;
}
.dyl-ann-slot.is-floating.dyl-ann-pos-bottom { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.dyl-ann-slot.is-floating.dyl-ann-pos-top { top: calc(var(--dyl-nav-h, 64px) + 12px); }
/* Inside an embedded widget: in the flow, never over the host page. */
.dyl-ann-slot.is-inframe, .dyl-ann-slot.is-inframe.is-floating { position: relative; left: auto; transform: none; width: auto; top: auto; bottom: auto; }

/* Admin preview frame: sticky/fixed relative to the frame, not the admin page. */
.dyl-ann-slot.is-preview.is-floating { position: absolute; }
.dyl-ann-slot.is-preview.is-sticky.dyl-ann-pos-bottom { position: absolute; }
.dyl-ann-slot.is-preview.is-floating.dyl-ann-pos-top { top: 64px; }

.dyl-ann {
    position: relative;
    overflow: hidden;
    color: var(--ann-fg, #fff);
    background: var(--ann-bg, var(--ann-bg-d));
    font-family: var(--pcal-font, inherit);
    font-size: 0.875rem;
    line-height: 1.35;
    padding: 10px 16px;
    -webkit-font-smoothing: antialiased;
}
.dyl-ann:not([data-state]) { display: none; }
.dyl-ann[hidden] { display: none !important; }
.dyl-ann.has-close { padding-right: 48px; padding-left: 48px; }
.dyl-ann.is-clickable { cursor: pointer; }
.dyl-ann-slot[data-count]:not([data-count="0"]):not([data-count="1"]) .dyl-ann { padding-bottom: 14px; }

.dyl-ann-bg-gradient { background: linear-gradient(100deg, var(--ann-bg, var(--ann-bg-d)), var(--ann-bg2, var(--ann-bg, var(--ann-bg-d)))); }
.dyl-ann-bg-animated {
    background: linear-gradient(100deg, var(--ann-bg, var(--ann-bg-d)), var(--ann-bg2, var(--ann-bg-d)), var(--ann-bg, var(--ann-bg-d)), var(--ann-bg2, var(--ann-bg-d)));
    background-size: 300% 100%;
    animation: dyl-ann-flow 14s ease-in-out infinite;
}
@keyframes dyl-ann-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.is-floating .dyl-ann {
    border-radius: 16px;
    box-shadow: 0 18px 40px -14px rgba(15, 23, 42, .45), 0 0 0 1px rgba(255, 255, 255, .08) inset;
    padding: 12px 18px;
}
.is-floating .dyl-ann.has-close { padding-right: 46px; padding-left: 18px; }

/* Sizes */
.dyl-ann-s-slim { padding-top: 6px; padding-bottom: 6px; font-size: 0.8125rem; }
.dyl-ann-s-large { padding-top: 16px; padding-bottom: 16px; font-size: 1rem; }
.dyl-ann-s-large .dyl-ann-msg { font-size: 1.125rem; }

/* Entrance */
.dyl-ann[data-enter].dyl-ann-in-slide { animation: dyl-ann-slide .55s cubic-bezier(.2, .9, .3, 1.15); }
.dyl-ann-pos-bottom .dyl-ann[data-enter].dyl-ann-in-slide { animation-name: dyl-ann-slide-up; }
.dyl-ann[data-enter].dyl-ann-in-fade { animation: dyl-ann-fade .6s ease-out; }
.dyl-ann[data-enter].dyl-ann-in-bounce { animation: dyl-ann-bounce .8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes dyl-ann-slide { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dyl-ann-slide-up { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dyl-ann-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dyl-ann-bounce { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: none; } }

/* Content */
.dyl-ann-inner {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    text-align: center;
}
.dyl-ann-a-left .dyl-ann-inner { justify-content: space-between; text-align: left; }
.dyl-ann-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dyl-ann-icon { font-size: 1.35em; line-height: 1; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .18)); }
.dyl-ann-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dyl-ann-msg { font-weight: 650; letter-spacing: .005em; }
.dyl-ann-msg strong { font-weight: 800; }
.dyl-ann-sub { opacity: .85; font-size: .86em; }
.dyl-ann-side { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.dyl-ann-f-display .dyl-ann-msg { font-family: var(--pcal-font-display, var(--pcal-font, inherit)); font-weight: 800; letter-spacing: .01em; }
.dyl-ann-f-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.dyl-ann-expired { position: relative; z-index: 2; text-align: center; }
.dyl-ann[data-expired] .dyl-ann-inner { display: none; }

/* Buttons */
.dyl-ann-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .92em;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.dyl-ann-btn.is-primary {
    background: var(--ann-btn, #fff);
    color: var(--ann-btn-fg, var(--ann-bg, var(--ann-bg-d)));
    box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .45);
}
.dyl-ann-btn.is-secondary { color: var(--ann-fg, #fff); border: 1.5px solid currentColor; background: transparent; padding: 5px 14px; }
.dyl-ann-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5); color: inherit; }
.dyl-ann-btn.is-primary:hover { color: var(--ann-btn-fg, var(--ann-bg, var(--ann-bg-d))); }
.dyl-ann-btn.is-pulse { animation: dyl-ann-pulse 2s ease-out infinite; }
@keyframes dyl-ann-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ann-btn, #fff) 70%, transparent); }
    70% { box-shadow: 0 0 0 12px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.dyl-ann-s-slim .dyl-ann-btn { padding: 3px 12px; }
.dyl-ann-s-large .dyl-ann-btn { padding: 9px 20px; }

/* Coupon code */
.dyl-ann-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 12px;
    border: 1.5px dashed color-mix(in srgb, var(--ann-fg, #fff) 70%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--ann-fg, #fff) 12%, transparent);
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background .15s ease;
}
.dyl-ann-code:hover { background: color-mix(in srgb, var(--ann-fg, #fff) 20%, transparent); }
.dyl-ann-code-txt { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .08em; color: var(--ann-accent, inherit); }
.dyl-ann-code-act {
    font-size: .72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 3px 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--ann-fg, #fff) 18%, transparent);
}
.dyl-ann-code[data-copied] .dyl-ann-code-act { display: none; }
.dyl-ann-code[data-copied]::after {
    content: attr(data-copied);
    font-size: .72em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: 3px 8px; border-radius: 6px; background: #16a34a; color: #fff;
}
.dyl-ann-inline-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .06em;
    padding: 1px 7px;
    border-radius: 6px;
    border: 1px dashed currentColor;
    color: var(--ann-accent, inherit);
}

/* Countdown */
.dyl-ann-cd { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.dyl-ann-cd-label { font-size: .82em; font-weight: 600; opacity: .9; text-transform: uppercase; letter-spacing: .05em; }
.dyl-ann-cd-val { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--ann-accent, inherit); }
.dyl-ann-cd-val:empty::before { content: attr(data-init); }
.dyl-ann-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 2.4em;
    padding: 3px 5px 2px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .24);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset;
    line-height: 1.05;
}
.dyl-ann-box b { font-size: 1.08em; font-weight: 800; }
.dyl-ann-box small { font-size: .58em; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .8; color: var(--ann-fg, #fff); }
.dyl-ann-s-slim .dyl-ann-box { min-width: 2em; padding: 1px 4px; }
.dyl-ann-s-slim .dyl-ann-box small { display: none; }

/* Close */
.dyl-ann-close {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    z-index: 3;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--ann-fg, #fff) 14%, transparent);
    color: inherit;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.dyl-ann-close:hover { background: color-mix(in srgb, var(--ann-fg, #fff) 26%, transparent); transform: translateY(-50%) rotate(90deg); }

/* Rotation dots */
.dyl-ann-dots { position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); display: flex; gap: 5px; z-index: 4; }
.dyl-ann-dots[hidden] { display: none; }
.dyl-ann-dot { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 3px; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .2s ease, background .2s ease; }
.dyl-ann-dot[aria-selected="true"] { width: 16px; background: rgba(255, 255, 255, .95); }
.dyl-ann-dot[hidden] { display: none; }

/* Ticker */
.dyl-ann-l-ticker .dyl-ann-inner { flex-wrap: nowrap; justify-content: space-between; }
.dyl-ann-l-ticker .dyl-ann-main { flex: 1 1 auto; min-width: 0; }
.dyl-ann-ticker {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.dyl-ann-track { display: inline-flex; white-space: nowrap; animation: dyl-ann-marquee 24s linear infinite; }
.dyl-ann-l-ticker:hover .dyl-ann-track { animation-play-state: paused; }
.dyl-ann-tick { display: inline-flex; align-items: baseline; gap: 12px; padding-right: 4em; }
@keyframes dyl-ann-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Effects */
.dyl-ann-fx { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.dyl-ann-fx i { position: absolute; top: -12px; display: block; opacity: 0; }
.dyl-ann-fx i:nth-child(1) { left: 4%; animation-delay: 0s; }
.dyl-ann-fx i:nth-child(2) { left: 11%; animation-delay: 1.2s; }
.dyl-ann-fx i:nth-child(3) { left: 18%; animation-delay: .5s; }
.dyl-ann-fx i:nth-child(4) { left: 26%; animation-delay: 2.1s; }
.dyl-ann-fx i:nth-child(5) { left: 33%; animation-delay: .9s; }
.dyl-ann-fx i:nth-child(6) { left: 41%; animation-delay: 2.7s; }
.dyl-ann-fx i:nth-child(7) { left: 48%; animation-delay: 1.6s; }
.dyl-ann-fx i:nth-child(8) { left: 56%; animation-delay: .2s; }
.dyl-ann-fx i:nth-child(9) { left: 63%; animation-delay: 2.4s; }
.dyl-ann-fx i:nth-child(10) { left: 70%; animation-delay: 1s; }
.dyl-ann-fx i:nth-child(11) { left: 77%; animation-delay: 3s; }
.dyl-ann-fx i:nth-child(12) { left: 84%; animation-delay: .7s; }
.dyl-ann-fx i:nth-child(13) { left: 91%; animation-delay: 1.9s; }
.dyl-ann-fx i:nth-child(14) { left: 97%; animation-delay: 2.9s; }

.dyl-ann-fx-snow .dyl-ann-fx i { width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(255, 255, 255, .8); animation: dyl-ann-fall 3.6s linear infinite; }
.dyl-ann-fx-snow .dyl-ann-fx i:nth-child(3n) { width: 3px; height: 3px; animation-duration: 4.6s; }
.dyl-ann-fx-snow .dyl-ann-fx i:nth-child(4n) { width: 6px; height: 6px; animation-duration: 3s; }

.dyl-ann-fx-confetti .dyl-ann-fx i { width: 6px; height: 9px; border-radius: 1px; animation: dyl-ann-confetti 3.2s linear infinite; background: #facc15; }
.dyl-ann-fx-confetti .dyl-ann-fx i:nth-child(4n+1) { background: #f472b6; }
.dyl-ann-fx-confetti .dyl-ann-fx i:nth-child(4n+2) { background: #60a5fa; }
.dyl-ann-fx-confetti .dyl-ann-fx i:nth-child(4n+3) { background: #34d399; animation-duration: 4s; }

.dyl-ann-fx-sparkle .dyl-ann-fx i { top: auto; animation: dyl-ann-twinkle 2.4s ease-in-out infinite; color: var(--ann-accent, #fde68a); font-style: normal; font-size: 12px; }
.dyl-ann-fx-sparkle .dyl-ann-fx i::before { content: "✦"; }
.dyl-ann-fx-sparkle .dyl-ann-fx i:nth-child(odd) { top: 18%; }
.dyl-ann-fx-sparkle .dyl-ann-fx i:nth-child(even) { top: 58%; font-size: 9px; }

.dyl-ann-fx-hearts .dyl-ann-fx i { top: auto; bottom: -14px; color: rgba(255, 255, 255, .75); font-style: normal; font-size: 12px; animation: dyl-ann-rise 4s ease-in infinite; }
.dyl-ann-fx-hearts .dyl-ann-fx i::before { content: "♥"; }
.dyl-ann-fx-hearts .dyl-ann-fx i:nth-child(3n) { font-size: 9px; animation-duration: 5s; }

.dyl-ann-fx-shimmer .dyl-ann-fx i { display: none; }
.dyl-ann-fx-shimmer .dyl-ann-fx::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: -40%;
    width: 30%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
    transform: skewX(-18deg);
    animation: dyl-ann-shine 4.5s ease-in-out infinite;
}

@keyframes dyl-ann-fall { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: .95; } 100% { transform: translateY(90px) translateX(8px); opacity: 0; } }
@keyframes dyl-ann-confetti { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(90px) rotate(540deg); opacity: 0; } }
@keyframes dyl-ann-twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes dyl-ann-rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: .9; } 100% { transform: translateY(-80px) scale(1.1); opacity: 0; } }
@keyframes dyl-ann-shine { 0% { left: -40%; } 55%, 100% { left: 130%; } }

/* Device fallback (the script decides; this keeps a bar off the wrong device before it runs) */
@media (min-width: 769px) { .dyl-ann-dev-mobile { display: none !important; } }
@media (max-width: 768px) {
    .dyl-ann-dev-desktop { display: none !important; }
    .dyl-ann { padding: 9px 12px; font-size: 0.8125rem; }
    .dyl-ann.has-close { padding-left: 12px; padding-right: 42px; }
    .dyl-ann-inner { gap: 6px 10px; }
    .dyl-ann-side { gap: 6px; }
    .dyl-ann-btn { padding: 5px 12px; }
    .dyl-ann-l-ticker .dyl-ann-inner { flex-wrap: wrap; justify-content: center; }
    /* Phones: the same content in less height — a sticky bar must not eat the screen. */
    .dyl-ann-main { gap: 6px; }
    .dyl-ann-icon { font-size: 1.1em; }
    .dyl-ann-sub { font-size: .8em; }
    .dyl-ann-s-large { padding-top: 10px; padding-bottom: 10px; font-size: 0.875rem; }
    .dyl-ann-s-large .dyl-ann-msg { font-size: 0.9375rem; }
    .dyl-ann-cd-label { font-size: .72em; }
    .dyl-ann-box { min-width: 2em; padding: 2px 4px 1px; }
    .dyl-ann-code { padding: 3px 9px; gap: 0; }
    .dyl-ann-code-act { display: none; }
    .dyl-ann-code[data-copied] .dyl-ann-code-txt { display: none; }
    .dyl-ann-s-large .dyl-ann-btn, .dyl-ann-btn { padding: 4px 12px; }
}

/* Keep the site's own sticky menus and floating buttons clear of a sticky/fixed bar */
html.dyl-ann-has-top .dyl-nav { top: var(--dyl-ann-top, 0px); }
html.dyl-ann-has-top.dyl-nav-stuck .pcal-page-wrapper:not(.dyl-no-sticky) .ds-hero-navwrap { top: var(--dyl-ann-top, 0px) !important; }
html.dyl-ann-has-bottom .dyl-wa-fab { bottom: calc(20px + var(--dyl-ann-bottom, 0px) + env(safe-area-inset-bottom, 0px)); }
html.dyl-ann-has-bottom .pcal-page-wrapper { padding-bottom: var(--dyl-ann-bottom, 0px); }

/* "Code applied at checkout" toast */
.dyl-ann-toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + var(--dyl-ann-bottom, 0px));
    transform: translate(-50%, 16px);
    z-index: 1060;
    padding: 10px 18px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font: 600 0.875rem/1.3 var(--pcal-font, system-ui, sans-serif);
    box-shadow: 0 12px 30px -10px rgba(15, 23, 42, .5);
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
    max-width: calc(100vw - 32px);
    text-align: center;
}
.dyl-ann-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
    .dyl-ann, .dyl-ann *, .dyl-ann *::before, .dyl-ann *::after, .dyl-ann-fx::after { animation: none !important; transition: none !important; }
    .dyl-ann-fx { display: none; }
    .dyl-ann-ticker { -webkit-mask-image: none; mask-image: none; }
    .dyl-ann-track { white-space: normal; }
    .dyl-ann-tick + .dyl-ann-tick { display: none; }
}
