/* CAMP LARRY — TikTok-style swipe view (swipe.css)
   Full-screen product feed for phones and tablets. Works together with the
   existing classic view: body.swipe-mode hides the hero / grid / footer and
   shows #swipeFeed. The floating cart, product modal and cart drawer from
   the classic view keep working on top of the feed. */

#swipeFeed {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: #000;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

body.swipe-mode #swipeFeed {
    display: block;
}

body.swipe-mode #heroSection,
body.swipe-mode #productsSection,
body.swipe-mode .footer,
body.swipe-mode #promoPopup {
    display: none !important;
}

/* One product per screen */
.swipe-slide {
    position: relative;
    width: 100%;
    /* One screen per slide: the dynamic viewport height, so each slide
       is always exactly one screen tall even when the phone's address
       bar hides or shows and the visible height changes. Using 100% of
       the feed left a gap when the bar hid — the feed grew but the
       slides stayed at the old height, so the next slide (or black)
       showed through between slides: the ghost images. dvh tracks the
       live viewport, so the slide and the feed always match. svh is the
       fallback for browsers without dvh. */
    height: 100svh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    background: #000;
}

/* Left/right through a product's photos and video */
.swipe-media {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.swipe-media::-webkit-scrollbar {
    display: none;
}
.swipe-media-item {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
.swipe-media-item img,
.swipe-media-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.swipe-media-item video {
    object-fit: cover;
}

/* Video loading spinner: shown over the poster while the video is still
   buffering, so it is clear the video is coming instead of just sitting
   on the still photo. Hidden the moment the video can play. */
.swipe-video-loading {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
}
.swipe-video-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: swipe-spin 0.8s linear infinite;
}
@keyframes swipe-spin {
    to { transform: rotate(360deg); }
}

/* Dots for the photo strip */
.swipe-dots {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 6;
}
.swipe-dot {
    width: 22px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    padding: 0;
    cursor: pointer;
}
.swipe-dot.active {
    background: #fff;
}

/* Prev / next photo arrows — raised to sit just above the bottom info
   panel (Details / Add to Basket), clear of the WhatsApp button on the
   right rail. The panel is at most ~246px tall, the WhatsApp button sits
   353–405px from the bottom, so 270px clears both on any phone height. */
.swipe-arrow {
    position: absolute;
    bottom: calc(270px + env(safe-area-inset-bottom, 0px));
    top: auto;
    transform: none;
    z-index: 6;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.swipe-arrow.prev { left: 10px; }
.swipe-arrow.next { right: 10px; }

/* Mute button for videos */
.swipe-mute {
    position: absolute;
    top: 122px;
    right: 12px;
    z-index: 6;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product counter, e.g. 3 / 62 */
.swipe-counter {
    position: absolute;
    top: 84px;
    right: 12px;
    z-index: 6;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.45);
    padding: 5px 10px;
    border-radius: 20px;
}
.swipe-slide.has-video .swipe-counter {
    top: 84px;
}

/* Bottom info panel */
.swipe-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    padding: 18px 16px calc(38px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 60%, transparent 100%);
    color: #fff;
}
.swipe-name {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 6px;
    /* Keep long names clear of the share button on the right rail. */
    padding-right: 70px;
}
.swipe-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    /* Keep the price clear of the share button on the right rail. */
    padding-right: 70px;
}
.swipe-price {
    font-size: 24px;
    font-weight: 900;
    color: #ffd60a;
}
.swipe-was-price {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: line-through;
}
.swipe-delivery {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: #7dff9b;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(125, 255, 155, 0.5);
    padding: 3px 8px;
    border-radius: 20px;
}
/* Product like (heart) with the count underneath it */
/* Like (heart) on the right side, above the music disc, the same size
   as the disc (52px circle), with the count underneath it. */
