/**
 * TikTok-Style Scroller Styles
 * Mobile-first, fullscreen vertical scroller
 * Red = logo red from common.css --primary-color (#DC143C)
 */
:root {
    --primary-color: #DC143C;
}

.tiktok-scroller-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 15000 !important; /* Above header (12000) and modals (13000) */
    display: none;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.35s ease-out;
}

.tiktok-scroller-modal.active {
    display: block;
}

/* Slide-up open: applied after .active so transition runs */
.tiktok-scroller-modal.active.open {
    transform: translateY(0);
}

/* Slide-down close: remove .open first, then .active after transition */
.tiktok-scroller-modal.active.closing {
    transform: translateY(100%);
}

.tiktok-scroller-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ========== BETA PAGE EMBEDDED (beta.php) ==========
 * Sticky header + categories grid. Clicking an item tile swipes left to product details
 * (shop panel with same 3D slider as category section). No modal; close button when product open.
 */
.tiktok-scroller-embedded {
    width: 100%;
    min-height: 60vh;
    background: #0a0a0a;
    overflow-x: hidden; /* categories/shop: swipe only, no horizontal scroll */
}
.tiktok-embedded-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    padding-top: max(12px, env(safe-area-inset-top, 12px));
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(-100%);
    transition: transform 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.tiktok-embedded-header.visible {
    transform: translateY(0);
}
/* Top row: close / tabs / profile */
.tiktok-embedded-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 10px;
    gap: 8px;
}
/* Search row: only when Categories tab + header visible */
.tiktok-embedded-header-search {
    display: none;
    padding: 0 12px 12px;
    box-sizing: border-box;
}
.tiktok-embedded-header.visible.tiktok-embedded-header--search-active .tiktok-embedded-header-search {
    display: block;
}
.tiktok-embedded-cat-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 10px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 20px rgba(0, 0, 0, 0.25);
}
.tiktok-embedded-cat-search:focus-within {
    border-color: rgba(220, 20, 60, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 2px rgba(220, 20, 60, 0.2);
}
.tiktok-embedded-cat-search-icon {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.45);
    font-size: 15px;
}
.tiktok-embedded-categories-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 15px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
/* Hide native clear (blue X) on type="search"; custom .tiktok-embedded-search-clear is the only control */
.tiktok-embedded-categories-search-input::-webkit-search-cancel-button,
.tiktok-embedded-categories-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}
.tiktok-embedded-categories-search-input::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}
.tiktok-embedded-categories-search-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}
.tiktok-embedded-search-clear {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 8px;
}
.tiktok-embedded-search-clear:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
/* Embedded filter bar: directly under header, no gap */
#tiktok-scroller-embedded .tiktok-embedded-filter-bar {
    position: fixed;
    top: 74px;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 44px;
    box-sizing: border-box;
}
#tiktok-embedded-panels.show-shop .tiktok-embedded-panel-shop {
    padding-top: 118px;
}
/* Close button (shown when product view is open); left side, square rounded like modal close */
.tiktok-embedded-close {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    order: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s, color 0.2s;
}
.tiktok-embedded-close:hover {
    background: var(--primary-color, #DC143C);
    color: #fff;
}
/* When shop view is open, hide the spacer so the close button occupies left 50px */
.tiktok-embedded-header.shop-open .tiktok-embedded-header-top::before {
    display: none;
}
/* Left spacer when close is hidden so tab group stays centered */
.tiktok-embedded-header-top::before {
    content: '';
    flex: 0 0 50px;
    width: 50px;
    order: 0;
}
.tiktok-embedded-tabs {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    order: 1;
}
.tiktok-embedded-profile {
    order: 2;
}
.tiktok-embedded-tab {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.tiktok-embedded-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
.tiktok-embedded-tab.active {
    background: var(--primary-color, #DC143C);
    color: #fff;
}
.tiktok-embedded-tab i {
    font-size: 18px;
}
.tiktok-embedded-tab-label {
    display: none;
}
/* Bar profile image: square with rounded corners (same as tiles), NOT circle */
.tiktok-embedded-profile {
    width: 50px;
    height: 50px;
    border-radius: 12px !important;
    overflow: hidden;
    flex-shrink: 0;
    display: block;
}
.tiktok-embedded-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px !important;
    display: block;
}
/* Prevent any global .rounded-circle from making the bar profile image circular */
#tiktok-embedded-profile-img {
    border-radius: 12px !important;
}
/* Content: when categories visible, grows with page; when shop visible, exactly one viewport, no scroll */
.tiktok-embedded-content {
    width: 100%;
    overflow: hidden;
    min-height: 320px;
}
.tiktok-embedded-content:has(.tiktok-embedded-panels.show-shop) {
    height: 100vh;
    max-height: 100vh;
    overflow-x: hidden;
    overflow-y: hidden;
}
body.embedded-shop-open {
    overflow: hidden;
}
/* Full-window product view: hide footer so only header + product view is visible */
body.embedded-shop-open footer {
    display: none !important;
}
body.embedded-shop-open .beta-main-content {
    margin-top: 0;
    padding-top: 0;
    min-height: 100vh;
}
.tiktok-embedded-panels {
    display: flex;
    width: 300%;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(-33.333%);
    touch-action: pan-y pinch-zoom; /* allow vertical scroll only; horizontal is swipe-to-switch */
}
.tiktok-embedded-panels.show-shop {
    transform: translateX(0);
}
.tiktok-embedded-panels.show-community {
    transform: translateX(-66.666%);
}
.tiktok-embedded-panel {
    width: 33.333%;
    flex-shrink: 0;
    box-sizing: border-box;
}
.tiktok-embedded-panel-community {
    position: relative;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    display: grid;
    grid-template-rows: 1fr auto;
    background: #0a0a0a;
    overflow: hidden;
    box-sizing: border-box;
}
.tiktok-embedded-panel-community .tiktok-embedded-community-main {
    grid-row: 1;
    grid-column: 1;
    position: relative;
    overflow: hidden;
}
.tiktok-embedded-panel-community .tiktok-scroller-actions {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
}
.tiktok-embedded-panel-community .tiktok-scroller-info {
    grid-row: 2;
    grid-column: 1;
    flex-shrink: 0;
    padding: 12px 16px 24px;
    padding-bottom: max(80px, env(safe-area-inset-bottom, 0px) + 60px);
    overflow: visible;
    position: relative;
}
.tiktok-embedded-panel-shop {
    position: relative;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    display: grid;
    grid-template-rows: 1fr auto;
    background: #0a0a0a;
    overflow-x: visible;
    overflow-y: hidden;
    box-sizing: border-box;
}
.tiktok-embedded-panel-shop .tiktok-embedded-shop-main {
    grid-row: 1;
    grid-column: 1;
    min-height: 0;
}
.tiktok-embedded-panel-shop .tiktok-scroller-actions {
    grid-row: 1;
    grid-column: 1;
}
.tiktok-embedded-panel-shop .tiktok-scroller-info {
    grid-row: 2;
    grid-column: 1;
}
.tiktok-embedded-panel-shop.tiktok-embedded-shop-special {
    border: none !important;
    box-shadow: none !important;
}
/* No border on slider cards in embedded */
.tiktok-embedded-panel-shop .shop-3d-slide-inner,
.tiktok-embedded-panel-shop .shop-3d-slide-inner.shop-3d-current-inner,
.tiktok-embedded-panel-shop .shop-3d-item-wrap.tiktok-item-special .shop-3d-slide-inner {
    border: none !important;
}
.tiktok-embedded-shop-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
/* Beta embedded shop: container for 3D product slider; do not grow so content stays centered */
#tiktok-embedded-scroller-items {
    width: 100%;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}
