/* =========================================================
   ZeroMaxShop responsive compact promo tiles — v2
   - Guests: three tight cards.
   - Signed in: one short offer bar, never a giant square.
   - Topbar: compact animated reward reel, no "Spin" word.
========================================================= */

.zms-promo-mobile-slot:empty,
.zms-promo-desktop-slot:empty {
    display: none;
}

.zms-promo-mobile-slot,
.zms-promo-desktop-slot {
    width: 100%;
    min-width: 0;
}

/* =========================================================
   Promo tile system
========================================================= */

.zms-shop-promo-tiles {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.zms-shop-promo-tiles.is-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.zms-shop-promo-tiles.is-count-1 {
    grid-template-columns: minmax(0, 1fr);
}

.zms-shop-promo-tile {
    --promo-accent: #0f8b67;
    --promo-border: #9fdcca;
    --promo-surface-start: #f3fffb;
    --promo-surface-end: #eaf9f4;
    --promo-icon-surface: #087d5c;
    --promo-icon-color: #ffffff;

    position: relative;
    isolation: isolate;
    display: grid;
    min-width: 0;
    min-height: 102px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px 6px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid var(--promo-border);
    border-radius: 16px;
    background: linear-gradient(
        145deg,
        var(--promo-surface-start),
        var(--promo-surface-end)
    );
    color: #111827;
    text-decoration: none;
    box-shadow:
        0 8px 22px rgba(15, 23, 42, 0.055),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    transform: translateZ(0);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.zms-shop-promo-tile:hover {
    color: #111827;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow:
        0 13px 28px rgba(15, 23, 42, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.zms-shop-promo-tile:active {
    transform: scale(0.985);
}

.zms-shop-promo-tile:focus-visible {
    outline: 3px solid rgba(15, 139, 103, 0.22);
    outline-offset: 3px;
}

.zms-shop-promo-offer {
    --promo-accent: #e0a000;
    --promo-border: #f1d780;
    --promo-surface-start: #fffdf3;
    --promo-surface-end: #fff8e5;
    --promo-icon-surface: #181818;
    --promo-icon-color: #facc15;
}

.zms-shop-promo-spin {
    --promo-accent: #7c4bd1;
    --promo-border: #d3c1fa;
    --promo-surface-start: #fbf9ff;
    --promo-surface-end: #f1ecff;
    --promo-icon-surface: #6842c2;
    --promo-icon-color: #ffffff;
}

.zms-promo-tile-glow {
    position: absolute;
    z-index: -1;
    top: -42px;
    right: -36px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(124, 75, 209, 0.08);
    filter: blur(10px);
    pointer-events: none;
}

.zms-shop-promo-trust .zms-promo-tile-glow {
    background: rgba(15, 139, 103, 0.09);
}

.zms-shop-promo-offer .zms-promo-tile-glow {
    background: rgba(224, 160, 0, 0.1);
}

.zms-promo-tile-icon {
    position: relative;
    z-index: 2;
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    grid-column: 1;
    grid-row: 1;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 50%;
    background: var(--promo-icon-surface);
    color: var(--promo-icon-color);
    box-shadow:
        0 7px 16px rgba(15, 23, 42, 0.13),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 19px;
}

.zms-shop-promo-trust .zms-promo-tile-icon {
    animation: zmsPromoShieldPulse 3.2s ease-in-out infinite;
}

.zms-shop-promo-spin .zms-promo-tile-icon i {
    animation: zmsPromoSpinIcon 5.2s linear infinite;
}

.zms-promo-tile-copy {
    position: relative;
    z-index: 2;
    display: grid;
    min-width: 0;
    align-self: end;
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 5px;
    padding-right: 17px;
}

.zms-promo-tile-copy strong {
    display: block;
    min-width: 0;
    color: #101114;
    font-size: 14px;
    font-weight: 950;
    letter-spacing: -0.025em;
    line-height: 1.08;
}

.zms-promo-tile-static-subtitle,
.zms-promo-tile-rotator {
    position: relative;
    display: block;
    min-width: 0;
    height: 17px;
    overflow: hidden;
    color: #343842;
    font-size: 11.5px;
    font-weight: 650;
    line-height: 17px;
}

.zms-promo-tile-rotator > span {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    opacity: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateY(8px);
    transition:
        opacity 260ms ease,
        transform 260ms ease;
}

.zms-promo-tile-rotator > span.is-active {
    opacity: 1;
    transform: translateY(0);
}

.zms-promo-tile-arrow {
    position: absolute;
    right: 10px;
    bottom: 11px;
    z-index: 3;
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #14161b;
    font-size: 14px;
    transition: transform 180ms ease;
}

.zms-shop-promo-tile:hover .zms-promo-tile-arrow {
    transform: translateX(2px);
}

.zms-promo-sparkle {
    position: absolute;
    z-index: 1;
    color: var(--promo-accent);
    font-size: 12px;
    line-height: 1;
    opacity: 0.72;
    pointer-events: none;
}

.zms-promo-sparkle-one {
    top: 17px;
    right: 15px;
    animation: zmsPromoSparkleOne 2.8s ease-in-out infinite;
}

.zms-promo-sparkle-two {
    top: 34px;
    right: 29px;
    font-size: 8px;
    animation: zmsPromoSparkleTwo 3.4s ease-in-out infinite;
}

.zms-shop-promo-tile.is-claimed {
    --promo-accent: #0f8b67;
    --promo-border: #93d6c0;
    --promo-surface-start: #effcf7;
    --promo-surface-end: #e5f7f0;
    --promo-icon-surface: #087d5c;
    --promo-icon-color: #ffffff;
    pointer-events: none;
}

.zms-shop-promo-tile.is-leaving {
    opacity: 0;
    transform: translateY(-7px) scale(0.97);
    transition:
        opacity 320ms ease,
        transform 320ms ease;
}

/* =========================================================
   Signed-in single offer — deliberately short and restrained
========================================================= */

.zms-shop-promo-tiles.is-signed-in.is-single-offer {
    display: block;
}

.zms-shop-promo-tiles.is-signed-in.is-single-offer
.zms-shop-promo-tile {
    min-height: 70px;
    grid-template-columns: 42px minmax(0, 1fr) 20px;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
}

.zms-shop-promo-tiles.is-signed-in.is-single-offer
.zms-promo-tile-icon {
    width: 40px;
    height: 40px;
    grid-column: 1;
    grid-row: 1;
}

.zms-shop-promo-tiles.is-signed-in.is-single-offer
.zms-promo-tile-copy {
    align-self: center;
    grid-column: 2;
    grid-row: 1;
    gap: 3px;
    padding-right: 0;
}

.zms-shop-promo-tiles.is-signed-in.is-single-offer
.zms-promo-tile-copy strong {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zms-shop-promo-tiles.is-signed-in.is-single-offer
.zms-promo-tile-arrow {
    position: static;
    width: 20px;
    height: 20px;
    grid-column: 3;
    grid-row: 1;
}

.zms-shop-promo-tiles.is-signed-in.is-single-offer
.zms-promo-sparkle-one {
    top: 10px;
    right: 42px;
}

.zms-shop-promo-tiles.is-signed-in.is-single-offer
.zms-promo-sparkle-two {
    display: none;
}

/* =========================================================
   Shared mini reward reel used by the signed-in topbar
========================================================= */

.zms-mini-reward-wheel {
    --zms-reward-wheel-height: 30px;
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    height: var(--zms-reward-wheel-height);
}

.zms-mini-reward-viewport {
    position: relative;
    display: block;
    width: 100%;
    height: var(--zms-reward-wheel-height);
    overflow: hidden;
    border: 1px solid #5e456d;
    border-radius: 8px;
    background: #291531;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.zms-mini-reward-viewport::before,
.zms-mini-reward-viewport::after {
    position: absolute;
    right: 0;
    left: 0;
    z-index: 2;
    height: 6px;
    content: "";
    pointer-events: none;
}

.zms-mini-reward-viewport::before {
    top: 0;
    background: linear-gradient(180deg, rgba(27, 12, 34, 0.96), transparent);
}

.zms-mini-reward-viewport::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(27, 12, 34, 0.96), transparent);
}

.zms-mini-reward-strip {
    display: block;
    will-change: transform;
}

.zms-mini-reward-item {
    display: flex;
    height: var(--zms-reward-wheel-height);
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    overflow: hidden;
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.zms-mini-reward-marker {
    position: absolute;
    top: 50%;
    left: -7px;
    z-index: 4;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid #facc15;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
    transform: translateY(-50%);
}

/* =========================================================
   Signed-in topbar reel
   Existing shop.html markup is supported directly.
========================================================= */

body.shop-page
.topbar
.topbar-nav
> .zms-topbar-reward-wheel {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 2px 0 7px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
}

body.shop-page
.topbar
.topbar-nav
> .zms-topbar-reward-wheel:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: translateY(-1px) !important;
}

body.shop-page
.zms-topbar-reward-wheel
.zms-topbar-wheel-label {
    display: none !important;
}

body.shop-page
.zms-topbar-reward-wheel
.zms-topbar-wheel-window {
    --zms-reward-wheel-height: 30px;
    width: 84px !important;
    height: var(--zms-reward-wheel-height) !important;
}

body.shop-page
.zms-topbar-reward-wheel
.zms-mini-reward-item {
    padding-inline: 5px !important;
    font-size: 9px !important;
}

/* Desktop keeps notification bell beside the reward reel. */
body.shop-page .product-notification-clean-link {
    display: inline-flex;
}

/* =========================================================
   Desktop sizing
========================================================= */

@media (min-width: 901px) {
    .zms-shop-promo-tiles {
        gap: 12px;
        margin-bottom: 16px;
    }

    .zms-shop-promo-tile {
        min-height: 86px;
        padding: 12px 14px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-rows: 1fr;
        align-items: center;
        gap: 11px;
    }

    .zms-promo-tile-icon {
        grid-column: 1;
        grid-row: 1;
    }

    .zms-promo-tile-copy {
        align-self: center;
        grid-column: 2;
        grid-row: 1;
        padding-right: 0;
    }

    .zms-promo-tile-copy strong {
        font-size: 15px;
    }

    .zms-promo-tile-static-subtitle,
    .zms-promo-tile-rotator {
        font-size: 12px;
    }

    .zms-promo-tile-arrow {
        position: static;
        grid-column: 3;
        grid-row: 1;
    }

    /* One signed-in offer is a compact module, not a full-width banner. */
    .zms-shop-promo-tiles.is-signed-in.is-single-offer {
        width: min(100%, 430px);
        margin-right: auto;
    }

    .zms-shop-promo-tiles.is-signed-in.is-single-offer
    .zms-shop-promo-tile {
        min-height: 72px;
    }
}

/* =========================================================
   Mobile sizing
========================================================= */

@media (max-width: 900px) {
    .zms-promo-desktop-slot {
        display: none;
    }

    .zms-promo-mobile-slot {
        display: block;
        margin-top: 9px;
    }

    .zms-shop-promo-tiles {
        gap: 8px;
        margin-bottom: 11px;
    }

    .zms-shop-promo-tile {
        min-height: 112px;
        padding: 10px;
        border-radius: 15px;
    }

    .zms-promo-tile-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .zms-promo-tile-copy strong {
        font-size: 12.5px;
        line-height: 1.12;
    }

    .zms-promo-tile-static-subtitle,
    .zms-promo-tile-rotator {
        height: 16px;
        font-size: 10.5px;
        line-height: 16px;
    }

    .zms-promo-sparkle-one {
        top: 16px;
        right: 12px;
    }

    .zms-promo-sparkle-two {
        top: 34px;
        right: 22px;
    }

    /* Signed-in mobile offer stays one short row. */
    .zms-shop-promo-tiles.is-signed-in.is-single-offer {
        margin-top: 1px;
        margin-bottom: 10px;
    }

    .zms-shop-promo-tiles.is-signed-in.is-single-offer
    .zms-shop-promo-tile {
        min-height: 66px;
        border-radius: 15px;
    }

    .zms-shop-promo-tiles.is-signed-in.is-single-offer
    .zms-promo-tile-copy strong {
        font-size: 13px;
    }

    /* Reward reel replaces the bell only on mobile. */
    body.shop-page
    .topbar
    .topbar-nav
    > a.product-notification-clean-link {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    body.shop-page
    .topbar
    .topbar-nav
    > .zms-topbar-reward-wheel {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        max-width: 68px !important;
        margin: 0 3px 0 5px !important;
    }

    body.shop-page
    .zms-topbar-reward-wheel
    .zms-topbar-wheel-window {
        --zms-reward-wheel-height: 27px;
        width: 60px !important;
        height: var(--zms-reward-wheel-height) !important;
    }

    body.shop-page
    .zms-topbar-reward-wheel
    .zms-mini-reward-item {
        padding-inline: 3px !important;
        font-size: 8px !important;
    }

    body.shop-page
    .zms-topbar-reward-wheel
    .zms-mini-reward-marker {
        left: -6px;
        border-top-width: 4px;
        border-bottom-width: 4px;
        border-left-width: 6px;
    }

    .shop-page .mobile-commerce-header {
        padding-bottom: 7px;
    }

    .shop-page .mobile-commerce-search {
        margin-bottom: 0;
    }
}

@media (max-width: 390px) {
    .zms-shop-promo-tiles {
        gap: 7px;
    }

    .zms-shop-promo-tile {
        min-height: 108px;
        padding: 9px;
        border-radius: 14px;
    }

    .zms-promo-tile-icon {
        width: 33px;
        height: 33px;
        font-size: 16px;
    }

    .zms-promo-tile-copy {
        gap: 4px;
        padding-right: 14px;
    }

    .zms-promo-tile-copy strong {
        font-size: 11.5px;
    }

    .zms-promo-tile-static-subtitle,
    .zms-promo-tile-rotator {
        font-size: 9.5px;
    }

    .zms-promo-tile-arrow {
        right: 7px;
        bottom: 9px;
        font-size: 12px;
    }

    .zms-shop-promo-tiles.is-signed-in.is-single-offer
    .zms-shop-promo-tile {
        min-height: 64px;
        padding: 8px 10px;
    }

    .zms-shop-promo-tiles.is-signed-in.is-single-offer
    .zms-promo-tile-copy strong {
        font-size: 12.5px;
    }
}

@media (max-width: 350px) {
    .zms-shop-promo-tile {
        min-height: 103px;
        padding: 8px;
    }

    .zms-promo-tile-copy strong {
        font-size: 10.5px;
    }

    .zms-promo-tile-static-subtitle,
    .zms-promo-tile-rotator {
        font-size: 9px;
    }

    body.shop-page
    .zms-topbar-reward-wheel
    .zms-topbar-wheel-window {
        width: 55px !important;
    }
}

@keyframes zmsPromoShieldPulse {
    0%, 100% {
        box-shadow:
            0 7px 16px rgba(15, 139, 103, 0.18),
            0 0 0 0 rgba(15, 139, 103, 0.18),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    50% {
        box-shadow:
            0 7px 16px rgba(15, 139, 103, 0.23),
            0 0 0 7px rgba(15, 139, 103, 0),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

@keyframes zmsPromoSpinIcon {
    to {
        transform: rotate(360deg);
    }
}

@keyframes zmsPromoSparkleOne {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.72) rotate(0deg);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.08) rotate(18deg);
    }
}

@keyframes zmsPromoSparkleTwo {
    0%, 100% {
        opacity: 0.2;
        transform: translateY(2px) scale(0.7);
    }

    55% {
        opacity: 0.72;
        transform: translateY(-2px) scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    .zms-shop-promo-tile,
    .zms-shop-promo-tile *,
    .zms-topbar-reward-wheel,
    .zms-topbar-reward-wheel * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* =========================================================
   ZeroMaxShop promo rail desktop polish — v3
========================================================= */

/*
   Replace the flat clockwise loader motion with a wheel that
   subtly turns in 3D and moves toward the shopper.
*/
.zms-shop-promo-spin {
    perspective: 320px;
}

.zms-shop-promo-spin .zms-promo-tile-icon {
    transform-style: preserve-3d;
    backface-visibility: visible;
    animation:
        zmsPromoWheelPop3D
        3.4s
        cubic-bezier(0.22, 0.72, 0.2, 1)
        infinite !important;
    will-change: transform;
}

.zms-shop-promo-spin .zms-promo-tile-icon i {
    animation: none !important;
    font-size: 22px !important;
    font-weight: 950;
    line-height: 1;
    transform: translateZ(8px) scale(1.08);
    text-shadow:
        0 1px 1px rgba(255, 255, 255, 0.18),
        0 4px 9px rgba(33, 17, 80, 0.28);
}

/* The small radiating marks read more clearly at this size. */
.zms-shop-promo-spin .zms-promo-tile-icon::after {
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    content: "";
    transform: translateZ(3px);
    pointer-events: none;
}

@keyframes zmsPromoWheelPop3D {
    0%,
    100% {
        transform:
            perspective(220px)
            rotateY(-16deg)
            rotateX(4deg)
            translateZ(0)
            scale(0.97);
        box-shadow:
            0 7px 16px rgba(62, 34, 130, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }

    42% {
        transform:
            perspective(220px)
            rotateY(0deg)
            rotateX(0deg)
            translateZ(13px)
            scale(1.09);
        box-shadow:
            0 14px 24px rgba(62, 34, 130, 0.27),
            0 0 0 7px rgba(124, 75, 209, 0.055),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }

    72% {
        transform:
            perspective(220px)
            rotateY(15deg)
            rotateX(-3deg)
            translateZ(4px)
            scale(1.015);
        box-shadow:
            0 9px 18px rgba(62, 34, 130, 0.19),
            inset 0 1px 0 rgba(255, 255, 255, 0.24);
    }
}

@media (min-width: 901px) {
    /* Shorter desktop modules so products remain the focus. */
    .zms-shop-promo-tiles {
        gap: 10px;
        margin-bottom: 12px;
    }

    .zms-shop-promo-tile {
        min-height: 70px;
        padding: 8px 12px;
        gap: 8px;
        border-radius: 15px;
    }

    .zms-promo-tile-icon {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }

    .zms-promo-tile-copy {
        gap: 2px;
    }

    .zms-promo-tile-copy strong {
        font-size: 14px;
        line-height: 1.06;
    }

    .zms-promo-tile-static-subtitle,
    .zms-promo-tile-rotator {
        height: 15px;
        font-size: 11px;
        line-height: 15px;
    }

    .zms-promo-sparkle-one {
        top: 12px;
        right: 13px;
    }

    .zms-promo-sparkle-two {
        top: 28px;
        right: 25px;
    }

    /*
       Restore the clear desktop-only action at the far edge
       of the welcome coupon card.
    */
    .zms-shop-promo-offer .zms-promo-tile-arrow {
        display: inline-flex;
        width: auto;
        min-width: max-content;
        gap: 4px;
        padding: 0 1px;
        font-size: 13px;
        font-weight: 900;
    }

    .zms-shop-promo-offer .zms-promo-tile-arrow::before {
        content: "Claim";
        color: #1d1f24;
        font-size: 11px;
        font-weight: 900;
        line-height: 1;
    }

    .zms-shop-promo-tiles.is-signed-in.is-single-offer
    .zms-shop-promo-tile {
        min-height: 64px;
        padding-block: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zms-shop-promo-spin .zms-promo-tile-icon {
        animation: none !important;
        transform: none !important;
    }
}
