/* ==========================================================================
   LIVE COMMERCE V5 — Whatnot-Inspired Design
   3 columnas: Shop (izq) | Video+Overlay (centro) | Chat (der)
   ========================================================================== */

:root {
    --wn-bg: #f5f5f5;
    --wn-panel: #ffffff;
    --wn-panel2: #f7f7f7;
    --wn-border: #e8e8e8;
    --wn-text: #1a1a1a;
    --wn-text2: #4a4a4a;
    --wn-muted: #8a8a8a;
    --wn-accent: #D4541C;
    --wn-green: #00b853;
    --wn-red: #ff3b30;
    --wn-yellow: #ffdd00;
    --wn-yellow-hover: #f5d400;
    --wn-orange: #ff6d2e;
    --wn-chat-highlight: #ff6d2e;
    --wn-radius: 12px;
    --wn-radius-sm: 8px;
    --wn-radius-pill: 50px;
}

/* ── Reset ── */
.live-page {
    padding: 0;
    margin: -20px 0 0 0;
    background: var(--wn-bg) !important;
    min-height: 100vh;
    color: var(--wn-text) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.live-page *, .live-page *::before, .live-page *::after {
    box-sizing: border-box;
}
.live-page a { color: var(--wn-text); text-decoration: none; font-weight: 600; }
.live-page .product-card,
.live-page .product-card * {
    border-radius: 0;
    box-shadow: none;
}

/* ══════ HEADER ══════ */
.live-header {
    display: none; /* Whatnot style: no separate header bar, info is overlaid on video */
}

/* ══════ LAYOUT 3 COLUMNAS ══════ */
.live-main {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    height: 100vh;
    overflow: hidden;
}

/* ══════ COLUMNA IZQUIERDA: SHOP ══════ */
.live-products-col {
    background: var(--wn-panel);
    border-right: 1px solid var(--wn-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.products-header {
    padding: 16px 16px 12px;
    flex-shrink: 0;
}
.products-header h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--wn-text);
    letter-spacing: -0.01em;
}
.products-header h3 i { display: none; } /* Hide icon, Whatnot just says "Shop" */

/* Search bar */
.products-search-wrap {
    position: relative;
    margin-bottom: 12px;
}
.products-search-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wn-muted);
    font-size: 0.85rem;
}
.products-search {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--wn-panel);
    border: 1.5px solid var(--wn-border);
    border-radius: var(--wn-radius-pill);
    color: var(--wn-text);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}
.products-search::placeholder { color: var(--wn-muted); }
.products-search:focus { border-color: var(--wn-text); }

/* Filter chips — Whatnot style */
.products-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 0;
}
.pfilter {
    padding: 6px 14px;
    border-radius: var(--wn-radius-pill);
    border: 1.5px solid var(--wn-border);
    background: var(--wn-panel);
    color: var(--wn-text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.pfilter:hover { background: var(--wn-panel2); }
.pfilter.active {
    background: var(--wn-text);
    color: #fff;
    border-color: var(--wn-text);
}

/* Products count — Whatnot style */
.products-count {
    padding: 12px 16px 8px;
    font-size: 0.92rem;
    color: var(--wn-text);
    border-top: 1px solid var(--wn-border);
}

/* ── Products list ── */
.products-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.products-list::-webkit-scrollbar { width: 4px; }
.products-list::-webkit-scrollbar-track { background: transparent; }
.products-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

/* Product card — Whatnot style */
.product-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 12px;
    padding: 14px 16px;
    background: var(--wn-panel) !important;
    color: var(--wn-text) !important;
    border: none !important;
    border-bottom: 1px solid var(--wn-border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    transition: background 0.15s;
    position: relative;
}
.product-card:hover {
    background: var(--wn-panel2) !important;
}
.product-card.active {
    background: var(--wn-panel2) !important;
    border-left: none !important;
}

.product-card-img {
    width: 80px;
    height: 80px;
    border-radius: var(--wn-radius);
    object-fit: cover;
    background: var(--wn-panel2);
    flex-shrink: 0;
    border: 1px solid var(--wn-border);
}

.product-card-info {
    flex: 1;
    min-width: 0;
}
.product-card-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--wn-text);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card.active .product-card-name { color: var(--wn-text); }

.product-card-prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.pcard-price-old {
    font-size: 0.75rem;
    color: var(--wn-muted);
    text-decoration: line-through;
}
.pcard-price-auction {
    font-size: 1rem;
    font-weight: 800;
    color: var(--wn-text);
    line-height: 1.2;
}
.pcard-bids-inline {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--wn-muted);
}
.product-card.active .pcard-price-auction {
    color: var(--wn-text);
    font-size: 1.05rem;
}

