/* =========================================================
   Membership 3D cover-flow — PR1MELAB glass stack
========================================================= */

.membership-stack-hint {
    margin: 12px auto 0;
    max-width: 34rem;
    color: rgba(250, 249, 254, 0.58);
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
}

/* Wrap: arrows + stage */
body:not(.dashboard-app-body) .membership-section--coverflow .membership-stack-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2vw, 20px);
    width: 100%;
    max-width: 920px;
    margin: 8px auto 0;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-stack-stage {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: var(--membership-stack-stage-min-height);
    margin: 0;
    padding: 24px 0 28px;
    perspective: var(--membership-stack-perspective);
    perspective-origin: 50% 46%;
    overflow: visible;
    touch-action: pan-y;
    outline: none;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-stack-glow {
    position: absolute;
    left: 50%;
    top: 46%;
    z-index: 0;
    width: min(520px, 92%);
    height: min(420px, 72%);
    border-radius: 50%;
    background:
        radial-gradient(ellipse at center, rgba(222, 36, 47, 0.22) 0%, rgba(222, 36, 47, 0.06) 42%, transparent 72%);
    filter: blur(28px);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-grid,
body:not(.dashboard-app-body) .membership-section--coverflow .membership-cards {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    transform-style: preserve-3d;
    grid-template-columns: none !important;
    gap: 0 !important;
    scroll-snap-type: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Base card in stack */
body:not(.dashboard-app-body) .membership-section--coverflow .membership-card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(var(--membership-stack-card-width), calc(100% - 40px));
    max-width: 360px;
    min-height: 200px;
    margin: 0 !important;
    padding: clamp(22px, 4vw, 32px) !important;
    border-radius: var(--membership-stack-card-radius) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: rgba(10, 8, 14, 0.52) !important;
    backdrop-filter: blur(22px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, opacity, filter;
    z-index: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    filter: blur(3px);
    transition:
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.45s ease,
        filter 0.45s ease,
        box-shadow 0.5s ease,
        border-color 0.45s ease,
        background 0.45s ease !important;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-card::before {
    display: block !important;
    content: "" !important;
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14) 0%, transparent 42%, rgba(222, 36, 47, 0.06) 100%) !important;
    opacity: 0.5 !important;
    pointer-events: none;
}

/* Stack positions via data-stack-offset (set by JS) */
body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="0"] {
    z-index: 10;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto;
    cursor: default;
    min-height: 280px;
    transform: translate3d(-50%, -50%, var(--membership-stack-active-z)) rotateY(0deg) scale(1) !important;
    border-color: rgba(222, 36, 47, 0.65) !important;
    background: rgba(18, 8, 12, 0.62) !important;
    box-shadow:
        inset 0 0 0 1px rgba(222, 36, 47, 0.35),
        inset 0 0 48px rgba(222, 36, 47, 0.12),
        var(--membership-stack-glow-red) !important;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-card.membership-card--gold[data-stack-offset="0"] {
    border-color: rgba(212, 175, 55, 0.75) !important;
    background: linear-gradient(165deg, rgba(212, 175, 55, 0.14) 0%, rgba(12, 10, 8, 0.55) 55%, rgba(8, 6, 4, 0.45) 100%) !important;
    box-shadow:
        inset 0 0 0 1px rgba(212, 175, 55, 0.4),
        inset 0 0 40px rgba(212, 175, 55, 0.1),
        var(--membership-stack-glow-gold) !important;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="-1"] {
    z-index: 6;
    opacity: var(--membership-stack-side-opacity) !important;
    filter: blur(1px) !important;
    pointer-events: auto;
    transform: translate3d(calc(-50% - var(--membership-stack-shift-x)), -50%, var(--membership-stack-side-z)) rotateY(var(--membership-stack-side-rotate)) scale(var(--membership-stack-side-scale)) !important;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="1"] {
    z-index: 6;
    opacity: var(--membership-stack-side-opacity) !important;
    filter: blur(1px) !important;
    pointer-events: auto;
    transform: translate3d(calc(-50% + var(--membership-stack-shift-x)), -50%, var(--membership-stack-side-z)) rotateY(calc(var(--membership-stack-side-rotate) * -1)) scale(var(--membership-stack-side-scale)) !important;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="-2"] {
    z-index: 3;
    opacity: var(--membership-stack-far-opacity) !important;
    filter: blur(var(--membership-stack-inactive-blur)) !important;
    pointer-events: auto;
    transform: translate3d(calc(-50% - var(--membership-stack-shift-far)), -50%, var(--membership-stack-far-z)) rotateY(var(--membership-stack-far-rotate)) scale(var(--membership-stack-far-scale)) !important;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="2"] {
    z-index: 3;
    opacity: var(--membership-stack-far-opacity) !important;
    filter: blur(var(--membership-stack-inactive-blur)) !important;
    pointer-events: auto;
    transform: translate3d(calc(-50% + var(--membership-stack-shift-far)), -50%, var(--membership-stack-far-z)) rotateY(calc(var(--membership-stack-far-rotate) * -1)) scale(var(--membership-stack-far-scale)) !important;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="-3"],
body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="3"] {
    z-index: 1;
    opacity: 0 !important;
    pointer-events: none;
    transform: translate3d(-50%, -50%, -120px) rotateY(0deg) scale(0.7) !important;
}

/* Peek: hide detail on side cards */
body:not(.dashboard-app-body) .membership-section--coverflow .membership-card:not([data-stack-offset="0"]) .membership-card-text,
body:not(.dashboard-app-body) .membership-section--coverflow .membership-card:not([data-stack-offset="0"]) .membership-features,
body:not(.dashboard-app-body) .membership-section--coverflow .membership-card:not([data-stack-offset="0"]) .membership-card-ribbon {
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-card:not([data-stack-offset="0"]) .membership-card-title {
    font-size: var(--membership-card-title-size-mobile, var(--membership-card-title-size, 20px)) !important;
    margin-bottom: 8px;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-card:not([data-stack-offset="0"]) .membership-price {
    font-size: clamp(28px, 6vw, 34px);
}

/* Nav arrows */
body:not(.dashboard-app-body) .membership-stack-nav {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-light);
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

body:not(.dashboard-app-body) .membership-stack-nav:hover {
    background: rgba(222, 36, 47, 0.2);
    border-color: rgba(222, 36, 47, 0.55);
    transform: scale(1.06);
}

body:not(.dashboard-app-body) .membership-stack-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

body:not(.dashboard-app-body) .membership-stack-nav-icon {
    display: block;
    width: 12px;
    height: 12px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

body:not(.dashboard-app-body) .membership-stack-nav--prev .membership-stack-nav-icon {
    transform: rotate(-135deg);
    margin-left: 4px;
}

body:not(.dashboard-app-body) .membership-stack-nav--next .membership-stack-nav-icon {
    transform: rotate(45deg);
    margin-right: 4px;
}

body:not(.dashboard-app-body) .membership-section--coverflow .membership-dots {
    position: relative;
    z-index: 12;
    margin-top: 4px;
}

@media (max-width: 760px) {
    body:not(.dashboard-app-body) .membership-section--coverflow .membership-stack-wrap {
        gap: 4px;
        max-width: 100%;
    }

    body:not(.dashboard-app-body) .membership-section--coverflow .membership-stack-stage {
        min-height: var(--membership-stack-stage-min-height-mobile);
        padding: 16px 0 20px;
    }

    body:not(.dashboard-app-body) .membership-stack-nav {
        width: 42px;
        height: 42px;
    }

    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="0"] {
        min-height: 300px;
        width: min(var(--membership-stack-card-width), calc(100vw - 88px));
    }

    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="-1"] {
        transform: translate3d(calc(-50% - var(--membership-stack-shift-x-mobile)), -50%, var(--membership-stack-side-z)) rotateY(var(--membership-stack-side-rotate)) scale(var(--membership-stack-side-scale)) !important;
    }

    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="1"] {
        transform: translate3d(calc(-50% + var(--membership-stack-shift-x-mobile)), -50%, var(--membership-stack-side-z)) rotateY(calc(var(--membership-stack-side-rotate) * -1)) scale(var(--membership-stack-side-scale)) !important;
    }

    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="-2"] {
        transform: translate3d(calc(-50% - var(--membership-stack-shift-far-mobile)), -50%, var(--membership-stack-far-z)) rotateY(var(--membership-stack-far-rotate)) scale(var(--membership-stack-far-scale)) !important;
    }

    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="2"] {
        transform: translate3d(calc(-50% + var(--membership-stack-shift-far-mobile)), -50%, var(--membership-stack-far-z)) rotateY(calc(var(--membership-stack-far-rotate) * -1)) scale(var(--membership-stack-far-scale)) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card {
        transition-duration: 0.15s !important;
    }

    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="-1"],
    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="1"],
    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="-2"],
    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="2"] {
        transform: translate3d(-50%, -50%, 0) rotateY(0deg) scale(0.92) !important;
        filter: none !important;
    }

    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card:not([data-stack-offset="0"]) {
        opacity: 0.4 !important;
    }
}

/* Override premium-layout mobile kill-switch */
@media (max-width: 760px) {
    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset] {
        box-shadow:
            0 16px 40px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    }

    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card[data-stack-offset="0"] {
        transform: translate3d(-50%, -50%, var(--membership-stack-active-z)) rotateY(0deg) scale(1) !important;
    }

    body:not(.dashboard-app-body) .membership-section--coverflow .membership-card:not([data-stack-offset="0"]) {
        background: rgba(10, 8, 14, 0.48) !important;
    }
}
