/* ==========================================================================
   MrCat Banner — front-end styles
   Base layout + 6 templates (.mbanner--tpl-*). Breakpoint: 1024px.
   Colors/sizes come from CSS custom properties set inline on .mbanner.
   Only opacity/transform are animated (compositor-friendly).
   ========================================================================== */

.mbanner {
    --mb-bg: #140027;
    --mb-text: #fff;
    --mb-title: #fff;
    --mb-neon-in: #ff4400;
    --mb-neon-out: #0088ff;
    --mb-btn: #13efff;
    --mb-btn-text: #06121f;
    --mb-title-fs: 40px;
    --mb-title-fs-m: 24px;
    --mb-neon-fs: 40px;
    --mb-neon-fs-m: 28px;
    --mb-btn-fs: 18px;
    --mb-btn-fs-m: 14px;
    --mb-digit-h: 1.25em;

    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5em;
    width: 100%;
    margin: 0;
    padding: .5em 1em;
    overflow: hidden;
    direction: rtl;
    background-color: var(--mb-bg);
    background-image: var(--mb-bg-img, none);
    background-size: cover;
    background-position: center;
    color: var(--mb-text);
    font-size: clamp(16px, 1vw + 10px, 26px);
    line-height: 1.3;
}

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

/* Not yet moved to the top by JS (themes without wp_body_open) */
.mbanner[data-mrcat-move] {
    display: none;
}

/* Overlay on top of a background image keeps text readable */
.mbanner--has-img::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background: var(--mb-bg);
    opacity: .87;
}

/* Whole-banner link: a stretched anchor, so the promo <button> is never nested inside <a> */
.mbanner__link {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
}

/* ---------- layout: three columns [start | center | end] ---------- */
.mbanner__side {
    position: relative;
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.mbanner__center {
    position: relative;
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .3em .6em;
    min-width: 0;
    text-align: center;
}

.mbanner__side.is-empty {
    visibility: hidden;
}

.mbanner__center.is-empty {
    display: none;
}

.mbanner__counters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35em;
}

.mbanner__daysrow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: .25em .4em;
}

.mbanner__label {
    color: var(--mb-text);
    font-size: .75em;
    font-weight: 700;
}