.product-card-meta {
    font-size: 0.75rem;
    color: var(--wn-muted);
    margin-top: 2px;
}
.pcard-pujas-count {
    color: var(--wn-muted);
    font-weight: 500;
}

/* Pre-bid / Buy Now buttons */
.product-card-prebid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    margin-top: 8px;
    padding: 8px 0;
    border: none;
    border-radius: var(--wn-radius-pill);
    background: var(--wn-panel2);
    color: var(--wn-text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}
.product-card-prebid:hover {
    background: #eaeaea;
    color: var(--wn-text);
}
.product-card-prebid i {
    display: none; /* Whatnot: text-only buttons, no icons */
}
.pcard-prebid-btn {
    background: var(--wn-panel2) !important;
    color: var(--wn-text) !important;
    border: none !important;
}
.pcard-prebid-btn:hover {
    background: #e0e0e0 !important;
    color: var(--wn-text) !important;
}
.pcard-prebid-btn.has-prebid {
    background: rgba(0, 184, 83, 0.1) !important;
    color: var(--wn-green) !important;
    border: none !important;
}
.pcard-live-btn {
    background: var(--wn-text) !important;
    color: #fff !important;
    border: none !important;
}

.product-card.active .product-card-prebid {
    background: var(--wn-text);
    color: #fff;
}
.product-card.sold .product-card-prebid { display: none; }
.product-card-sold-badge {
    display: none;
    font-size: 0.72rem;
    color: var(--wn-green);
    font-weight: 600;
    margin-top: 4px;
}
.product-card.sold .product-card-sold-badge { display: block; }
.product-card.sold { opacity: 0.5; }

/* ══════ COLUMNA CENTRO: VIDEO ══════ */
.live-video-col {
    position: relative;
    background: #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.live-video-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
}
.live-video-inner {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
}
.live-video-inner iframe {
    position: absolute;
    top: -2%; left: -2%;
    width: 104%; height: 104%;
    border: 0;
}

/* Overlay that blocks interaction with video */
.video-block-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 3;
    cursor: default;
}

/* No extra gradients — Whatnot keeps video clean */
.live-video-inner::before,
.live-video-inner::after {
    display: none;
}

/* ── Seller info overlay (top-left) — Whatnot style ── */
.video-seller-info {
    position: absolute;
    top: 14px; left: 14px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.video-seller-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #333;
    border: 2.5px solid #fff;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.video-seller-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

/* ── Viewer count badge (top-right) — Whatnot style ── */
.video-viewers-badge {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.55);
    padding: 6px 12px;
    border-radius: var(--wn-radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.video-viewers-badge .vb-dot {
    width: 8px; height: 8px;
    background: var(--wn-red);
    border-radius: 50%;
    animation: vbPulse 2s ease-in-out infinite;
}
@keyframes vbPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(1.2)} }

/* ── Right side action buttons on video (like Whatnot) ── */
.live-video-actions {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.live-video-actions button {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.live-video-actions button:hover {
    background: rgba(0,0,0,0.7);
}

/* ── Product overlay (bottom of video) — Whatnot style ── */
.video-product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    background: linear-gradient(transparent, rgba(0,0,0,0.55) 30%, rgba(0,0,0,0.75));
    padding: 40px 14px 14px;
    pointer-events: none;
}
.video-product-overlay * { pointer-events: auto; }

/* Winner announcement — Whatnot style: inline on top of card */
.vpo-winner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
}
.vpo-winner-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
    border: 1.5px solid #fff;
}
.vpo-winner-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.85rem;
}
.vpo-winner-label {
    color: var(--wn-green);
    font-weight: 700;
    font-size: 0.85rem;
}
.vpo-winner.soy-ganador .vpo-winner-label { color: var(--wn-green) !important; }
.vpo-winner.soy-ganador .vpo-winner-name { color: #fff !important; }
.vpo-winner.soy-ganador {
    background: none !important;
    border: none;
}

/* Product card in overlay — Whatnot style */
.vpo-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 30, 30, 0.85);
    border-radius: var(--wn-radius);
    padding: 10px 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}
