/* =====================================================================
   UKShrimp Tank View - full-screen vertical video feed
   Loaded only on the home page with ?tank_view=1 (see layout.phtml).
   ===================================================================== */

html.uks-tv-open,
html.uks-tv-open body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #000 !important;
    overscroll-behavior: none;
}

.uks-tv {
    --tv-accent: #1f5fd1;          /* UKShrimp blue */
    --tv-accent-2: #ff7a5c;        /* cherry shrimp */
    --tv-glass: rgba(255, 255, 255, .16);
    --tv-glass-line: rgba(255, 255, 255, .22);
    --tv-safe-top: env(safe-area-inset-top, 0px);
    --tv-safe-bottom: env(safe-area-inset-bottom, 0px);
    position: fixed;
    inset: 0;
    z-index: 1040;                 /* under Bootstrap modals (1055) so Add to Cart pop-ups still show */
    background: #000;
    color: #fff;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
.uks-tv a { color: inherit; text-decoration: none; }
.uks-tv button { font-family: inherit; }

/* ---------- top bar ---------- */
.uks-tv-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    box-sizing: border-box;
    padding: calc(var(--tv-safe-top) + 8px) 14px 8px 16px;
    background: rgba(5, 9, 12, .86);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    pointer-events: none;
}
.uks-tv-bar > * { pointer-events: auto; }
.uks-tv-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    height: 40px;
}
.uks-tv-logo {
    display: block;
    width: auto;
    max-width: min(44vw, 210px);
    max-height: 34px;
    object-fit: contain;
    object-position: left center;
}
.uks-tv-bar-actions { display: flex; gap: 8px; }
.uks-tv-round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.uks-tv-round:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.uks-tv-sound[aria-pressed="true"] { background: var(--tv-accent); }

/* ---------- vertical scroller ---------- */
.uks-tv-scroller {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    outline: none;
}
.uks-tv-scroller::-webkit-scrollbar { display: none; }

.uks-tv-slide {
    position: relative;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

/* blurred copy of the photo behind the video (fills the sides on wide screens) */
.uks-tv-bg {
    position: absolute;
    inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(34px) brightness(.42) saturate(1.2);
    transform: scale(1.1);
}

/* ---------- the video column ---------- */
.uks-tv-stage {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}
.uks-tv-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    display: block;
}
.uks-tv-slide.is-landscape .uks-tv-video { object-fit: contain; }
.uks-tv-slide.is-landscape .uks-tv-stage,
.uks-tv-slide.is-landscape .uks-tv-video { background: transparent; }

/* tap anywhere on the video to pause / play */
.uks-tv-tap {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.uks-tv-playicon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    padding-left: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .42);
    opacity: 0;
    transform: scale(.85);
    transition: opacity .18s ease, transform .18s ease;
}
.uks-tv-slide.is-paused .uks-tv-playicon { opacity: 1; transform: scale(1); }

/* loading spinner while a clip buffers */
.uks-tv-slide.is-loading .uks-tv-tap::after {
    content: "";
    position: absolute;
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: uks-tv-spin .8s linear infinite;
}
@keyframes uks-tv-spin { to { transform: rotate(360deg); } }