/* ---------- days odometer ---------- */
.mbanner__days {
    display: inline-flex;
    direction: ltr;
    color: var(--mb-text);
    font-size: 1.05em;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.mb-digit {
    display: inline-block;
    width: .62em;
    height: var(--mb-digit-h);
    overflow: hidden;
    line-height: var(--mb-digit-h);
    text-align: center;
}

.mb-digit__track {
    display: block;
    transition: transform .45s cubic-bezier(.2, .9, .3, 1.15);
    will-change: transform;
}

.mb-digit__track > span {
    display: block;
    height: var(--mb-digit-h);
}

.mb-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- countdown ---------- */
.mbanner__timer {
    display: flex;
    align-items: center;
    gap: 3px;
    direction: ltr;
    color: var(--mb-text);
    font-size: 14px;
    font-weight: 800;
}

.mbanner__timer.is-ended {
    display: none;
}

.mb-seg {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 2.7em;
    padding: .3em .35em;
    border-radius: 6px;
    background: rgba(255, 255, 255, .18);
    line-height: 1.15;
}

.mb-seg b {
    font-size: 1.2em;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.mb-seg small {
    font-size: .68em;
    font-weight: 500;
    opacity: .85;
}

.mb-sep {
    opacity: .5;
}

/* ---------- center: badge + titles ---------- */
.mbanner__badge {
    position: relative;
    display: inline-block;
    min-width: 2em;
    padding: .1em .45em;
    color: #fff;
    font-size: var(--mb-neon-fs);
    line-height: 1.5;
    text-align: center;
    text-transform: uppercase;
}

.mbanner__title {
    margin: 0;
    color: var(--mb-title);
    font-size: var(--mb-title-fs);
    font-weight: 800;
    line-height: 1.25;
}

/* ---------- promo button ---------- */
.mbanner__btn {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 7em;
    max-width: 100%;
    margin: 0;
    padding: .2em 1.2em;
    border: 0;
    border-radius: .6em;
    background: var(--mb-btn);
    color: var(--mb-btn-text);
    font: inherit;
    font-size: var(--mb-btn-fs);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    transition: transform .15s ease, filter .15s ease;
}

span.mbanner__btn {
    cursor: default;
}

.mbanner__btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.mbanner__btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.mbanner__btn.is-copied {
    background: #22c55e !important;
    color: #fff !important;
}

.mb-only-m {
    display: none;
}

/* ==========================================================================
   Template: neon (classic) — glow is drawn on pseudo-elements and only
   their opacity flickers, so there is no per-frame repaint of big shadows.
   ========================================================================== */
.mbanner--tpl-neon .mbanner__badge {
    --mb-bw: .1em;
    border: var(--mb-bw) solid #fff;
    border-radius: .5em;
    font-style: italic;
    font-weight: 200;
}

.mbanner--tpl-neon .mbanner__badge::before,
.mbanner--tpl-neon .mbanner__badge::after {
    content: "";
    position: absolute;
    animation: mb-flicker 1.5s infinite alternate;
    pointer-events: none;
}

.mbanner--tpl-neon .mbanner__badge::before {
    content: attr(data-text);
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding: inherit;
    font: inherit;
    text-transform: inherit;
    text-shadow:
        -.05em -.05em .25em #fff,
        .05em .05em .25em #fff,
        0 0 .5em var(--mb-neon-in),
        0 0 1em var(--mb-neon-in),
        0 0 1.6em var(--mb-neon-in);
}

.mbanner--tpl-neon .mbanner__badge::after {
    top: calc(var(--mb-bw) * -1);
    right: calc(var(--mb-bw) * -1);
    bottom: calc(var(--mb-bw) * -1);
    left: calc(var(--mb-bw) * -1);
    border-radius: .5em;
    box-shadow:
        0 0 .15em #fff,
        inset 0 0 .15em #fff,
        0 0 .5em var(--mb-neon-out),
        inset 0 0 .5em var(--mb-neon-out),
        0 0 1em var(--mb-neon-out),
        inset 0 0 1em var(--mb-neon-out);
}

.mbanner--tpl-neon .mbanner__title {
    text-shadow: 0 0 .4em var(--mb-neon-in), 0 0 .9em var(--mb-neon-in), 0 0 1.5em var(--mb-neon-in);
    animation: mb-float 2s ease-in-out infinite alternate;
}

.mbanner--tpl-neon .mbanner__btn {
    box-shadow: 0 0 20px var(--mb-btn);
}

@keyframes mb-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
    20%, 24%, 55% { opacity: 0; }
}

@keyframes mb-float {
    from { transform: translateY(4%); }
    to { transform: translateY(0); }
}

/* ==========================================================================
   Template: pastel — fantasy / soft candy colors
   ========================================================================== */
.mbanner--tpl-pastel {
    background-image: var(--mb-bg-img, none);
}

.mbanner--tpl-pastel::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 8% 30%, rgba(255, 255, 255, .75) 0 6%, transparent 7%),
        radial-gradient(circle at 92% 70%, rgba(255, 255, 255, .7) 0 5%, transparent 6%),
        linear-gradient(100deg, rgba(255, 207, 229, .95), rgba(224, 214, 255, .95) 38%, rgba(205, 238, 255, .95) 68%, rgba(213, 255, 232, .95));
    opacity: 1;
}