.vpo-card-img {
    width: 52px; height: 52px;
    border-radius: var(--wn-radius-sm);
    object-fit: cover;
    background: #333;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.15);
}
.vpo-card-info {
    flex: 1;
    min-width: 0;
}
.vpo-card-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vpo-card-meta {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin-top: 2px;
}
.vpo-card-bids {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-top: 1px;
}
.vpo-card-shipping {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}
.vpo-card-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    text-align: right;
}
.vpo-card-price.price-bump { animation: priceBump 0.5s ease; }
@keyframes priceBump { 0%{transform:scale(1)} 30%{transform:scale(1.15);color:var(--wn-yellow)} 100%{transform:scale(1)} }

.vpo-card-timer {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--wn-red);
    text-align: right;
}

.vpo-card-status {
    font-size: 0.72rem; font-weight: 600; flex-shrink: 0;
}
.vpo-card-status.sold { color: var(--wn-green); }
.vpo-card-status.live { color: var(--wn-red); }

/* ── Bid bar — Whatnot style: big yellow button ── */
.vpo-bid-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.vpo-countdown {
    font-size: 0;
    width: 0;
    overflow: hidden;
    /* countdown is now shown inside the product card */
}
.vpo-countdown.cd-green { color: var(--wn-green); }
.vpo-countdown.cd-yellow { color: var(--wn-yellow); }
.vpo-countdown.cd-red { color: var(--wn-red); animation: countdownFlash .5s ease-in-out infinite alternate; }
@keyframes countdownFlash { from{opacity:1} to{opacity:.5} }

/* Saldo line under bid */
.vpo-saldo-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px 0;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.6);
}
.vpo-saldo-line a {
    color: var(--wn-yellow);
    text-decoration: none;
    font-weight: 600;
}

/* Custom button (like Whatnot) */
.vpo-custom-btn {
    padding: 12px 20px;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.4);
    border-radius: var(--wn-radius);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.vpo-custom-btn:hover {
    background: rgba(255,255,255,0.25);
}

.vpo-bid-input {
    flex: 0;
    width: 0;
    padding: 0;
    border: none;
    visibility: hidden;
    position: absolute;
    /* Hidden — bid amount is auto-calculated like Whatnot */
}
.vpo-bid-input.vpo-bid-input-active {
    flex: 1;
    width: auto;
    padding: 12px 14px;
    border: 1.5px solid var(--wn-yellow);
    border-radius: var(--wn-radius);
    visibility: visible;
    position: static;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
}
.vpo-bid-input.vpo-bid-input-active::-webkit-inner-spin-button,
.vpo-bid-input.vpo-bid-input-active::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Big yellow Bid button — THE main CTA */
.vpo-bid-btn {
    flex: 1;
    padding: 14px 24px;
    background: var(--wn-yellow);
    color: var(--wn-text);
    border: none;
    border-radius: var(--wn-radius);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    letter-spacing: -0.01em;
    text-align: center;
}
.vpo-bid-btn:hover {
    background: var(--wn-yellow-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 221, 0, 0.4);
}
.vpo-bid-btn:active {
    transform: translateY(0);
}
.vpo-bid-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.vpo-bid-btn i { display: none; } /* Hide fire icon, Whatnot shows text only */

/* Awaiting next item */
.vpo-waiting {
    text-align: center;
    padding: 14px;
    background: rgba(30, 30, 30, 0.8);
    border-radius: var(--wn-radius);
    font-size: 0.88rem;
    color: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Last result badge */
.vpo-result-badge {
    text-align: center;
    padding: 4px 14px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--wn-radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    margin-bottom: 6px;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.15);
}
.vpo-result-badge.badge-sold { background: rgba(0,184,83,0.2); color: var(--wn-green); border-color: rgba(0,184,83,0.3); }
.vpo-result-badge.badge-unsold { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); }
.vpo-result-badge.badge-cancelled { background: rgba(255,59,48,0.2); color: var(--wn-red); border-color: rgba(255,59,48,0.3); }
.vpo-card-sold { opacity: 0.7; }
.vpo-waiting-mini {
    text-align: center;
    padding: 8px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    font-style: italic;
}

