/* =========================================================
   DELEGATION — REELS PAGE
   Full-screen vertical swipe engine (mobile),
   phone-frame preview with blurred backdrop (desktop)
   Consumes --z-reels from style.css so this feed always sits
   below the mini-cart drawer (--z-drawer) but above everything
   else — the drawer must still be able to open on top of reels.
   ========================================================= */

body.delegation-reels-body {
    padding-bottom: 0;
    background: #000;
    overflow: hidden; /* the feed owns its own internal scroll; the body must not also scroll */
}
body.delegation-reels-body .site-header,
body.delegation-reels-body .announcement-bar,
body.delegation-reels-body .mobile-bottom-nav {
    display: none;
}

.reels-page {
    position: fixed;
    inset: 0;
    z-index: var(--z-reels);
    background: #000;
}

.reels-page__backdrop {
    position: absolute;
    inset: 0;
    background: #000;
    display: none;
}

.reels-page__frame {
    position: relative;
    height: 100dvh;
    width: 100%;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

.reels-feed {
    height: 100%;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.reels-feed::-webkit-scrollbar { display: none; }

.reel-slide {
    position: relative;
    height: 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: flex-end;
    background: #0d0d0d;
    background-size: cover;
    background-position: center;
}
.reel-slide--empty { align-items: center; justify-content: center; }
.reel-slide--empty p { color: #fff; }

.reel-slide__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: var(--z-base);
}

.reel-slide__mute-toggle {
    position: absolute;
    top: calc(var(--safe-top) + 16px);
    right: 16px;
    z-index: 2; /* local stacking within the slide only, always below --z-reels of the page itself */
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.reel-slide__overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 24px 20px calc(28px + var(--safe-bottom));
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
    color: #fff;
}

.reel-slide__title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.reel-slide__price { font-weight: 700; color: var(--color-gold); margin-bottom: 16px; }

.reel-slide__actions { display: flex; align-items: center; gap: 12px; }
.reel-slide__buy { flex: 1; min-width: 0; background: var(--color-gold); color: #121212; }
.reel-slide__icon-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reels-page__close {
    position: absolute;
    top: calc(var(--safe-top) + 16px);
    left: 16px;
    z-index: 2;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    line-height: 1;
}

/* =========================================================
   DESKTOP: centered smartphone frame + blurred backdrop
   ========================================================= */
@media (min-width: 900px) {
    .reels-page__backdrop {
        display: block;
        background: radial-gradient(circle at center, #2a2a2a 0%, #050505 80%);
        filter: blur(2px);
    }

    .reels-page__frame {
        display: flex;
        align-items: center;
        justify-content: center;
        padding-top: 0;
        padding-bottom: 0;
    }

    .reels-feed {
        width: 390px;
        height: 844px;
        max-height: 90vh;
        border-radius: 40px;
        box-shadow: 0 30px 80px rgba(0,0,0,0.6);
        border: 8px solid #1a1a1a;
    }

    .reels-page__close {
        top: 24px;
        left: calc(50% - 195px - 60px);
    }
}