/* Embedded shop 3D slider: same structure as category section (cat-3d-slider) so full scroller is visible and centered */
#tiktok-embedded-scroller-items .shop-3d-item-wrap {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: visible;
}
#tiktok-embedded-scroller-items .shop-3d-slider,
#tiktok-embedded-scroller-items .shop-3d-slider__wrapper,
#tiktok-embedded-scroller-items .shop-3d-slider__slides {
    overflow: visible;
}
/* Match cat-3d-slider: no grid-template so wrapper sizes to content (slides); full scroller visible */
#tiktok-embedded-scroller-items .shop-3d-slider {
    flex: 1;
    min-height: 160px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#tiktok-embedded-scroller-items .shop-3d-slider__wrapper {
    width: 100%;
    max-width: calc(3 * var(--shop-slide-width-current));
    display: grid;
    place-items: center;
    perspective: 1000px;
}
#tiktok-embedded-scroller-items .shop-3d-slider__wrapper > * {
    grid-area: 1 / -1;
}
#tiktok-embedded-scroller-items .shop-3d-slider__slides {
    width: 100%;
    display: grid;
    place-items: center;
}
#tiktok-embedded-scroller-items .shop-3d-slider__slides > * {
    grid-area: 1 / -1;
}
/* Center card and image area: fill slide width (same idea as cat-3d-slide-inner) */
#tiktok-embedded-scroller-items .shop-3d-current-inner .tiktok-shop-main-wrap.shop-3d-center-main,
#tiktok-embedded-scroller-items .shop-3d-current-inner .tiktok-shop-main-wrap .tiktok-shop-slides-wrap {
    width: 100%;
    min-width: 0;
}
#tiktok-embedded-scroller-items .shop-3d-slide-inner.shop-3d-current-inner {
    width: 100%;
}
.tiktok-embedded-panel-shop .tiktok-scroller-info {
    flex-shrink: 0;
    padding: 12px 16px 24px;
    padding-bottom: max(80px, env(safe-area-inset-bottom, 0px) + 60px);
    overflow: visible;
    position: relative;
    touch-action: pan-y;
    min-height: 52px;
}
/* Product description: in-flow expandable; swipe up opens sheet that slides up from bottom (same content as updateInfoOverlay: additional details / AI description) */
.tiktok-embedded-panel-shop .tiktok-shop-details-expandable {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 60vh;
    z-index: 400;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(12px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}
.tiktok-embedded-panel-shop .tiktok-shop-details-expandable.description-expanded {
    transform: translateY(0);
    pointer-events: auto;
}
.tiktok-embedded-panel-shop .tiktok-shop-details-expandable::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.4);
    margin: 10px auto 8px;
    flex-shrink: 0;
}
.tiktok-embedded-panel-shop .tiktok-shop-details-expandable .tiktok-info-description {
    padding: 0 20px 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    color: rgba(255,255,255,0.95);
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    min-height: 60px;
}
/* Keep the embedded swipe hint rendered so opening details does not shift the layout */
.tiktok-embedded-panel-shop #tiktok-embedded-scroller-info .tiktok-info-content::after {
    content: 'Swipe up for details and nutrition';
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    margin-top: 6px;
    padding: 8px 0;
    cursor: pointer;
}
.tiktok-embedded-scroller-actions {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex !important;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    z-index: 200;
    visibility: visible;
    pointer-events: auto;
}
/* Product pane only: + disappears and pill expands in the same location. No global pill rules changed. */
#tiktok-embedded-panel-shop .tiktok-embedded-scroller-actions .tiktok-cart-expandable {
    min-width: 44px;
    width: auto;
    flex-shrink: 0;
}
#tiktok-embedded-panel-shop .tiktok-embedded-scroller-actions .tiktok-cart-expandable.expanded .tiktok-cart-circle,
#tiktok-embedded-panel-shop .tiktok-embedded-scroller-actions .tiktok-cart-expandable.expanded #tiktok-embedded-cart-circle {
    display: none !important;
}
#tiktok-embedded-panel-shop .tiktok-embedded-scroller-actions .tiktok-cart-expandable.expanded #tiktok-embedded-add-cart-btn {
    display: none !important;
}
#tiktok-embedded-panel-shop .tiktok-embedded-scroller-actions .tiktok-cart-expandable .tiktok-cart-expanded {
    position: relative;
}
#tiktok-embedded-panel-shop .tiktok-embedded-scroller-actions #tiktok-embedded-cart-btn {
    display: none !important;
}
.tiktok-embedded-scroller-actions .tiktok-like-btn,
.tiktok-embedded-scroller-actions .tiktok-share-btn {
    z-index: 2;
    display: flex !important;
}
.tiktok-embedded-scroller-actions .tiktok-action-btn {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.tiktok-embedded-scroller-actions .tiktok-cart-control-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.6);
    border-radius: 12px;
    padding: 4px 8px;
}
.tiktok-embedded-scroller-actions .tiktok-cart-quantity {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
}
.tiktok-embedded-cart-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 6px 10px;
}
.tiktok-embedded-cart-control-group button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color, #DC143C);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tiktok-embedded-cart-quantity {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: #fff;
}
/* Embedded shop: same 3D stack, slightly smaller so it fits */
.tiktok-embedded-shop-main .shop-3d-slider {
    --shop-slide-width: 200px;
    --shop-slide-width-current: 260px;
}
.tiktok-embedded-shop-main .shop-3d-slide-inner.shop-3d-current-inner {
    min-height: 180px;
    max-height: 50vh;
}
/* When showing categories, hide the shop info so it never overlays the tiles */
.tiktok-embedded-panels:not(.show-shop) #tiktok-embedded-scroller-info {
    display: none !important;
}
/* Shop tab: ensure action buttons and info badges are visible (override any broad resets) */
.tiktok-embedded-panel-shop .tiktok-scroller-info .tiktok-badges,
.tiktok-embedded-panel-shop #tiktok-embedded-item-badges {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    visibility: visible;
}
.tiktok-embedded-panel-shop .tiktok-scroller-info .tiktok-badge-featured,
.tiktok-embedded-panel-shop .tiktok-scroller-info .tiktok-badge-special,
.tiktok-embedded-panel-shop .tiktok-scroller-info .tiktok-badge-organic,
.tiktok-embedded-panel-shop .tiktok-scroller-info .tiktok-badge-tagged {
    display: inline-block !important;
    visibility: visible;
}
.tiktok-embedded-panel-categories {
    overflow-x: hidden;
    /* No overflow-y: so content flows and the page scrolls */
}
/* No gradient overlay on categories – last rows must not be covered */
.tiktok-embedded-content::after,
.tiktok-embedded-panel-categories::after,
.tiktok-embedded-panel-categories::before,
#tiktok-categories-grid-embedded::after,
#tiktok-categories-grid-embedded::before,
#tiktok-scroller-embedded::after,
#tiktok-scroller-embedded .tiktok-categories-grid-inner::after {
    display: none !important;
    content: none !important;
    background: none !important;
    background-image: none !important;
}
/* Override .tiktok-categories-grid (height:100%; overflow-y:auto) so the page scrolls, not this container */
#tiktok-categories-grid-embedded {
    padding: 0 16px 24px 16px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: visible;
    height: auto;
    min-height: 400px;
    transition: padding-top 0.3s ease-out;
}
/* No top offset or transform on inner so categories start at top (avoids extra dead space).
   Add padding-bottom so scroll height includes parallax offset (translateY(120px) on rows) and the container doesn't need extra scroll before content begins. */