/* Guest CTA */
.vpo-guest {
    text-align: center;
    padding: 12px;
    background: rgba(30, 30, 30, 0.85);
    border-radius: var(--wn-radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.vpo-guest p { margin: 0 0 8px 0; font-size: 0.82rem; color: rgba(255,255,255,0.7); }
.vpo-guest-btn {
    display: inline-block;
    padding: 10px 28px;
    background: var(--wn-yellow);
    color: var(--wn-text);
    border-radius: var(--wn-radius);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
}
.vpo-guest-btn:hover { background: var(--wn-yellow-hover); }
.vpo-guest-link {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
}
.vpo-guest-link:hover { color: #fff; }

/* ── Poster / placeholder ── */
.live-poster {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    z-index: 3;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.6; } }

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 1rem;
    gap: 10px;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
}
.video-placeholder i { font-size: 3rem; color: #555; }

/* ══════ COLUMNA DERECHA: CHAT — Whatnot Style ══════ */
.live-chat-col {
    background: var(--wn-panel);
    border-left: 1px solid var(--wn-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Giveaway top banner — Whatnot style collapsible at top of chat */
.gw-top-banner {
    border-bottom: 1px solid var(--wn-border);
    flex-shrink: 0;
}
.gw-top-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--wn-text);
    transition: background 0.15s;
}
.gw-top-inner:hover { background: var(--wn-panel2); }
.gw-top-icon { font-size: 1.1rem; }
.gw-top-text { flex: 1; }
.gw-top-arrow { color: var(--wn-muted); font-size: 0.8rem; transition: transform 0.2s; }
.gw-top-banner.expanded .gw-top-arrow { transform: rotate(180deg); }
.gw-top-detail {
    display: none;
    padding: 0 16px 12px;
    font-size: 0.82rem;
    color: var(--wn-text2);
}
.gw-top-banner.expanded .gw-top-detail { display: block; }
.gw-top-prod { font-weight: 600; margin-bottom: 4px; }
.gw-top-timer { color: var(--wn-muted); margin-bottom: 8px; }
.gw-top-enter-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--wn-yellow);
    color: var(--wn-text);
    border: none;
    border-radius: var(--wn-radius);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
}
.gw-top-enter-btn:hover { background: var(--wn-yellow-hover); }
.gw-top-enter-btn.entered {
    background: var(--wn-green);
    color: #fff;
    cursor: default;
}

/* Chat tabs */
.chat-tabs {
    display: flex;
    border-bottom: 1px solid var(--wn-border);
    flex-shrink: 0;
    padding: 0 16px;
}
.chat-tab {
    flex: none;
    padding: 12px 0;
    margin-right: 20px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--wn-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.chat-tab.active {
    color: var(--wn-text);
    border-bottom-color: #2563eb; /* Whatnot uses blue underline */
}
.chat-tab:hover { color: var(--wn-text); }

/* Chat messages */
.live-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}
.live-chat-messages::-webkit-scrollbar { width: 4px; }
.live-chat-messages::-webkit-scrollbar-track { background: transparent; }
.live-chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 4px; }

.chat-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    line-height: 1.4;
    padding: 0;
    border-radius: 0;
    animation: chatSlideIn 0.25s ease-out;
}
.chat-msg:hover { background: transparent; }
@keyframes chatSlideIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

/* Chat avatar — Whatnot style: larger, circular */
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.chat-msg-body {
    flex: 1;
    min-width: 0;
}
.chat-name {
    font-weight: 700;
    color: var(--wn-text);
    display: block;
    font-size: 0.85rem;
    margin-bottom: 1px;
}
.chat-text {
    color: var(--wn-text2);
    word-break: break-word;
    display: block;
    font-size: 0.85rem;
    line-height: 1.35;
}
/* Whatnot highlights certain messages (requests) in orange */
.chat-text.highlight {
    color: var(--wn-chat-highlight);
    font-weight: 600;
}

