/* Homepage "Swap Deck" — animated card stack so the page feels alive.
   Renders below the hero, above the company-logos strip. Pure CSS animations
   for tilt + drop shadow; JS handles auto-advance and arrow controls. */

.live-items-deck {
    position: relative;
    padding: 90px 0 110px;
    background: #ffffff;
    overflow: hidden;
}

.live-items-deck .lid-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

/* ── Left copy column ─────────────────────────────────────────────────── */
.live-items-deck .lid-copy {
    max-width: 520px;
}

.live-items-deck .lid-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #ff0074;
    margin-bottom: 18px;
}

.live-items-deck .lid-title {
    font-family: 'GilroyExtraBold', 'Arial', sans-serif;
    font-size: 46px;
    line-height: 1.05;
    color: #2a2a2a;
    margin: 0 0 18px;
    letter-spacing: -0.01em;
}
.live-items-deck .lid-title em {
    font-style: italic;
    font-weight: inherit;
    color: #ff0074;
}

.live-items-deck .lid-sub {
    font-size: 17px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 28px;
}

.live-items-deck .lid-cta-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* The .started-btn pattern from home.css is reused; only sizing tweaks. */
.live-items-deck .lid-cta-btn a {
    width: 220px;
    line-height: 60px;
    font-size: 18px;
    border-radius: 6px;
}

/* ── Right deck stage ─────────────────────────────────────────────────── */
.live-items-deck .lid-stage {
    position: relative;
    height: 580px;
    perspective: 1400px;
}

.live-items-deck .lid-deck {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

/* Each card occupies the same absolute slot; we drive its position via the
   --stack-pos custom property (0 = on top, 1..4 = behind, -1 = leaving). */
.live-items-deck .lid-card {
    --stack-pos: 99;
    --tilt: 0deg;
    position: absolute;
    top: 0;
    left: 50%;
    width: 320px;
    margin-left: -160px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(20, 20, 20, 0.04),
        0 18px 44px -16px rgba(20, 20, 20, 0.20);
    transform-origin: 50% 100%;
    transform:
        translateY(calc(var(--stack-pos) * 22px))
        translateX(calc(var(--stack-pos) * -12px))
        rotate(calc(var(--tilt) + (var(--stack-pos) * 2.4deg)))
        scale(calc(1 - var(--stack-pos) * 0.035));
    opacity: 1;
    z-index: calc(50 - var(--stack-pos));
    transition:
        transform 0.55s cubic-bezier(.22, 1, .36, 1),
        opacity 0.4s ease;
    pointer-events: none;
}
.live-items-deck .lid-card[data-stack-pos="0"] { pointer-events: auto; }

/* Hide cards that are deeper than the visible 5. */
.live-items-deck .lid-card[data-stack-pos="5"],
.live-items-deck .lid-card[data-stack-pos="6"],
.live-items-deck .lid-card[data-stack-pos="7"],
.live-items-deck .lid-card[data-stack-pos="8"],
.live-items-deck .lid-card[data-stack-pos="9"],
.live-items-deck .lid-card[data-stack-pos="10"],
.live-items-deck .lid-card[data-stack-pos="11"],
.live-items-deck .lid-card[data-stack-pos="12"],
.live-items-deck .lid-card[data-stack-pos="13"],
.live-items-deck .lid-card[data-stack-pos="14"],
.live-items-deck .lid-card[data-stack-pos="15"],
.live-items-deck .lid-card[data-stack-pos="16"],
.live-items-deck .lid-card[data-stack-pos="17"],
.live-items-deck .lid-card[data-stack-pos="18"],
.live-items-deck .lid-card[data-stack-pos="19"] {
    opacity: 0;
    transform:
        translateY(110px)
        translateX(calc(var(--stack-pos) * -12px))
        rotate(calc(var(--tilt) + 8deg))
        scale(0.9);
}

/* The "leaving" card on top: flick up + rotate + fade. */
.live-items-deck .lid-card[data-stack-pos="-1"] {
    opacity: 0;
    transform:
        translateY(-160px)
        translateX(60px)
        rotate(calc(var(--tilt) + 18deg))
        scale(1.04);
    transition:
        transform 0.55s cubic-bezier(.55, .055, .675, .19),
        opacity 0.4s ease 0.05s;
}

/* ── Card internals ───────────────────────────────────────────────────── */
.live-items-deck .lid-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f6f1ee;
}
.live-items-deck .lid-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.live-items-deck .lid-card-meta {
    padding: 16px 18px 18px;
}

.live-items-deck .lid-card-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 8px;
}
.live-items-deck .lid-star {
    color: #d8d2cd;
    font-size: 16px;
    letter-spacing: 0.5px;
}
.live-items-deck .lid-star-full,
.live-items-deck .lid-star-half {
    color: #f5a623;
}
.live-items-deck .lid-star-half {
    background: linear-gradient(90deg, #f5a623 50%, #d8d2cd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.live-items-deck .lid-card-rating-num {
    color: #555;
    font-weight: 600;
}

.live-items-deck .lid-card-name {
    font-family: 'GilroyExtraBold', 'Arial', sans-serif;
    font-size: 18px;
    color: #2a2a2a;
    line-height: 1.25;
    margin-bottom: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.live-items-deck .lid-card-seller {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #555;
    font-size: 14px;
}
.live-items-deck .lid-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background-size: cover;
    background-position: center;
    background-color: #ddd;
    flex: 0 0 auto;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(20, 20, 20, 0.18);
}
.live-items-deck .lid-card-seller-name {
    font-weight: 400;
}
.live-items-deck .lid-card-seller-name strong {
    color: #2a2a2a;
    font-weight: 600;
}

/* ── Arrow controls ───────────────────────────────────────────────────── */
.live-items-deck .lid-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid #ebe3dc;
    background: #fff;
    color: #2a2a2a;
    cursor: pointer;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px -6px rgba(20, 20, 20, 0.18);
    transition: transform .18s ease, background-color .18s ease, color .18s ease;
}
.live-items-deck .lid-arrow:hover {
    background: #ff0074;
    color: #fff;
    border-color: #ff0074;
    transform: translateY(-50%) scale(1.06);
}
.live-items-deck .lid-arrow-prev { left: -8px; }
.live-items-deck .lid-arrow-next { right: -8px; }

/* ── Mobile / narrow ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .live-items-deck { padding: 60px 0 80px; }
    .live-items-deck .lid-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .live-items-deck .lid-copy { max-width: 100%; text-align: center; margin: 0 auto; }
    .live-items-deck .lid-cta-row { justify-content: center; }
    .live-items-deck .lid-title { font-size: 34px; }
    .live-items-deck .lid-stage { height: 500px; }
    .live-items-deck .lid-card { width: 280px; margin-left: -140px; }
    .live-items-deck .lid-arrow-prev { left: 6px; }
    .live-items-deck .lid-arrow-next { right: 6px; }
}

@media (max-width: 480px) {
    .live-items-deck .lid-card { width: 240px; margin-left: -120px; }
    .live-items-deck .lid-stage { height: 460px; }
    .live-items-deck .lid-arrow { width: 38px; height: 38px; }
}

/* Respect reduced-motion. */
@media (prefers-reduced-motion: reduce) {
    .live-items-deck .lid-card { transition: none; }
}