.swipe-like {
    position: absolute;
    right: 14px;
    bottom: calc(264px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 6;
}
.swipe-like-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.9);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.swipe-like-btn.liked {
    color: #ff2d55;
}
.swipe-like-count {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* Two-tap action buttons on the right rail, above the heart: WhatsApp
   (green) and JAR Holidays (logo). Same 52px circle as the disc/heart. */
.swipe-action-btn {
    position: absolute;
    right: 14px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
}
.swipe-wa-btn {
    bottom: calc(353px + env(safe-area-inset-bottom, 0px));
    background: #25d366;
}
.swipe-jar-btn {
    bottom: calc(417px + env(safe-area-inset-bottom, 0px));
    background-color: #7d9ec4;
    background-image: url('image/jar-holidays-logo.jpg');
    background-size: cover;
    background-position: center;
}
/* Share button on the right rail, underneath the music disc: the same
   52px circle. Tap it to share this product's special link. */
.swipe-share-btn {
    bottom: calc(136px + env(safe-area-inset-bottom, 0px));
    background: rgba(0, 0, 0, 0.45);
}
/* Share menu (shown when there is no native share sheet, e.g. desktop):
   Facebook / WhatsApp / copy link for this product. */
.swipe-share-menu {
    position: absolute;
    right: 76px;
    bottom: calc(136px + env(safe-area-inset-bottom, 0px));
    display: none;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 6px;
    z-index: 7;
    min-width: 130px;
}
.swipe-share-menu.show {
    display: flex;
}
.swipe-share-opt {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}
.swipe-share-opt:hover {
    background: rgba(255, 255, 255, 0.15);
}
/* Two-tap prompt: a small dark bubble to the left of its button, shown
   on the first tap. It fades out after a few seconds, or when the
   visitor swipes to another product. */
.swipe-action-pop {
    position: absolute;
    right: 76px;
    max-width: 68%;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    border-radius: 12px;
    padding: 9px 13px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 6;
}
.swipe-action-pop.show {
    opacity: 1;
    transform: translateX(0);
}
.swipe-wa-pop { bottom: calc(359px + env(safe-area-inset-bottom, 0px)); }
.swipe-jar-pop { bottom: calc(423px + env(safe-area-inset-bottom, 0px)); }

/* On a grid slide, hide every button — just the images, prices and titles. */
body.on-grid-slide #swipeViewToggle,
body.on-grid-slide #floatingCart {
    display: none;
}

/* Product grid slide (every 5 products): 2 columns x 3 rows of random
   products, nothing else on it — no buttons, just the six products.
   A tile with a video plays it; a tile with photos shows its image. */
.swipe-grid-slide {
    background: #000;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}
.swipe-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, 1fr);
    gap: 0;
    min-height: 0;
}
.swipe-grid-tile {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    overflow: hidden;
    background: #111;
    cursor: pointer;
    text-align: left;
}
.swipe-grid-media {
    position: absolute;
    inset: 0;
}
.swipe-grid-media video,
.swipe-grid-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.swipe-grid-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding: 18px 8px 7px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.45) 60%, transparent 100%);
    color: #fff;
    z-index: 2;
}
.swipe-grid-name {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.swipe-grid-price {
    font-size: 12px;
    font-weight: 800;
    color: #ffd60a;
    white-space: nowrap;
}
.swipe-desc {
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Keep the description clear of the share button on the right rail. */
    padding-right: 70px;
}
.swipe-actions {
    display: flex;
    gap: 10px;
}
.swipe-add-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 800;
    color: #111;
    background: #ffd60a;
    cursor: pointer;
}
.swipe-add-btn:active {
    transform: scale(0.98);
}
.swipe-add-btn:disabled {
    opacity: 0.5;
    cursor: default;
}
.swipe-details-btn {
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

/* One floating view button, always in the same top-left spot in both views.
   In swipe mode it offers Classic view (white); in classic mode it offers
   Swipe view (yellow) so you can always get back. */
.swipe-view-toggle {
    position: fixed;
    top: 14px;
    left: 12px;
    z-index: 45;
    border: none;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #111;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    display: block;
}
.swipe-view-toggle.to-swipe {
    background: #ffd60a;
}

/* Little "Added to basket" toast */
.swipe-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%) translateY(20px);
    z-index: 90;
    background: #1db954;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    white-space: nowrap;
}
.swipe-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mini cart popup - small card that drops in just above the Add to Basket /
   Details buttons when an item is added. It never opens the full basket
   and never dims or blocks the feed. */