/* Mod badge */
.chat-mod-badge {
    display: inline-block;
    background: var(--wn-text);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-empty {
    text-align: center;
    color: var(--wn-muted);
    padding: 60px 16px;
    font-size: 0.88rem;
}

/* Chat input — Whatnot style */
.live-chat-input-wrap {
    padding: 10px 16px 14px;
    border-top: 1px solid var(--wn-border);
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}
.live-chat-input {
    flex: 1;
    background: var(--wn-panel2);
    border: 1.5px solid var(--wn-border);
    border-radius: var(--wn-radius-pill);
    padding: 10px 16px;
    color: var(--wn-text);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}
.live-chat-input::placeholder { color: var(--wn-muted); }
.live-chat-input:focus { border-color: var(--wn-text); }

.live-chat-send-btn {
    background: var(--wn-text);
    border: none;
    border-radius: 50%;
    color: #fff;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.live-chat-send-btn:hover { opacity: 0.85; transform: scale(1.05); }
.live-chat-send-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

/* Slow mode notice */
.live-chat-slow-mode {
    padding: 6px 16px;
    font-size: 0.75rem;
    color: var(--wn-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-guest-notice {
    padding: 14px 16px;
    text-align: center;
    border-top: 1px solid var(--wn-border);
}
.chat-guest-notice a {
    color: var(--wn-accent);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.88rem;
}

/* ══════ SHARE BUTTONS — Whatnot inline style ══════ */
.live-share-btns {
    display: none; /* Hidden in Whatnot style — share is in video actions */
}

/* ══════ NOTIFICATIONS ══════ */
.live-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 12px 24px;
    border-radius: var(--wn-radius);
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    animation: notifSlideDown 0.3s ease-out;
    max-width: 90%;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
@keyframes notifSlideDown { from{opacity:0;transform:translateX(-50%) translateY(-20px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }
.live-notification.exito { background: #1a1a1a; color: #fff; border: 1px solid var(--wn-green); }
.live-notification.superado { background: #1a1a1a; color: #fff; border: 1px solid var(--wn-red); }
.live-notification.info { background: #1a1a1a; color: #fff; }
.live-notification.ganador { background: #1a1a1a; color: var(--wn-yellow); border: 1px solid var(--wn-yellow); }

/* ══════ STATES ══════ */
.live-paused-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    text-align: center;
}
.live-paused-overlay i { font-size: 3.5rem; margin-bottom: 14px; color: var(--wn-yellow); }
.live-paused-overlay h2 { margin: 0 0 6px 0; font-weight: 800; }
.live-paused-overlay p { opacity: 0.6; }

.live-no-session {
    text-align: center;
    padding: 100px 20px;
    color: var(--wn-muted);
}
.live-no-session i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
    display: block;
}
.live-no-session h2 {
    font-size: 1.4rem;
    color: var(--wn-text);
    margin-bottom: 8px;
    font-weight: 800;
}
.live-no-session p { color: var(--wn-muted); font-size: 0.95rem; }

/* Upcoming lives */
.live-upcoming { max-width: 600px; margin: 30px auto; padding: 0 16px; }
.live-upcoming h3 {
    font-size: 1rem;
    color: var(--wn-text);
    margin-bottom: 16px;
    text-align: center;
    font-weight: 700;
}
.upcoming-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--wn-panel);
    border-radius: var(--wn-radius);
    padding: 16px;
    margin-bottom: 10px;
    border: 1px solid var(--wn-border);
    transition: box-shadow 0.2s;
}
.upcoming-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.upcoming-card .upcoming-date {
    text-align: center;
    min-width: 52px;
    padding: 8px;
    background: var(--wn-panel2);
    border-radius: var(--wn-radius-sm);
}
.upcoming-card .upcoming-date .day {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--wn-text);
    display: block;
}
.upcoming-card .upcoming-date .month {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: var(--wn-muted);
    font-weight: 600;
}
.upcoming-card .upcoming-info { flex: 1; }
.upcoming-card .upcoming-info h4 {
    margin: 0 0 3px 0;
    font-size: 0.95rem;
    color: var(--wn-text);
    font-weight: 700;
}
.upcoming-card .upcoming-info p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--wn-muted);
}

/* ══════ PRE-BID MODAL ══════ */
.prebid-modal-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: prebidFadeIn 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
@keyframes prebidFadeIn { from{opacity:0} to{opacity:1} }
.prebid-modal {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    width: 360px;
    max-width: 92vw;
    position: relative;
    color: var(--wn-text);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.prebid-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    color: var(--wn-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.prebid-close:hover { color: var(--wn-text); }
.prebid-header {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--wn-text);
    margin-bottom: 16px;
    text-align: center;
}
.prebid-header i { margin-right: 6px; color: var(--wn-text); }
.prebid-product {
    background: var(--wn-panel2);
    border-radius: var(--wn-radius);
    padding: 14px;
    margin-bottom: 14px;
    text-align: center;
}
.prebid-prod-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--wn-text);
    margin-bottom: 4px;
}
.prebid-prod-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--wn-text);
}
.prebid-desc {
    font-size: 0.82rem;
    color: var(--wn-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    text-align: center;
}
.prebid-form label {
    font-size: 0.82rem;
    color: var(--wn-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}
.prebid-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--wn-panel2);
    border: 1.5px solid var(--wn-border);
    border-radius: var(--wn-radius);
    color: var(--wn-text);
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    outline: none;
    transition: border-color 0.2s;
}
.prebid-input:focus { border-color: var(--wn-text); }
.prebid-saldo {
    font-size: 0.78rem;
    color: var(--wn-muted);
    text-align: center;
    margin-bottom: 16px;
}
.prebid-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    background: var(--wn-yellow);
    color: var(--wn-text);
    font-size: 1.05rem;
    font-weight: 800;
    border-radius: var(--wn-radius);
    cursor: pointer;
    transition: all 0.15s;
}
.prebid-submit-btn:hover {
    background: var(--wn-yellow-hover);
    box-shadow: 0 4px 16px rgba(255, 221, 0, 0.4);
}
.prebid-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ══════ CONFETTI ══════ */
.confetti-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 2.5s ease-out forwards;
}
@keyframes confettiFall { 0%{transform:translateY(0) rotate(0);opacity:1} 100%{transform:translateY(100vh) rotate(720deg);opacity:0} }