#tiktok-categories-grid-embedded .tiktok-categories-grid-inner {
    transform: none;
    margin-top: 0;
    padding-bottom: 120px;
    box-sizing: border-box;
}
.tiktok-cat-search-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
    padding: 2rem 1rem 3rem;
    font-size: 15px;
}
.tiktok-cat-search-empty i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
    display: block;
}
/* Staggered tile entrance when grid updates */
#tiktok-categories-grid-embedded .tiktok-categories-grid-inner.tiktok-cat-grid-animating > .tiktok-cat-block-fullwidth-expandable,
#tiktok-categories-grid-embedded .tiktok-categories-grid-inner.tiktok-cat-grid-animating > .tiktok-cat-pair {
    animation: tiktokCatTileReveal 0.38s cubic-bezier(0.32, 0.72, 0, 1) backwards;
}
#tiktok-categories-grid-embedded .tiktok-categories-grid-inner.tiktok-cat-grid-animating > .tiktok-cat-block-fullwidth-expandable {
    animation-delay: 0.02s;
}
#tiktok-categories-grid-embedded .tiktok-categories-grid-inner.tiktok-cat-grid-animating > .tiktok-cat-pair:nth-child(2) { animation-delay: 0.06s; }
#tiktok-categories-grid-embedded .tiktok-categories-grid-inner.tiktok-cat-grid-animating > .tiktok-cat-pair:nth-child(3) { animation-delay: 0.1s; }
#tiktok-categories-grid-embedded .tiktok-categories-grid-inner.tiktok-cat-grid-animating > .tiktok-cat-pair:nth-child(4) { animation-delay: 0.14s; }
#tiktok-categories-grid-embedded .tiktok-categories-grid-inner.tiktok-cat-grid-animating > .tiktok-cat-pair:nth-child(5) { animation-delay: 0.18s; }
#tiktok-categories-grid-embedded .tiktok-categories-grid-inner.tiktok-cat-grid-animating > .tiktok-cat-pair:nth-child(n+6) { animation-delay: 0.22s; }
@keyframes tiktokCatTileReveal {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}
#tiktok-categories-grid-embedded.tiktok-categories-grid {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#tiktok-categories-grid-embedded::-webkit-scrollbar {
    display: none;
}

/* Top Bar: Streamlined Header – left/right same width so center tabs are visually centered */
.tiktok-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 14px 14px;
    padding-top: max(24px, env(safe-area-inset-top, 24px));
    z-index: 10005;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 70%, transparent 100%);
    backdrop-filter: blur(10px);
    gap: 8px;
    flex-wrap: nowrap;
    min-height: 64px;
    box-sizing: border-box;
}
.tiktok-top-bar .tiktok-scroller-close {
    flex: 0 0 50px;
    width: 50px;
}
.tiktok-top-bar .tiktok-user-profile {
    flex: 0 0 50px;
    width: 50px;
}