/* "Filmed today" badge, under the top bar, on the video */
.uks-tv .uks-tv-badge {
    position: absolute;
    top: calc(var(--tv-safe-top) + 74px);
    left: 16px;
    bottom: auto;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .58);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    pointer-events: none;
}
.uks-tv .uks-tv-badge.vf-tier-today { background: #e0452b; }
.uks-tv .uks-tv-badge.vf-tier-week { background: #15803d; }

/* ---------- right-hand action rail ---------- */
.uks-tv-rail {
    position: absolute;
    right: 10px;
    bottom: calc(var(--tv-safe-bottom) + 150px);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
.uks-tv-act {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 52px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
    cursor: pointer;
}
.uks-tv-act svg {
    box-sizing: content-box;
    padding: 11px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .38);
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .35));
    transition: transform .15s ease, background .15s ease;
}
.uks-tv-act:hover svg { background: rgba(0, 0, 0, .58); }
.uks-tv-act:active svg { transform: scale(.9); }
.uks-tv-like.is-on svg { color: #ff4d5e; }
.uks-tv-like.is-off svg { color: #fff; }

/* ---------- caption + buy buttons ---------- */
.uks-tv-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    padding: 90px 80px calc(var(--tv-safe-bottom) + 22px) 18px;
    background: linear-gradient(0deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .62) 45%, transparent 100%);
    pointer-events: none;      /* taps on the gradient still pause/play the video */
}
.uks-tv-info a,
.uks-tv-info button { pointer-events: auto; }
.uks-tv-seller { font-size: 14px; color: rgba(255, 255, 255, .82); margin-bottom: 4px; }
.uks-tv-name {
    margin: 0 0 3px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: #fff;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.uks-tv-name a:hover { text-decoration: underline; }
.uks-tv-sub { font-size: 15px; font-style: italic; color: rgba(255, 255, 255, .78); }
.uks-tv-price { margin-top: 8px; font-size: 26px; font-weight: 800; line-height: 1.1; color: #fff; }
.uks-tv-price * { color: inherit !important; }
.uks-tv-buttons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    margin-right: -62px;       /* buttons run full width, under the rail */
}
.uks-tv-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}
.uks-tv .uks-tv-btn-buy { background: var(--tv-accent); color: #fff; }
.uks-tv .uks-tv-btn-buy:hover { background: #184fb0; color: #fff; }
.uks-tv .uks-tv-btn-view {
    background: var(--tv-glass);
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--tv-glass-line);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.uks-tv .uks-tv-btn-view:hover { background: rgba(255, 255, 255, .26); color: #fff; }

/* playback progress along the bottom edge */
.uks-tv-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    height: 3px;
    background: rgba(255, 255, 255, .18);
    pointer-events: none;
}
.uks-tv-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
}

/* ---------- end card ---------- */
.uks-tv-end { background: radial-gradient(circle at 50% 35%, #12304f 0%, #04080d 70%); }
.uks-tv-end-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: min(88vw, 380px);
    text-align: center;
}
.uks-tv-end-title { font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.uks-tv-end p { margin: 0 0 8px; color: rgba(255, 255, 255, .78); line-height: 1.5; }
.uks-tv-end .uks-tv-btn { flex: none; }
.uks-tv-again {
    margin-top: 4px;
    padding: 10px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .8);
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- hint + toast ---------- */
.uks-tv-hint {
    position: absolute;
    left: 50%;
    bottom: calc(var(--tv-safe-bottom) + 34%);
    z-index: 15;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transform: translateX(-50%);
    pointer-events: none;
    animation: uks-tv-nudge 1.6s ease-in-out 3;
    transition: opacity .35s ease;
}
.uks-tv-hint.is-hidden { opacity: 0; }
.uks-tv-hint-mouse { display: none; }
@keyframes uks-tv-nudge {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -10px); }
}
.uks-tv-toast {
    position: absolute;
    left: 50%;
    bottom: calc(var(--tv-safe-bottom) + 40px);
    z-index: 30;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .95);
    color: #111;
    font-size: 14px;
    font-weight: 600;
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.uks-tv-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- desktop / tablet: centred 9:16 column, actions beside it ---------- */
@media (min-width: 768px) {
    .uks-tv-stage {
        height: calc(100% - 32px);
        width: auto;
        aspect-ratio: 9 / 16;
        max-width: calc(100vw - 200px);
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
        overflow: visible;     /* lets the action rail sit outside the column */
    }
    .uks-tv-video,
    .uks-tv-tap { border-radius: 16px; }
    .uks-tv-info {
        padding-right: 18px;
        border-radius: 0 0 16px 16px;
    }
    .uks-tv-buttons { margin-right: 0; }
    .uks-tv-progress { left: 12px; right: 12px; bottom: 6px; border-radius: 3px; overflow: hidden; }
    .uks-tv-rail {
        right: auto;
        left: calc(100% + 18px);
        bottom: 24px;
    }
    .uks-tv-act { color: #fff; }
    .uks-tv-act svg { background: rgba(255, 255, 255, .14); }
    .uks-tv-act:hover svg { background: rgba(255, 255, 255, .26); }
    .uks-tv .uks-tv-badge { top: 16px; left: 16px; }
    .uks-tv-bar { padding: 16px 22px 30px 26px; background: none; }
    .uks-tv-hint-touch { display: none; }
    .uks-tv-hint-mouse { display: inline; }
    .uks-tv-hint { bottom: 50%; left: calc(50% + min(28vh, 260px) + 120px); animation: none; }
}
@media (min-width: 768px) and (max-height: 620px) {
    .uks-tv-name { font-size: 18px; }
    .uks-tv-price { font-size: 20px; }
    .uks-tv-btn { min-height: 42px; font-size: 14px; }
}

/* small phones */
@media (max-width: 380px) {
    .uks-tv-name { font-size: 19px; }
    .uks-tv-price { font-size: 22px; }
    .uks-tv-btn { font-size: 15px; min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
    .uks-tv-hint { animation: none; }
    .uks-tv-playicon, .uks-tv-toast, .uks-tv-act svg { transition: none; }
}