/* ══════ RESPONSIVE ══════ */
@media (max-width: 1100px) {
    .live-main { grid-template-columns: 260px 1fr 280px; }
    .product-card-img { width: 64px; height: 64px; }
}
@media (max-width: 900px) {
    .live-main { grid-template-columns: 1fr 280px; }
    .live-products-col { display: none; }
}
@media (max-width: 600px) {
    .live-main {
        grid-template-columns: 1fr;
        grid-template-rows: 60vh 1fr;
    }
    .live-products-col { display: none; }
    .live-chat-col {
        border-left: none;
        border-top: 1px solid var(--wn-border);
    }
    .video-product-overlay {
        padding: 20px 10px 10px;
    }
    .vpo-card { padding: 8px 10px; }
    .vpo-card-img { width: 42px; height: 42px; }
    .vpo-bid-btn { padding: 12px 18px; font-size: 0.95rem; }
    .chat-avatar { width: 30px; height: 30px; font-size: 0.65rem; }
    .live-notification { font-size: 0.82rem; padding: 10px 16px; }
    .chat-tabs { padding: 0 12px; }
    .live-chat-messages { padding: 10px 12px; }
    .live-chat-input-wrap { padding: 8px 12px 10px; }
}

/* ── Mobile chat toggle ── */
.live-chat-toggle {
    display: none;
    position: fixed;
    bottom: 14px; right: 14px;
    z-index: 15;
    background: var(--wn-text);
    border: none;
    border-radius: 50%;
    width: 48px; height: 48px;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* ══════ INSTAGRAM LIVE CARD — Clean style ══════ */
.ig-live-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    background: #1a1a1a;
    border-radius: var(--wn-radius);
    padding: 28px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.ig-live-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(0,0,0,0.35); color: #fff;
    padding: 5px 14px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; margin-bottom: 16px;
    backdrop-filter: blur(4px);
}
.ig-pulse-dot {
    width: 8px; height: 8px; background: #ff3b30; border-radius: 50%;
    animation: igPulse 1.5s ease-in-out infinite;
}
@keyframes igPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.4); } }
.ig-live-icon { margin-bottom: 12px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2)); }
.ig-live-icon svg { width: 56px; height: 56px; }
.ig-live-icon svg rect, .ig-live-icon svg circle, .ig-live-icon svg path { stroke: #fff !important; fill: none; }
.ig-live-icon svg circle:last-child { fill: #fff !important; stroke: none !important; }
.ig-live-title { color: #fff; font-size: 1.15rem; font-weight: 800; margin-bottom: 4px; text-shadow: 0 1px 6px rgba(0,0,0,0.2); }
.ig-live-username { color: rgba(255,255,255,0.9); font-size: 0.9rem; font-weight: 600; margin-bottom: 16px; }
.ig-live-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--wn-yellow); color: var(--wn-text); padding: 12px 32px; border-radius: 30px;
    font-size: 0.95rem; font-weight: 700; text-decoration: none;
    transition: all 0.25s ease; box-shadow: 0 4px 16px rgba(0,0,0,0.15); margin-bottom: 18px;
}
.ig-live-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.25); color: var(--wn-text); }
.ig-live-btn i { font-size: 1.1rem; }
.ig-live-qr { background: #fff; border-radius: 10px; padding: 8px; display: inline-block; box-shadow: 0 2px 12px rgba(0,0,0,0.1); margin-bottom: 6px; }
.ig-live-qr svg { display: block; width: 100px; height: 100px; }
.ig-live-qr-text { color: rgba(255,255,255,0.8); font-size: 0.7rem; margin-bottom: 12px; }
.ig-live-note { color: rgba(255,255,255,0.7); font-size: 0.72rem; background: rgba(0,0,0,0.15); padding: 6px 14px; border-radius: 16px; backdrop-filter: blur(4px); }
.ig-live-note i { margin-right: 4px; }
@media (max-width: 768px) {
    .ig-live-qr, .ig-live-qr-text { display: none; }
    .ig-live-card { min-height: 220px; padding: 20px 16px; }
    .ig-live-icon svg { width: 40px; height: 40px; }
    .ig-live-title { font-size: 1rem; }
    .ig-live-btn { padding: 10px 24px; font-size: 0.85rem; }
}

/* ==========================================================================
   GIVEAWAY BANNER & WINNER
   ========================================================================== */
.vpo-giveaway-banner {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    width: 90%;
    max-width: 380px;
    animation: gwSlideIn 0.4s ease-out;
}
@keyframes gwSlideIn { from { opacity:0; transform:translateX(-50%) translateY(-20px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
.gw-banner-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--wn-panel);
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--wn-border);
}
.gw-banner-icon { font-size: 1.5rem; }
.gw-banner-info { flex: 1; color: var(--wn-text); }
.gw-banner-title { font-size: 0.85rem; font-weight: 800; }
.gw-banner-entries { font-size: 0.72rem; color: var(--wn-muted); }
.gw-banner-btn {
    background: var(--wn-yellow);
    color: var(--wn-text);
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.gw-banner-btn:hover { transform: scale(1.05); background: var(--wn-yellow-hover); }
.gw-banner-btn.entered {
    background: var(--wn-green);
    color: #fff;
    cursor: default;
}

.vpo-giveaway-winner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    animation: gwWinnerPop 0.5s ease-out;
}
@keyframes gwWinnerPop { from { opacity:0; transform:translate(-50%,-50%) scale(0.5); } to { opacity:1; transform:translate(-50%,-50%) scale(1); } }
.gw-winner-inner {
    background: #fff;
    padding: 24px 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    min-width: 260px;
    border: 2px solid var(--wn-yellow);
}
.gw-winner-text { font-size: 1.1rem; font-weight: 800; color: var(--wn-text); margin: 6px 0 4px; }
.gw-winner-sub { font-size: 0.75rem; color: var(--wn-muted); }