/* Close button - fixed size, no wrapping; logo red */
.tiktok-scroller-close {
    background: var(--primary-color, #DC143C);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 10007;
    position: relative;
}

.tiktok-scroller-close:hover {
    background: var(--primary-color, #DC143C);
    filter: brightness(1.1);
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

/* Tabs - centered in the bar */
.tiktok-scroller-tabs {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

/* User Profile Picture - fixed size, no wrapping */
.tiktok-user-profile {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    z-index: 10008;
    position: relative;
}

.tiktok-user-profile:hover {
    transform: scale(1.1);
    border-color: white;
}

.tiktok-user-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px !important;
}

/* Category Filter Bar – directly below header (align with grid top padding) */
.tiktok-category-filter-bar {
    position: absolute;
    top: 92px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    z-index: 10004;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    min-height: 44px;
    box-sizing: border-box;
}

.tiktok-category-filter-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.tiktok-category-filter-info i {
    font-size: 14px;
    opacity: 0.8;
}

.tiktok-clear-filter-btn {
    background: var(--primary-color, #DC143C);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    transition: all 0.3s ease;
}

.tiktok-clear-filter-btn:hover {
    background: var(--primary-color, #DC143C);
    filter: brightness(1.1);
    transform: scale(1.05);
}

.tiktok-clear-filter-btn i {
    font-size: 10px;
}

.tiktok-scroller-close:hover {
    background: var(--primary-color, #DC143C);
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

/* Small devices - ensure no wrapping; filter bar stays directly below header */
@media (max-width: 480px) {
    .tiktok-top-bar {
        padding: 20px 12px 14px;
        padding-top: max(20px, env(safe-area-inset-top, 20px));
        min-height: 58px;
        height: auto;
        gap: 4px;
    }
    
    .tiktok-scroller-close {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .tiktok-user-profile {
        width: 45px;
        height: 45px;
    }
    
    .tiktok-category-filter-bar {
        top: 88px;
        padding: 6px 10px;
        font-size: 12px;
        min-height: 40px;
    }
    
    .tiktok-tab-content.tiktok-filter-active .tiktok-scroller-main {
        padding-top: 40px;
    }
}

/* Landscape orientation - ensure buttons are visible */
@media (orientation: landscape) {
    .tiktok-top-bar {
        padding: 24px 15px 14px;
        padding-top: max(24px, env(safe-area-inset-top, 24px));
        min-height: 64px;
    }
    
    .tiktok-scroller-close {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .tiktok-user-profile {
        width: 50px;
        height: 50px;
    }
    
    .tiktok-category-filter-bar {
        top: 92px;
    }
}

/* Comments Panel (slides up from bottom like TikTok) */
.tiktok-comments-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    height: 70%;
    max-height: 70vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10005;
    transition: bottom 0.3s ease;
    display: flex;
    flex-direction: column;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    overflow: hidden;
}

.tiktok-comments-panel.active {
    bottom: 0;
}

.tiktok-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.8);
}

.tiktok-comments-header h5 {
    color: white;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.tiktok-comments-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.tiktok-comments-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tiktok-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tiktok-comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.tiktok-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.tiktok-comment-content {
    flex: 1;
    color: white;
}

.tiktok-comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    position: relative;
}

.tiktok-comment-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.tiktok-comment-edit-btn,
.tiktok-comment-delete-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    padding: 0;
}

.tiktok-comment-edit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.tiktok-comment-delete-btn:hover {
    background: color-mix(in srgb, var(--primary-color, #DC143C) 30%, transparent);
    color: var(--primary-color, #DC143C);
}

.tiktok-comment-header strong {
    color: white;
    font-size: 14px;
}

.tiktok-comment-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.tiktok-comment-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
}

.tiktok-comment-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 20px;
    font-size: 14px;
}

.tiktok-comment-edit-form {
    margin-top: 10px;
}

.tiktok-comment-edit-input {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 8px;
}

.tiktok-comment-edit-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.tiktok-comment-edit-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.tiktok-comment-save-btn,
.tiktok-comment-cancel-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tiktok-comment-save-btn {
    background: var(--primary-color, #DC143C);
    color: white;
}

.tiktok-comment-save-btn:hover {
    background: #c82333;
}

.tiktok-comment-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.tiktok-comment-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.tiktok-comments-input {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.8);
}

.tiktok-comments-input input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 10px 20px;
    color: white;
    font-size: 14px;
}

.tiktok-comments-input input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.tiktok-comments-input button {
    background: var(--primary-color, #DC143C);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease;
}

.tiktok-comments-input button:hover {
    background: #c82333;
}

.tiktok-category-item span:not(.tiktok-category-count) {
    flex: 1;
    font-size: 16px;
}

.tiktok-category-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* Main Scroller */
.tiktok-scroller-main {
    flex: 1;
    position: relative;
    overflow: hidden;
    overflow-anchor: none;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
/* Shop tab: main image higher – less top padding so image + strip sit up under header */
#tiktok-tab-shop .tiktok-scroller-main {
    padding-top: 28px;
}

/* Shop tab: 3D item slider – prev | current | next product cards (like category scrollers) */
.shop-3d-item-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.shop-3d-slider {
    --shop-slide-width: 200px;
    --shop-slide-width-current: 280px;
    --shop-slide-aspect: 1;
    --shop-slide-transition-duration: 400ms;
    --shop-slide-transition-easing: ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    padding: 0;
    overflow: visible;
}
.shop-3d-slider__wrapper {
    width: 100%;
    max-width: calc(3 * var(--shop-slide-width-current));
    display: grid;
    place-items: center;
    perspective: 1000px;
    overflow: visible;
    touch-action: pan-y;
    padding: 0;
    box-sizing: border-box;
}
.shop-3d-slider__wrapper > * { grid-area: 1 / -1; }
.shop-3d-slider__slides {
    width: 100%;
    display: grid;
    place-items: center;
    pointer-events: none;
}
.shop-3d-slider__slides > * { grid-area: 1 / -1; }

.shop-3d-slider-dragging .shop-3d-slide {
    transition: transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.shop-3d-slide {
    --slide-tx: 0px;
    --slide-tz: 0px;
    --slide-scale: 1;
    --slide-rotY: 0deg;
    width: var(--shop-slide-width);
    height: auto;
    aspect-ratio: var(--shop-slide-aspect);
    min-height: 0;
    user-select: none;
    pointer-events: none;
    transition: transform var(--shop-slide-transition-duration) var(--shop-slide-transition-easing);
    transform: perspective(800px) translate3d(var(--slide-tx), 0, var(--slide-tz)) rotateY(var(--slide-rotY)) scale(var(--slide-scale));
    display: flex;
    flex-direction: column;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
/* Stack order like category slider: center on top, sides behind */
.shop-3d-slide[data-previous],
.shop-3d-slide[data-next] {
    z-index: 1;
}
.shop-3d-slide[data-current] {
    width: var(--shop-slide-width-current);
    --slide-scale: 1;
    --slide-tz: 0px;
    --slide-tx: 0px;
    --slide-rotY: 0deg;
    pointer-events: auto;
    z-index: 2;
}
.shop-3d-slide[data-next] {
    --slide-scale: 0.88;
    --slide-tx: calc(var(--shop-slide-width-current) * 0.5);
    --slide-rotY: -32deg;
}
.shop-3d-slide[data-previous] {
    --slide-scale: 0.88;
    --slide-tx: calc(var(--shop-slide-width-current) * -0.5);
    --slide-rotY: 32deg;
}
/* Single item: only center card visible, no side cards */
.shop-3d-item-wrap.shop-3d-single-item .shop-3d-slide[data-previous],
.shop-3d-item-wrap.shop-3d-single-item .shop-3d-slide[data-next] {
    visibility: hidden;
    pointer-events: none;
}
.shop-3d-slide-inner {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg, #fff);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border: none;
    box-shadow: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.shop-3d-slide-inner.shop-3d-current-inner {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}
.shop-3d-item-wrap.tiktok-item-special .shop-3d-slide-inner.shop-3d-current-inner {
    box-shadow: none;
}
.shop-3d-slide-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 10px;
    box-sizing: border-box;
}
/* Additional images strip above the product scroller (big 3D cards) */
.shop-3d-item-wrap .tiktok-shop-thumbs-above {
    flex-shrink: 0;
    margin: 0 0 8px 0;
    width: 100%;
}
#tiktok-embedded-scroller-items .tiktok-shop-thumbs-above {
    max-height: 56px;
    margin: 0 0 6px 0;
}
.shop-3d-current-inner .tiktok-shop-main-wrap.shop-3d-center-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}
.shop-3d-current-inner .tiktok-shop-main-wrap .tiktok-shop-slides-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shop-3d-current-inner .tiktok-shop-main-wrap .tiktok-shop-slides {
    position: absolute;
    inset: 0;
}
.shop-3d-item-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.shop-3d-item-wrap .shop-3d-slider {
    flex: 1;
    width: 100%;
    min-height: 0;
}

.tiktok-scroller-items {
    width: 100%;
    height: 100%;
    position: relative;
}

.tiktok-scroller-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden; /* Single-item view: clip image */
}
/* Shop 3D slider: must not clip prev/next cards – same 3D stack as category section */
.shop-3d-item-wrap.tiktok-scroller-item {
    overflow: visible;
}

/* Ensure images are 100% width and fill container */
.tiktok-scroller-item img.tiktok-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.tiktok-scroller-item-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.5);
}

.tiktok-item-image {
    width: 100%;
    height: auto; /* Auto height to maintain aspect ratio */
    max-height: 100vh; /* Don't exceed viewport height */
    object-fit: contain; /* Show full image without cropping */
    object-position: center;
    position: relative;
    z-index: 2;
}

/* (Redundant width/height/display already set above for .tiktok-scroller-item; kept for img overrides) */
.tiktok-scroller-item img.tiktok-item-image {
    width: 100%;
    height: auto;
    max-height: 100vh;
    object-fit: contain;
}

/* Blanking fill effect for ALL images - split halves above/below with blur and zoom */
/* This fills the vertical space for any image, not just square ones */
.tiktok-image-split-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block; /* Always show for blanking fill effect */
    overflow: hidden;
}

.tiktok-image-split-top,
.tiktok-image-split-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    overflow: hidden;
}

.tiktok-image-split-top {
    top: -50%;
    transform: scale(1.3);
    filter: blur(25px);
    opacity: 0.8;
}

.tiktok-image-split-bottom {
    bottom: -50%;
    transform: scale(1.3);
    filter: blur(25px);
    opacity: 0.8;
}

.tiktok-split-image {
    width: 100%;
    height: 200%;
    object-fit: cover;
    object-position: center;
}

.tiktok-image-split-top .tiktok-split-image {
    /* Top split (above image) should show the TOP part of the image */
    /* Since bottom is showing on top, swap: use bottom positioning for top split */
    object-position: center bottom;
    /* Shift down to show top part */
    transform: translateY(50%);
}

.tiktok-image-split-bottom .tiktok-split-image {
    /* Bottom split (below image) should show the BOTTOM part of the image */
    /* Since bottom is showing on top, swap: use top positioning for bottom split */
    object-position: center top;
    /* Shift up to show bottom part */
    transform: translateY(-50%);
}

.tiktok-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
}