.mbanner--tpl-pastel .mbanner__deco {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

.mbanner--tpl-pastel .mbanner__deco i {
    position: absolute;
    font-size: 1em;
    font-style: normal;
    line-height: 1;
    color: #ff9ccb;
    opacity: .6;
    animation: mb-twinkle 3.2s ease-in-out infinite;
}

.mbanner--tpl-pastel .mbanner__deco i:nth-child(1) { top: 14%; left: 4%;  color: #ffb3d6; font-size: 1.1em; }
.mbanner--tpl-pastel .mbanner__deco i:nth-child(2) { top: 58%; left: 12%; color: #ff8fc0; animation-delay: -.8s; }
.mbanner--tpl-pastel .mbanner__deco i:nth-child(3) { top: 20%; left: 27%; color: #b9a4ff; animation-delay: -1.6s; }
.mbanner--tpl-pastel .mbanner__deco i:nth-child(4) { top: 62%; left: 41%; color: #ffffff; font-size: 1.5em; animation-delay: -2.2s; }
.mbanner--tpl-pastel .mbanner__deco i:nth-child(5) { top: 12%; left: 60%; color: #8be0c3; animation-delay: -.4s; }
.mbanner--tpl-pastel .mbanner__deco i:nth-child(6) { top: 66%; left: 74%; color: #ffd36e; font-size: 1.2em; animation-delay: -1.2s; }
.mbanner--tpl-pastel .mbanner__deco i:nth-child(7) { top: 18%; left: 88%; color: #ff8fc0; animation-delay: -2.6s; }
.mbanner--tpl-pastel .mbanner__deco i:nth-child(8) { top: 60%; left: 95%; color: #8ccfff; animation-delay: -1.9s; }

.mbanner--tpl-pastel .mbanner__badge {
    padding: .05em .55em;
    border: .07em dashed var(--mb-neon-out);
    border-radius: 999px;
    background: #fff;
    color: var(--mb-neon-in);
    font-weight: 800;
    box-shadow: 0 .12em 0 rgba(255, 255, 255, .8), 0 6px 18px rgba(185, 164, 255, .5);
    animation: mb-bob 3s ease-in-out infinite;
}

.mbanner--tpl-pastel .mbanner__title {
    text-shadow: 0 2px 0 #fff, 0 4px 10px rgba(185, 164, 255, .55);
}

.mbanner--tpl-pastel .mbanner__btn {
    border-radius: 999px;
    box-shadow: 0 4px 0 rgba(255, 255, 255, .7), 0 8px 16px rgba(255, 111, 174, .35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.mbanner--tpl-pastel .mb-seg {
    background: rgba(255, 255, 255, .75);
    box-shadow: 0 3px 8px rgba(185, 164, 255, .35);
}

.mbanner--tpl-pastel .mbanner__days {
    padding: 0 .25em;
    border-radius: .4em;
    background: rgba(255, 255, 255, .75);
}

@keyframes mb-twinkle {
    0%, 100% { opacity: .35; transform: scale(.8) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(14deg); }
}

@keyframes mb-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ==========================================================================
   Template: minimal — light and clean
   ========================================================================== */
.mbanner--tpl-minimal {
    border-bottom: 1px solid rgba(15, 23, 42, .1);
}

.mbanner--tpl-minimal .mbanner__badge {
    padding: .05em .5em;
    border-radius: .4em;
    background: var(--mb-neon-in);
    color: #fff;
    font-weight: 800;
}

.mbanner--tpl-minimal .mbanner__title {
    font-weight: 700;
}

.mbanner--tpl-minimal .mb-seg,
.mbanner--tpl-minimal .mbanner__days {
    background: rgba(15, 23, 42, .06);
}

.mbanner--tpl-minimal .mbanner__days {
    padding: 0 .3em;
    border-radius: .35em;
}

.mbanner--tpl-minimal .mbanner__btn {
    border-radius: .5em;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .2);
}

/* ==========================================================================
   Template: aurora — dark gradient + glass badge
   ========================================================================== */
.mbanner--tpl-aurora::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -10%;
    bottom: -40%;
    left: -10%;
    z-index: -1;
    background:
        radial-gradient(ellipse at 15% 40%, var(--mb-neon-out), transparent 55%),
        radial-gradient(ellipse at 85% 60%, var(--mb-neon-in), transparent 50%);
    opacity: .5;
    animation: mb-drift 14s ease-in-out infinite alternate;
}

.mbanner--tpl-aurora .mbanner__badge {
    padding: .05em .5em;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: .6em;
    background: rgba(255, 255, 255, .12);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--mb-neon-in);
    font-weight: 800;
}

.mbanner--tpl-aurora .mbanner__btn {
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

@keyframes mb-drift {
    from { transform: translateX(-4%); }
    to { transform: translateX(4%); }
}

/* ==========================================================================
   Template: luxury — black & gold
   ========================================================================== */
.mbanner--tpl-luxury {
    border-top: 1px solid var(--mb-neon-out);
    border-bottom: 1px solid var(--mb-neon-out);
    background-image: var(--mb-bg-img, linear-gradient(90deg, rgba(212, 175, 55, .08), transparent 30%, transparent 70%, rgba(212, 175, 55, .08)));
}

.mbanner--tpl-luxury .mbanner__badge {
    padding: .05em .6em;
    border: 1px solid var(--mb-neon-in);
    outline: 1px solid var(--mb-neon-out);
    outline-offset: 3px;
    color: var(--mb-neon-in);
    font-weight: 700;
    letter-spacing: .04em;
}

.mbanner--tpl-luxury .mbanner__title {
    font-weight: 700;
    letter-spacing: .01em;
}

.mbanner--tpl-luxury .mb-seg {
    border: 1px solid rgba(212, 175, 55, .45);
    background: transparent;
}

.mbanner--tpl-luxury .mbanner__btn {
    border-radius: 2px;
    background: linear-gradient(135deg, #f5d98a, var(--mb-btn) 55%, #a8801d);
    box-shadow: 0 2px 10px rgba(212, 175, 55, .35);
    letter-spacing: .02em;
}

/* ==========================================================================
   Template: sale — hot red, pulsing yellow badge
   ========================================================================== */
.mbanner--tpl-sale {
    background-image: var(--mb-bg-img, repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 14px, transparent 14px 28px));
}

.mbanner--tpl-sale .mbanner__badge {
    padding: .02em .5em;
    border-radius: .35em;
    background: var(--mb-neon-out);
    color: var(--mb-neon-in);
    font-weight: 900;
    transform: rotate(-3deg);
    box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
    animation: mb-pulse 1.6s ease-in-out infinite;
}

.mbanner--tpl-sale .mbanner__title {
    font-weight: 900;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .2);
}

.mbanner--tpl-sale .mbanner__btn {
    box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}

@keyframes mb-pulse {
    0%, 100% { transform: rotate(-3deg) scale(1); }
    50% { transform: rotate(-3deg) scale(1.07); }
}

/* ==========================================================================
   Responsive: tablets and phones (<= 1024px)
   Row 1: title (full width). Row 2: counters + button side by side.
   ========================================================================== */
@media (max-width: 1024px) {
    .mbanner {
        flex-wrap: wrap;
        padding: .6em .75em;
        gap: .5em;
        font-size: clamp(14px, 2.2vw, 20px);
    }

    .mbanner__center {
        flex: 1 1 100%;
        order: -1;
    }

    .mbanner__side {
        flex: 1 1 0;
    }

    .mbanner__side.is-empty {
        display: none;
    }

    .mbanner__badge {
        font-size: var(--mb-neon-fs-m);
    }

    .mbanner__title {
        font-size: var(--mb-title-fs-m);
    }

    .mbanner__btn {
        font-size: var(--mb-btn-fs-m);
        width: 100%;
        max-width: 18em;
    }

    .mb-hide-m {
        display: none !important;
    }

    .mb-only-d {
        display: none;
    }

    .mb-only-m {
        display: inline;
    }
}

@media (max-width: 480px) {
    .mbanner__center {
        gap: .2em .4em;
    }

    .mb-seg {
        min-width: 2.4em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mbanner,
    .mbanner *,
    .mbanner *::before,
    .mbanner *::after {
        animation: none !important;
        transition: none !important;
    }
}
