/* Shopable Reels for Elementor — frontend v1.2 */

.srfe-wrap { width: 100%; }

/* ---- Grid strip ---- */
.srfe-strip {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 6px 4px 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.srfe-strip::-webkit-scrollbar { display: none; }

.srfe-tile {
    position: relative;
    flex: 0 0 auto;
    width: 240px;
    aspect-ratio: 9 / 16;            /* slightly taller as requested */
    border: 0; padding: 0; margin: 0;
    background: #000;
    cursor: pointer;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,.10);
    scroll-snap-align: start;
    transition: transform .25s ease, box-shadow .25s ease;
}
.srfe-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.15); }
.srfe-tile video,
.srfe-tile .srfe-tile-thumb {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.srfe-tile .srfe-tile-play {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 44px; text-shadow: 0 2px 10px rgba(0,0,0,.5);
    pointer-events: none;
}

/* Floating product card on each grid tile */
.srfe-tile-card {
    position: absolute;
    left: 10px; right: 10px; bottom: 10px;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    background: #fff; color: #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    text-align: left;
}
.srfe-tile-card img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.srfe-tile-card__meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.srfe-tile-card__title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srfe-tile-card__price { font-size: 12px; }
.srfe-tile-card__price del { opacity: .55; margin-left: 4px; font-weight: 400; }

@media (max-width: 600px) {
    .srfe-tile { width: 170px; border-radius: 12px; }
    .srfe-tile-card { left: 8px; right: 8px; bottom: 8px; padding: 6px 8px; }
    .srfe-tile-card img { width: 30px; height: 30px; }
}

/* ============ Full-screen viewer — constrained to 80% page ============ */
.srfe-viewer {
    position: fixed; inset: 0;
    z-index: 100000;
    background: rgba(8, 8, 10, .86);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.srfe-viewer .srfe-close {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.12); color: #fff;
    border: 0; cursor: pointer; font-size: 22px; line-height: 1; z-index: 5;
}
.srfe-viewer .srfe-close:hover { background: rgba(255,255,255,.2); }
.srfe-viewer .srfe-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: #fff; color: #111;
    border: 0; cursor: pointer; font-size: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3); z-index: 5;
}
.srfe-viewer .srfe-prev { left: 18px; }
.srfe-viewer .srfe-next { right: 18px; }

/* Track holds 3 visible slides — active + partial neighbors */
.srfe-track {
    position: relative;
    width: 100%; height: 100%;
}

/* Active slide is capped at 80% of viewport height AND fits within 80% width.
   Aspect ratio kept at 9/16 so it never overflows on tall reels. */