/* Right Side Actions - column aligned to the right so buttons don't shift when cart expands */
.tiktok-scroller-actions {
    position: absolute;
    right: 15px;
    bottom: clamp(190px, 24vh, 220px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    z-index: 10002;
}

.tiktok-action-btn {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.tiktok-action-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.tiktok-action-btn.active {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary-color, #DC143C);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color, #DC143C) 30%, transparent);
}

.tiktok-action-btn.active i {
    color: var(--primary-color, #DC143C);
}

.tiktok-item-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
    background: #000;
}

.tiktok-item-video::-webkit-media-controls {
    display: flex !important;
}

/* Improve video buffering */
.tiktok-item-video[preload="metadata"] {
    /* Preload metadata for faster start */
}

.tiktok-item-video[preload="auto"] {
    /* Preload entire video for smoother playback */
}

/* Count bubbles: same position on every action button so they line up */
.tiktok-action-count,
.tiktok-like-bubble {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary-color, #DC143C);
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 5;
}

.tiktok-like-btn,
.tiktok-comment-btn,
.tiktok-share-btn {
    position: relative;
}

/* Cart expandable: circle (always) + expanded controls; collapse on scroll/nav */
.tiktok-cart-expandable {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    position: relative;
}
/* Cart circle and pill: no transform/bounce; only background/opacity for open/close feel */
.tiktok-cart-expandable .tiktok-cart-circle,
.tiktok-cart-expandable .tiktok-cart-circle:hover,
.tiktok-cart-expandable .tiktok-cart-circle:active {
    transform: none;
}
.tiktok-cart-expandable .tiktok-cart-circle {
    transition: background 0.2s ease;
}
.tiktok-cart-circle {
    position: relative;
    flex-shrink: 0;
    border-radius: 8px !important;
    background: var(--primary-color, #DC143C) !important;
    border: 2px solid var(--primary-color, #DC143C) !important;
}
.tiktok-cart-circle:hover {
    filter: brightness(1.1);
}
.tiktok-cart-expanded {
    display: none;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
}
/* When expanded: hide circle so only pill shows (override .tiktok-action-btn display) */
.tiktok-cart-expandable.expanded .tiktok-cart-circle {
    display: none !important;
}
.tiktok-cart-expandable.expanded .tiktok-cart-expanded {
    display: flex;
}

/* Cart Quantity Control Group - square with rounded corners (match badges/tiles) */
.tiktok-cart-control-group {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 4px 6px;
    backdrop-filter: blur(10px);
    transition: background 0.2s ease, border-color 0.2s ease;
    width: auto;
    min-width: auto;
}

.tiktok-cart-control-group:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.5);
}

.tiktok-cart-btn-minus,
.tiktok-cart-btn-plus {
    background: transparent;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    transition: background 0.2s ease;
    padding: 0;
}

.tiktok-cart-btn-minus:hover,
.tiktok-cart-btn-plus:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tiktok-cart-btn-minus:active,
.tiktok-cart-btn-plus:active {
    transform: none;
}

/* No transform/animation on cart pill add button (override .tiktok-action-btn scale and transition: all) */
.tiktok-cart-expandable .tiktok-add-cart-btn,
.tiktok-cart-expandable .tiktok-add-cart-btn:hover,
.tiktok-cart-expandable .tiktok-add-cart-btn:active,
.tiktok-cart-expandable .tiktok-add-cart-btn:focus {
    transform: none !important;
    box-shadow: none !important;
}
.tiktok-cart-expandable .tiktok-add-cart-btn {
    transition: background 0.2s ease !important;
    border-radius: 8px !important;
}

.tiktok-cart-quantity {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-size: 12px;
    font-weight: bold;
    padding: 0 6px;
    background: var(--primary-color, #DC143C);
    border-radius: 8px;
    margin: 0 4px;
}

/* Cart Count Badge - square with rounded corners to match tiles */
.tiktok-cart-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color, #DC143C);
    color: white;
    border-radius: 8px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    padding: 0 5px;
    border: 2px solid #000;
}

.tiktok-like-btn.active i {
    color: var(--primary-color, #DC143C);
}

/* Bottom Info Overlay - taller panel so image sits higher and description has room */
.tiktok-scroller-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 38vh;
    max-height: 55vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.96) 0%, rgba(0,0,0,0.85) 50%, rgba(0,0,0,0.4) 85%, transparent 100%);
    padding: 16px 20px 24px;
    padding-right: 140px; /* Clear of right-side actions + cart quantity group */
    z-index: 10001;
    color: white;
    overflow: visible;
}

.tiktok-info-content {
    max-width: 100%;
    position: relative;
}

.tiktok-info-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.tiktok-info-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.25;
}
.tiktok-info-screen-name {
    font-size: 13px;
    margin-top: 2px;
    opacity: 0.9;
}

/* Description - more room, scrollable if very long */
.tiktok-info-description {
    font-size: 14px;
    opacity: 0.95;
    margin-bottom: 10px;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    overflow-wrap: break-word;
    word-wrap: break-word;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
}
.tiktok-info-description::-webkit-scrollbar {
    width: 4px;
}
.tiktok-info-description::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 4px;
}

.tiktok-info-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color, #DC143C);
    margin-bottom: 8px;
}