.swipe-mini-cart {
    position: fixed;
    left: 50%;
    bottom: calc(108px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%) translateY(12px);
    z-index: 90;
    width: min(340px, calc(100vw - 32px));
    background: #fff;
    color: #111;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    padding: 14px 16px 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}
.swipe-mini-cart.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.swipe-mini-cart-close {
    position: absolute;
    top: 6px;
    right: 10px;
    border: none;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 4px;
}
.swipe-mini-cart-item {
    font-size: 15px;
    font-weight: 700;
    padding-right: 24px;
}
.swipe-mini-cart-total {
    font-size: 13px;
    color: #555;
    margin-top: 4px;
}
.swipe-mini-cart-view {
    margin-top: 10px;
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 15px;
    font-weight: 800;
    color: #111;
    background: #ffd60a;
    cursor: pointer;
}

/* Keep the floating cart above the feed */
body.swipe-mode #floatingCart {
    z-index: 50;
}

/* Image lightbox — tap a photo for a closer look */
.swipe-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.96);
    display: none;
    align-items: center;
    justify-content: center;
}
.swipe-lightbox.open {
    display: flex;
}
.swipe-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.swipe-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animated intro slide — the old landing page, first in the feed */
.swipe-intro-slide {
    background: linear-gradient(160deg, #7b2ff7 0%, #c026d3 35%, #ec4899 65%, #fb923c 100%);
    overflow: hidden;
}
.swipe-intro-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.swipe-bubble {
    position: absolute;
    bottom: -25%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    animation: swipe-bubble-rise linear infinite;
}
@keyframes swipe-bubble-rise {
    0% { transform: translateY(0); }
    100% { transform: translateY(-140vh); }
}
.swipe-intro-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 24px calc(44px + env(safe-area-inset-bottom, 0px));
    gap: 18px;
}
.swipe-intro-title {
    color: #fff;
    font-size: 3.4rem;
    line-height: 0.95;
    font-weight: 900;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
    margin: 0;
}
.swipe-intro-title span {
    color: #ffd60a;
}
.swipe-intro-tag {
    color: #fff;
    font-size: 1.15rem;
    margin: 0;
}
.swipe-intro-up {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 700;
    opacity: 0;
    animation: swipe-up-in 0.8s ease 2.5s forwards, swipe-up-bob 1.6s ease-in-out 3.3s infinite;
}
.swipe-intro-chevron {
    display: block;
    width: 24px;
    height: 24px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(-135deg);
}
/* Left/right gallery hint under the "Swipe up to shop" line — fades in
   just after it, with a gentle side-to-side sway. */
.swipe-intro-gallery {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0;
    animation: swipe-up-in 0.8s ease 3.5s forwards, swipe-side-sway 1.8s ease-in-out 4.3s infinite;
}
.swipe-intro-gallery .swipe-intro-chevron {
    width: 14px;
    height: 14px;
    border-width: 0 2px 2px 0;
}
.swipe-intro-chevron-left { transform: rotate(135deg); }
.swipe-intro-chevron-right { transform: rotate(-45deg); }
@keyframes swipe-side-sway {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}
@keyframes swipe-up-in {
    to { opacity: 1; }
}
@keyframes swipe-up-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

/* ---------- product song (admin-chosen track, no-video products) ---------- */
.swipe-disc {
    position: absolute;
    right: 14px;
    bottom: calc(200px + env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: #111;
    padding: 0;
    cursor: pointer;
    z-index: 6;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}
.swipe-disc-cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    background-color: #333;
}
.swipe-disc-hole {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: #111;
    border: 2px solid rgba(255, 255, 255, 0.9);
    z-index: 2;
}
.swipe-disc.playing {
    animation: swipe-disc-spin 3s linear infinite;
}
@keyframes swipe-disc-spin {
    to { transform: rotate(360deg); }
}
.swipe-song {
    position: absolute;
    right: 76px;
    bottom: calc(206px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
    max-width: 65%;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 6;
}
.swipe-song.show {
    opacity: 1;
    transform: translateX(0);
}
.swipe-song-cover {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #333;
    flex: 0 0 30px;
}
.swipe-song-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* One-time "tap for sound" prompt: a pill above the action buttons until
   the first tap unlocks sound. It sits above the product info panel, not
   on top of it — at 168px it covered the product name. */
#swipeSoundPrompt {
    position: fixed;
    left: 50%;
    bottom: calc(252px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 7;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.94);
    color: #111;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}