.srfe-slide {
    position: absolute;
    top: 50%; left: 50%;
    height: 80vh;
    max-height: 80vh;
    aspect-ratio: 9 / 16;
    max-width: 80vw;
    transform: translate(-50%, -50%) translateX(0) scale(1);
    opacity: 1;
    transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .45s ease;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,.5);
    will-change: transform, opacity;
}
.srfe-slide video,
.srfe-slide iframe,
.srfe-slide .srfe-slide-thumb {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; display: block; border: 0;
}
.srfe-slide iframe { background: #000; }

/* YouTube wrapper: iframe + transparent shield that fully blocks YT chrome (pause/next/prev). */
.srfe-yt-frame {
    position: absolute; inset: 0;
    overflow: hidden;
    background: #000;
}
.srfe-yt-frame iframe.srfe-yt-iframe {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    /* Oversize so YT's letterbox bars and bottom branding fall outside the visible slide. */
    width: 130%;
    height: 130%;
    border: 0;
    pointer-events: none;
    background: #000;
}
.srfe-yt-shield {
    position: absolute; inset: 0;
    background: transparent;
    z-index: 2;
    pointer-events: auto; /* swallow any tap so YT chrome can never appear */
}

/* Instagram embed: crop profile header + bottom action bar so only the reel shows */
.srfe-ig-frame {
    position: absolute; inset: 0;
    overflow: hidden;
    background: #000;
}
.srfe-ig-frame iframe {
    position: absolute;
    left: 50%;
    top: -100px;            /* hide IG profile header */
    transform: translateX(-50%);
    width: 115%;
    height: calc(100% + 260px); /* push profile header up and like/share bar down off-screen */
    border: 0;
    background: #000;
}

/* One-tap-to-play overlay for IG (Meta blocks programmatic autoplay on /embed/). */
.srfe-ig-tap {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.35);
    z-index: 3;
    cursor: pointer;
}
.srfe-ig-tap__btn {
    width: 72px; height: 72px; border-radius: 50%;
    background: rgba(255,255,255,.92);
    color: #111;
    font-size: 30px; line-height: 72px; text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

/* Position classes */
.srfe-slide.is-prev      { transform: translate(-50%, -50%) translateX(-72%) scale(.78); opacity: .55; z-index: 1; }
.srfe-slide.is-active    { transform: translate(-50%, -50%) translateX(0)    scale(1);   opacity: 1;   z-index: 4; }
.srfe-slide.is-next      { transform: translate(-50%, -50%) translateX(72%)  scale(.78); opacity: .55; z-index: 1; }
.srfe-slide.is-far-prev  { transform: translate(-50%, -50%) translateX(-140%) scale(.6); opacity: 0; z-index: 0; pointer-events: none; }
.srfe-slide.is-far-next  { transform: translate(-50%, -50%) translateX(140%)  scale(.6); opacity: 0; z-index: 0; pointer-events: none; }

.srfe-slide .srfe-mute {
    position: absolute; top: 12px; right: 12px;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(0,0,0,.5); color: #fff;
    border: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 3;
}
.srfe-slide .srfe-play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.15);
    color: #fff; font-size: 48px;
    opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.srfe-slide.is-paused .srfe-play-overlay { opacity: 1; }

/* Floating product card on the active reel */
.srfe-product-card {
    position: absolute;
    left: 14px; right: 14px; bottom: 70px;
    display: flex; align-items: center; gap: 10px;
    background: #fff; color: #1a1a1a;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 10px 24px rgba(0,0,0,.25);
    text-align: left; z-index: 2;
}
.srfe-product-card img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.srfe-product-card__meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.srfe-product-card__title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srfe-product-card__title a { color: inherit; text-decoration: none; }
.srfe-product-card__price { font-size: 13px; }
.srfe-product-card__price del { opacity: .55; margin-left: 6px; font-weight: 400; }

/* CTA — single Add to Cart button only (no wishlist / share in viewer) */
.srfe-cta-row {
    position: absolute;
    left: 14px; right: 14px; bottom: 14px;
    display: flex; gap: 8px; z-index: 2;
}
.srfe-cta {
    flex: 1;
    background: #f1e3c8;
    color: #1a1a1a;
    border: 0; cursor: pointer;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 700; font-size: 14px;
    text-align: center; text-transform: uppercase; letter-spacing: .04em;
    box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.srfe-cta.is-loading { opacity: .7; cursor: wait; }

@media (max-width: 720px) {
    .srfe-slide              { height: 80vh; max-width: 86vw; }
    .srfe-slide.is-prev      { transform: translate(-50%, -50%) translateX(-58%) scale(.55); opacity: .35; }
    .srfe-slide.is-next      { transform: translate(-50%, -50%) translateX(58%)  scale(.55); opacity: .35; }
    .srfe-viewer .srfe-prev  { left: 6px; width: 40px; height: 40px; }
    .srfe-viewer .srfe-next  { right: 6px; width: 40px; height: 40px; }
}

/* Auto-injected section on single product pages */
.srfe-single-product-section {
    margin: 30px 0;
}
.srfe-single-product-section h3 {
    margin-bottom: 14px;
    font-size: 20px; font-weight: 700;
}