/* Attribute/tag badges below price so they stay out of the way */
.tiktok-badges-below-price {
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tiktok-info-price .tiktok-price-current {
    color: #28a745;
}
.tiktok-info-price .tiktok-price-old {
    text-decoration: line-through;
    color: rgba(255,255,255,0.6);
    font-size: 0.85em;
    margin-left: 6px;
}
.tiktok-info-price .tiktok-price-save {
    display: block;
    font-size: 0.75em;
    font-weight: 600;
    color: #28a745;
    margin-top: 2px;
}
.tiktok-info-price .tiktok-price-message {
    display: block;
    font-size: 0.7em;
    font-weight: normal;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
}

/* Special item: yellow price and yellow border around card */
.tiktok-info-price.tiktok-price-special {
    color: #ffc107;
}
.tiktok-info-price.tiktok-price-special .tiktok-price-current {
    color: #ffc107;
}
.tiktok-info-price.tiktok-price-special .tiktok-price-save {
    color: #ffdb4d;
}
.tiktok-scroller-item.tiktok-item-product {
    border: 3px solid #ffc107;
    border-radius: 12px;
    box-sizing: border-box;
    box-shadow: 0 0 0 1px rgba(255,193,7,0.3);
}
/* No yellow border on shop product view (single-item or 3D wrap) */
.shop-3d-item-wrap.tiktok-scroller-item.tiktok-item-product,
.shop-3d-item-wrap.tiktok-scroller-item.tiktok-item-product.tiktok-item-special,
.tiktok-shop-item.tiktok-scroller-item.tiktok-item-product,
.tiktok-shop-item.tiktok-scroller-item.tiktok-item-product.tiktok-item-special {
    border: none !important;
    box-shadow: none !important;
}

.tiktok-info-actions {
    display: flex;
    gap: 10px;
}

.tiktok-info-btn {
    background: var(--primary-color, #DC143C);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tiktok-info-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Badges */
.tiktok-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    min-height: 24px;
    align-items: flex-start;
}

.tiktok-badge-featured,
.tiktok-badge-special,
.tiktok-badge-organic,
.tiktok-badge-local,
.tiktok-badge-seasonal,
.tiktok-badge-unread {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}
.tiktok-badges-left {
    justify-content: flex-start;
    margin-top: 6px;
    margin-bottom: 0;
}
.tiktok-badges:empty::before {
    content: '';
    display: block;
    height: 16px;
}

.tiktok-badge-featured {
    background: var(--primary-color, #DC143C); /* RED for featured */
    color: white;
}

.tiktok-badge-special {
    background: #ffc107; /* YELLOW for specials */
    color: #000;
}

.tiktok-badge-organic {
    background: #28a745;
    color: white;
}

.tiktok-badge-local {
    background: #17a2b8;
    color: white;
}

.tiktok-badge-seasonal {
    background: #6f42c1;
    color: white;
}

.tiktok-badge-unread {
    background: var(--primary-color, #DC143C);
    color: white;
    animation: pulse 2s infinite;
}

/* Tagged product badges – square with rounded corners */
.tiktok-badge-tagged {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: #17a2b8;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}
.tiktok-badge-tagged:hover {
    background: #138496;
    transform: scale(1.05);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .tiktok-scroller-sidebar {
        width: 85%;
    }
    
    .tiktok-scroller-actions {
        right: 10px;
        bottom: 100px;
        gap: 15px;
    }
    
    
    .tiktok-info-header h4 {
        font-size: 18px;
    }
    
    .tiktok-info-price {
        font-size: 22px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .tiktok-scroller-sidebar {
        width: 70%;
        max-width: 400px;
    }
}

/* Desktop - Keep mobile feel but allow larger viewport */
@media (min-width: 1025px) {
    .tiktok-scroller-modal {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .tiktok-scroller-container {
        max-width: 500px;
        max-height: 90vh;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    }
}

/* Loading State */
.tiktok-scroller-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    font-size: 18px;
}

.tiktok-scroller-loading i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Smooth Transitions */
.tiktok-scroller-item {
    will-change: transform, opacity;
}

/* Prevent text selection during swipe */
.tiktok-scroller-main {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Touch Action Optimization */
.tiktok-scroller-items {
    touch-action: pan-y;
}

/* Lazy Loading Styles */
.tiktok-lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tiktok-lazy-image.loaded {
    opacity: 1;
}

/* Loading Indicator */
.tiktok-scroller-loading-more {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10002;
    display: none;
}

.tiktok-scroller-loading-more.active {
    display: block;
}

.tiktok-scroller-loading-more i {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

/* Story Modal Styles */
.tiktok-story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tiktok-story-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 100%;
    max-height: 90vh;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.tiktok-story-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tiktok-story-author {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.tiktok-story-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}
.tiktok-story-author-screen-name {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 1px;
}
.tiktok-post-author-screen-name {
    font-size: 12px;
    margin-top: 2px;
    margin-bottom: 4px;
    text-align: center;
}

.tiktok-story-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tiktok-story-progress {
    position: absolute;
    top: 60px;
    left: 15px;
    right: 15px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.tiktok-story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.tiktok-story-progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.1s linear;
}

.tiktok-story-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tiktok-story-slide {
    width: 100%;
    height: 100%;
    position: relative;
}

.tiktok-story-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tiktok-story-text {
    position: absolute;
    bottom: 80px;
    left: 20px;
    right: 20px;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
}

/* Story modal: dots at bottom (same as in-scroller) */
.tiktok-story-container .tiktok-story-dots-bottom {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    z-index: 15;
}

.tiktok-story-container .tiktok-story-dots-bottom .tiktok-story-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.tiktok-story-container .tiktok-story-dots-bottom .tiktok-story-dot.active {
    background: #fff;
    width: 10px;
    height: 10px;
}

.tiktok-story-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
}

.tiktok-story-nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    cursor: pointer;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    font-size: 24px;
    transition: color 0.2s;
}

.tiktok-story-nav-btn:hover {
    color: white;
}

.tiktok-story-prev {
    justify-content: flex-start;
    padding-left: 20px;
}

.tiktok-story-next {
    justify-content: flex-end;
    padding-right: 20px;
}

.tiktok-story-tagged-items {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.tiktok-tagged-item {
    position: absolute;
    background: var(--primary-color, #DC143C);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    pointer-events: all;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transform: translate(-50%, -50%);
}

.tiktok-tagged-item:hover {
    background: var(--primary-color, #DC143C);
}

.tiktok-story-badge {
    background: rgba(255, 193, 7, 0.9);
    color: #000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 5px;
}

.tiktok-pinned-badge {
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    z-index: 10003; /* Below header (10005) but above content */
    position: relative;
}

.tiktok-unread-badge {
    background: rgba(108, 117, 125, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* Community post styles */
.tiktok-community-post {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tiktok-post-media {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    background: #000;
    pointer-events: auto;
    z-index: 10;
    position: relative;
}

.tiktok-post-media video {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

/* Ensure video controls are clickable */
.tiktok-post-media:focus,
.tiktok-post-media video:focus {
    outline: none;
}

/* Story dots indicator */
.tiktok-story-dots-indicator {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    margin-top: 8px;
    pointer-events: auto;
    z-index: 20;
    position: relative;
}

.tiktok-story-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

.tiktok-story-dot.active {
    background: rgba(255, 255, 255, 1);
    width: 10px;
    height: 10px;
}

/* Wrapper for story media so overlay and dots position correctly */
.tiktok-story-item-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.tiktok-story-media-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0; /* allow flex child to shrink and center when content doesn't fill */
}

/* Center video in container when it doesn't fill width or height (letterbox/pillarbox) */
.tiktok-story-media-wrapper .tiktok-item-video,
.tiktok-story-media-wrapper .tiktok-item-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

/* When tap overlay is present, video must not capture taps - overlay handles left/center/right */
.tiktok-story-media-wrapper:has(.tiktok-story-tap-overlay) .tiktok-item-video {
    pointer-events: none;
}

/* Optional: subtle buffering state so user sees video is loading */
.tiktok-story-media-wrapper .tiktok-item-video.tiktok-video-buffering {
    opacity: 0.85;
}

/* Tap overlay: captures left/center/right tap for prev | pause/play | next - must be above video and below dots */
.tiktok-story-tap-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 10040;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation; /* allow tap without delay; don't let parent pan-y steal the touch */
}

/* Story dots at bottom of video - above bottom info overlay so they are visible */
.tiktok-story-dots-bottom {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    z-index: 10050;
    pointer-events: none;
}

.tiktok-story-dots-bottom .tiktok-story-dot {
    pointer-events: auto;
}

/* Tagged items container (like attributes) */
.tiktok-tagged-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tiktok-tagged-item-btn {
    background: var(--primary-color, #DC143C);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.tiktok-tagged-item-btn:hover {
    background: var(--primary-color, #DC143C);
    transform: scale(1.05);
}

/* Creator Profile Image - Make Circular */
.tiktok-author-profile img,
.tiktok-community-author-profile-img {
    border-radius: 50% !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Interactive Post Content Styles - no overlay; use full height */
.tiktok-post-interactive-content {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px 100px;
    background: linear-gradient(160deg, #2a2a2a 0%, #1a1a1a 100%);
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
}

/* Small badges (New/Pinned) on interactive cards - no full overlay */
.tiktok-interactive-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    pointer-events: none;
}

.tiktok-poll-container,
.tiktok-survey-container,
.tiktok-recipe-container {
    max-width: 700px;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 220px);
    background: rgba(0, 0, 0, 0.75);
    border-radius: 16px;
    padding: 20px 16px;
    color: white;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.tiktok-poll-question,
.tiktok-survey-title,
.tiktok-recipe-title {
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: white;
    flex-shrink: 0;
}

.tiktok-poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.tiktok-poll-option-item {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.tiktok-poll-option-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: color-mix(in srgb, var(--primary-color, #DC143C) 50%, transparent);
    transform: translateX(5px);
}

.tiktok-poll-option-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: color-mix(in srgb, var(--primary-color, #DC143C) 40%, transparent);
    transition: width 0.5s ease;
    z-index: 0;
}

.tiktok-poll-option-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tiktok-poll-option-text {
    font-size: 14px;
    font-weight: 500;
}

.tiktok-poll-option-percent {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color, #DC143C);
}

.tiktok-poll-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.tiktok-survey-description {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    font-size: 13px;
}

.tiktok-survey-button {
    width: 100%;
    padding: 15px 30px;
    background: var(--primary-color, #DC143C);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tiktok-survey-button:hover {
    background: #c82333;
    transform: scale(1.05);
}

.tiktok-recipe-section {
    margin-bottom: 12px;
}

.tiktok-recipe-section h4 {
    font-size: 0.95rem;
    font-weight: bold;
    margin-bottom: 6px;
    color: var(--primary-color, #DC143C);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tiktok-recipe-background {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tiktok-recipe-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.tiktok-recipe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.75) 50%, rgba(0, 0, 0, 0.85) 100%);
    z-index: 1;
}

.tiktok-recipe-content {
    position: relative;
    z-index: 2;
    width: 100%;
    flex: 1;
    padding: 12px 14px;
    color: white;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Two-column layout to fit ingredients + instructions in one view */
.tiktok-recipe-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
@media (max-width: 500px) {
    .tiktok-recipe-body {
        grid-template-columns: 1fr;
    }
}

.tiktok-recipe-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.tiktok-recipe-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
}

.tiktok-recipe-ingredients-list,
.tiktok-recipe-instructions-list {
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 10px;
    border-radius: 8px;
    line-height: 1.45;
    margin: 0;
    list-style-position: inside;
    font-size: 12px;
    overflow-y: auto;
    min-height: 0;
}

.tiktok-recipe-ingredients-list li,
.tiktok-recipe-instructions-list li {
    margin-bottom: 4px;
    padding-left: 6px;
}

.tiktok-survey-form {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.tiktok-survey-question {
    margin-bottom: 14px;
}

.tiktok-survey-question-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.tiktok-survey-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tiktok-survey-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tiktok-survey-option:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tiktok-survey-option input[type="radio"],
.tiktok-survey-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.tiktok-survey-text-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 16px;
}

.tiktok-survey-text-input:focus {
    outline: none;
    border-color: var(--primary-color, #DC143C);
    background: rgba(255, 255, 255, 0.15);
}

.tiktok-poll-option-item.voted {
    cursor: default;
}

.tiktok-item-badges-only {
    position: absolute;
    top: 60px; /* Below header (50px height) */
    left: 15px;
    z-index: 10003; /* Below header (10005) but above content */
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tiktok-survey-thanks {
    text-align: center;
    padding: 40px 20px;
}

.tiktok-survey-thanks i {
    font-size: 64px;
    color: #28a745;
    margin-bottom: 20px;
}

.tiktok-survey-thanks p {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.tiktok-survey-thanks small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Tagged Items Overlay on Video/Image Posts */
.tiktok-tagged-items-overlay {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    z-index: 10003; /* Below header (10005) but above content, visible */
    padding: 0 20px;
    pointer-events: none;
}

.tiktok-tagged-items-overlay .tiktok-tagged-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    pointer-events: auto;
}

.tiktok-tagged-items-overlay .tiktok-tagged-item-btn {
    background: var(--primary-color, #DC143C);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tiktok-tagged-items-overlay .tiktok-tagged-item-btn:hover {
    background: var(--primary-color, #DC143C);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Tab Content Visibility */
.tiktok-tab-content {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.tiktok-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* ========== Shop tab: expandable details, image thumbs, main image tap zones ========== */
.tiktok-shop-info .tiktok-info-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}
.tiktok-shop-info .tiktok-info-header h4 {
    margin: 0;
    flex: 1 1 100%;
    min-height: calc(1.25em * 2);
    max-height: calc(1.25em * 2);
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.tiktok-shop-info .tiktok-info-content {
    position: static;
    padding-bottom: 22px;
}
.tiktok-shop-info .tiktok-info-price {
    margin: 0;
}
.tiktok-shop-details-expandable {
    position: absolute;
    left: 20px;
    right: 140px;
    bottom: 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out, transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    transform: translateY(100%);
    pointer-events: none;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(12px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
    z-index: 3;
    touch-action: pan-y;
    contain: layout paint;
    will-change: transform;
    overflow-anchor: none;
}
.tiktok-shop-details-expandable.expanded,
.tiktok-shop-details-expandable.description-expanded {
    transform: translateY(0);
    pointer-events: auto;
}
.tiktok-shop-details-expandable::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.4);
    margin: 10px auto 8px;
    flex-shrink: 0;
}
.tiktok-shop-details-expandable .tiktok-info-description {
    margin-top: 0;
    padding: 0 20px 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    border-top: none;
    font-size: 0.95rem;
    line-height: 1.4;
    color: rgba(255,255,255,0.9);
    max-height: none;
    overflow-y: auto;
    white-space: normal;
}
.tiktok-shop-details-section + .tiktok-shop-details-section {
    margin-top: 14px;
}
.tiktok-shop-details-heading {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.68);
    margin-bottom: 6px;
}
.tiktok-shop-details-copy p {
    margin: 0;
}
.tiktok-shop-details-copy p + p {
    margin-top: 10px;
}
.tiktok-nutrition-panel {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    overflow: hidden;
}
.tiktok-nutrition-list {
    display: grid;
    gap: 0;
}
.tiktok-nutrition-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    line-height: 1.4;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tiktok-nutrition-row:last-child {
    border-bottom: none;
}
.tiktok-nutrition-label {
    color: rgba(255,255,255,0.78);
}
.tiktok-nutrition-value {
    color: #fff;
    text-align: right;
}
.tiktok-nutrition-group-title {
    padding: 10px 12px 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.68);
}
.tiktok-nutrition-subgroup {
    padding-left: 10px;
}
.tiktok-nutrition-group + .tiktok-nutrition-group {
    border-top: 1px solid rgba(255,255,255,0.08);
}
.tiktok-nutrition-row-depth-1,
.tiktok-nutrition-row-depth-2,
.tiktok-nutrition-row-depth-3 {
    padding-left: 16px;
}
.tiktok-shop-details-swipe-hint {
    margin-top: 14px;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    text-align: center;
}
#tiktok-scroller-info .tiktok-info-content:not(:has(.description-expanded))::after {
    content: 'Swipe up for details and nutrition';
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    padding: 8px 0 0;
    pointer-events: none;
}
.tiktok-shop-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    min-height: 100%;
    position: relative;
    width: 100%;
}
/* Blur fills entire card/screen background – one full-bleed layer, square corners, no clipping */
.tiktok-shop-bg-blur {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: visible;
    pointer-events: none;
    border-radius: 0 !important;
    margin: 0;
    padding: 0;
}
.tiktok-shop-bg-blur-img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    transform: translate(-50%, -50%) scale(1.5);
    filter: blur(28px);
    opacity: 0.85;
    object-fit: cover;
    object-position: center;
    border-radius: 0 !important;
}
/* Ensure no parent clips the blur */
.tiktok-embedded-panel-shop,
.tiktok-scroller-main,
#tiktok-embedded-panel-shop,
#tiktok-scroller-main {
    overflow: visible !important;
    border-radius: 0 !important;
}
.tiktok-embedded-panel-shop .tiktok-embedded-shop-main,
#tiktok-tab-shop .tiktok-scroller-main {
    overflow: visible !important;
}
.tiktok-shop-item .tiktok-shop-thumbs-above,
.tiktok-shop-item .tiktok-shop-main-wrap {
    position: relative;
    z-index: 1;
}
/* Ensure shop item and main image area fill and show the image */
#tiktok-embedded-scroller-items,
#tiktok-scroller-items {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    width: 100%;
}
#tiktok-embedded-scroller-items .tiktok-shop-item,
#tiktok-scroller-items .tiktok-shop-item {
    flex: 1;
    min-height: 0;
    width: 100%;
}
.tiktok-shop-item .tiktok-shop-main-wrap.tiktok-shop-single-wrap {
    flex: 1;
    min-height: 200px;
}
/* Current slide main image always visible (src set in HTML for first image) */
.tiktok-shop-single-wrap .tiktok-shop-slide.current .tiktok-shop-main-img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.tiktok-scroller-item.tiktok-shop-item.shop-3d-item-wrap {
    justify-content: center;
    align-items: center;
}
.tiktok-scroller-item.tiktok-shop-item.shop-3d-item-wrap .shop-3d-slider {
    flex: 0 0 auto;
}
.tiktok-shop-images-wrap {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.tiktok-shop-thumbs {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 6px 14px 10px;
    background: rgba(0,0,0,0.35);
    border-radius: 0;
}
/* Full-width thumbs bar just above main image (shop single-item view) */
.tiktok-shop-item .tiktok-shop-thumbs.tiktok-shop-thumbs-above {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    margin: 0;
    background: rgba(0,0,0,0.4);
    border-radius: 0;
}
.tiktok-shop-main-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    width: 100%;
    height: 100%;
}
.tiktok-shop-single-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tiktok-shop-single-wrap .tiktok-shop-slides {
    width: 100%;
    height: 100%;
    position: relative;
}
.tiktok-shop-single-wrap .tiktok-shop-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}
.tiktok-shop-single-wrap .tiktok-shop-slide.current {
    display: flex;
}
/* Main image full width */
.tiktok-shop-single-wrap .tiktok-shop-main-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    position: relative;
    z-index: 2;
    border: none;
    box-shadow: none;
    display: block;
}
.tiktok-shop-item .tiktok-shop-main-wrap.tiktok-shop-single-wrap {
    width: 100%;
    max-width: 100%;
}
.tiktok-shop-item .tiktok-shop-main-img,
.tiktok-shop-slide .tiktok-shop-main-img {
    border: none !important;
    box-shadow: none !important;
}
.tiktok-shop-single-wrap .tiktok-shop-main-tap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 3;
    cursor: pointer;
}
.tiktok-shop-single-wrap .tiktok-shop-tap-prev {
    left: 0;
}
.tiktok-shop-single-wrap .tiktok-shop-tap-next {
    right: 0;
}
.tiktok-shop-thumb {
    aspect-ratio: 1;
    border-radius: 0;
    overflow: hidden;
    border: 2px solid transparent;
    background: #222;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tiktok-shop-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
.tiktok-shop-thumb-current {
    border-color: var(--primary-color, #DC143C);
    box-shadow: 0 0 0 1px var(--primary-color, #DC143C);
}
.tiktok-shop-thumb-current-special {
    border-color: var(--primary-color, #DC143C);
    box-shadow: 0 0 0 1px var(--primary-color, #DC143C);
}
.tiktok-shop-main-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tiktok-shop-slides {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tiktok-shop-slide {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}
.tiktok-shop-slide.current {
    display: flex;
}
.tiktok-shop-slide.current .tiktok-shop-main-img,
.tiktok-shop-slide .tiktok-shop-main-img {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    box-sizing: border-box;
}
/* Single-item shop: main image full width, no rounded corners */
.tiktok-shop-single-wrap .tiktok-shop-slide .tiktok-shop-main-img {
    border-radius: 0 !important;
}
.tiktok-shop-main-tap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    z-index: 5;
    cursor: pointer;
}
.tiktok-shop-tap-prev { left: 0; }
.tiktok-shop-tap-next { right: 0; }

/* When filter is applied, reserve space so filter bar doesn't overlap content */
.tiktok-tab-content.tiktok-filter-active .tiktok-scroller-main {
    padding-top: 44px;
    box-sizing: border-box;
}

