/* ═══════════════════════════════════════════════════════════
   STICKY MARQUEE BANNER
   Used on both the storefront (frontend) and the admin
   live-preview panel. Colors come from CSS custom properties
   set inline per-instance: --mq-text, --mq-bg, --mq-icon.
   ═══════════════════════════════════════════════════════════ */

.marquee-banner {
    --mq-text: #ffffff;
    --mq-bg: #15152b;
    --mq-icon: #2f6fed;
    position: sticky;
    top: 0;
    z-index: 1035;
    width: 100%;
    overflow: hidden;
    background: var(--mq-bg);
    color: var(--mq-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}
.marquee-banner a {
    color: inherit;
    text-decoration: none;
}
.marquee-banner .mq-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--mq-icon);
}
.marquee-banner .mq-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* admin live-preview wrapper: same visuals, not actually sticky */
#marquee_live_preview .marquee-banner {
    position: relative;
    border-radius: 8px;
}

/* ─── TEMPLATE: CONTINUOUS MARQUEE ─────────────────────────── */
.marquee-banner.mq-continuous {
    padding: 0;
}
.marquee-banner.mq-continuous .mq-track {
    display: flex;
    width: max-content;
    animation: mq-scroll var(--mq-speed, 22s) linear infinite;
}
.marquee-banner.mq-continuous:hover .mq-track {
    animation-play-state: paused;
}
.marquee-banner.mq-continuous .mq-item {
    padding: 9px 22px;
}
.marquee-banner.mq-continuous .mq-sep {
    margin-left: 22px;
    opacity: .6;
}
@keyframes mq-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ─── TEMPLATE: SLIDE CAROUSEL ──────────────────────────────── */
.marquee-banner.mq-slide {
    justify-content: center;
    padding: 0 44px;
    min-height: 38px;
    display: flex;
    align-items: center;
}
.marquee-banner.mq-slide .mq-window {
    width: min(680px, 100%);
    overflow: hidden;
}
.marquee-banner.mq-slide .mq-track {
    display: flex;
    transition: transform .45s ease;
}
.marquee-banner.mq-slide .mq-item {
    min-width: 100%;
    justify-content: center;
    padding: 9px 16px;
    text-align: center;
}
.marquee-banner.mq-slide .mq-ctrl {
    position: absolute;
    top: 50%;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    transform: translateY(-50%);
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.marquee-banner.mq-slide .mq-ctrl:hover {
    background: rgba(255, 255, 255, .14);
}
.marquee-banner.mq-slide .mq-ctrl.prev { left: 8px; }
.marquee-banner.mq-slide .mq-ctrl.next { right: 8px; }

/* ─── TEMPLATE: CROSSFADE ───────────────────────────────────── */
.marquee-banner.mq-fade {
    justify-content: center;
    padding: 0 20px;
    min-height: 38px;
    display: flex;
    align-items: center;
}
.marquee-banner.mq-fade .mq-wrap {
    position: relative;
    min-height: 20px;
    width: min(720px, 100%);
}
.marquee-banner.mq-fade .mq-item {
    position: absolute;
    inset: 0;
    justify-content: center;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .45s ease, transform .45s ease;
    pointer-events: none;
}
.marquee-banner.mq-fade .mq-item.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ─── TEMPLATE: BENEFITS ROW ────────────────────────────────── */
.marquee-banner.mq-benefits {
    min-height: 44px;
}
.marquee-banner.mq-benefits .mq-list {
    display: flex;
    align-items: center;
    gap: 30px;
    overflow-x: auto;
    padding: 0 16px;
    scrollbar-width: none;
    width: 100%;
}
.marquee-banner.mq-benefits .mq-list::-webkit-scrollbar {
    display: none;
}
.marquee-banner.mq-benefits .mq-item {
    flex: 0 0 auto;
}

/* ─── TEMPLATE: ACCENT PROMOTION ────────────────────────────── */
.marquee-banner.mq-accent {
    justify-content: center;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.marquee-banner.mq-accent .mq-cta {
    margin-left: 6px;
    font-weight: 800;
    white-space: nowrap;
}

/* ─── TEMPLATE: STATIC DISMISSIBLE ──────────────────────────── */
.marquee-banner.mq-dismissible {
    position: relative;
    justify-content: center;
    padding: 9px 40px 9px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.marquee-banner.mq-dismissible .mq-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
}
.marquee-banner.mq-dismissible .mq-close:hover {
    background: rgba(255, 255, 255, .14);
}

/* ─── ACCESSIBILITY ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .marquee-banner.mq-continuous .mq-track {
        animation: none;
    }
    .marquee-banner.mq-slide .mq-track {
        transition: none;
    }
    .marquee-banner.mq-fade .mq-item {
        transition: none;
    }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 575px) {
    .marquee-banner {
        font-size: 12px;
    }
    .marquee-banner.mq-continuous .mq-item {
        padding: 8px 16px;
    }
    .marquee-banner.mq-slide,
    .marquee-banner.mq-fade,
    .marquee-banner.mq-accent,
    .marquee-banner.mq-dismissible {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ═══════════════════════════════════════════════════════════
   ADMIN-ONLY: template picker cards, color fields, icon picker
   ═══════════════════════════════════════════════════════════ */

.marquee-template-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.marquee-template-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 10px;
    border: 1px solid #e5e7ef;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: #15152b;
    margin: 0;
    transition: border-color .15s, background .15s;
}
.marquee-template-card:hover {
    border-color: #2f6fed;
}
.marquee-template-card.selected {
    border-color: #2f6fed;
    background: #e8effe;
    color: #2f6fed;
}
.marquee-template-card input {
    display: none;
}

.marquee-color-field input[type="color"] {
    width: 40px;
    height: 32px;
    padding: 0;
    border: 1px solid #e5e7ef;
    border-radius: 6px;
    cursor: pointer;
}

.marquee-message-row {
    align-items: center;
}
.marquee-icon-trigger {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7ef;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    padding: 0;
}
.marquee-icon-trigger:hover {
    border-color: #2f6fed;
}
.marquee-icon-trigger-preview {
    width: 18px;
    height: 18px;
    display: inline-flex;
    color: #2f6fed;
}
.marquee-icon-trigger-preview svg {
    width: 18px;
    height: 18px;
}

.marquee-icon-popover {
    position: absolute;
    z-index: 2000;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    background: #fff;
    border: 1px solid #e5e7ef;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 46, .14);
    padding: 10px;
    width: 240px;
}
.marquee-icon-popover.hidden {
    display: none;
}
.marquee-icon-popover button {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: #15152b;
    padding: 0;
}
.marquee-icon-popover button:hover {
    background: #f4f5f9;
}
.marquee-icon-popover button.selected {
    border-color: #2f6fed;
    background: #e8effe;
    color: #2f6fed;
}
.marquee-icon-popover svg {
    width: 18px;
    height: 18px;
}
