/* =====================================================
   LIN XÉN – REELS (FINAL – STABLE)
   ===================================================== */

/* ===============================
   RESET / BASE
   =============================== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #000;
    overscroll-behavior: none;
}

.lx-reels-body {
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
}

/* ===============================
   GLOBAL VARS
   =============================== */
:root {
    --lx-reels-header-h: 52px;
    --lx-reels-product-bar-h: 144px;
}

/* ===============================
   HEADER REELS (FIXED)
   =============================== */
.lx-reels-header {
    position: fixed;
    top: 5px;
    left: 0;
    right: 0;
    height: var(--lx-reels-header-h);
    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 12px;
    color: #fff;
    font-weight: 800;

    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.6),
        rgba(0,0,0,0)
    );
}

/* ICON */
.lx-reels-icon {
    width: 36px;
    height: 36px;
    border-radius: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: none;
    border: none;
    color: #fff;
}

.lx-reels-icon svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
}

/* MODE SWITCH */
.lx-reels-mode {
    display: flex;
    gap: 16px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .1em;
}

.lx-reels-mode span {
    opacity: .45;
}

.lx-reels-mode span.active {
    opacity: 1;
}

/* RIGHT ACTIONS */
.lx-reels-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* CART BADGE */
.lx-reels-cart {
    position: relative;
}

.lx-reels-cart em {
    position: absolute;
    top: -5px;
    right: -6px;

    min-width: 18px;
    height: 18px;

    font-size: 11px;
    font-weight: 700;

    background: #ff3b30;
    color: #fff;
    border-radius: 9px;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===============================
   MAIN WRAPPER (ANCHOR – FINAL)
   =============================== */
/* ❌ KHÔNG DÙNG vh / calc */
.lx-reels-wrapper {
    position: fixed;
    top: var(--lx-reels-header-h);
    bottom: var(--lx-reels-product-bar-h);
    left: 0;
    right: 0;

    width: 100vw;
    overflow: hidden;
    background: #000;
}

/* ⚠️ KHÔNG CẦN padding-top NỮA */
.lx-reels-has-header {
    padding-top: 0;
    box-sizing: border-box;
}

/* ===============================
   SWIPER – VERTICAL
   =============================== */
.reels-vertical,
.reels-vertical .swiper-wrapper {
    height: 100%;
}

.reels-slide {
    height: 100%;
    position: relative;
    background: #000;
    overflow: hidden; /* 🔒 tuyệt đối không tràn */
}

/* ===============================
   IMAGE AREA (HORIZONTAL SWIPER)
   =============================== */
/* ❌ KHÔNG calc(100vh) */
.reels-images {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #000;
    overflow: hidden;
}

.reels-images .swiper-wrapper {
    height: 100%;
}

.reels-images .swiper-slide {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ===============================
   IMAGE FRAME – FULL BLEED (STABLE)
   =============================== */
.reels-image-frame {
    width: 100%;
    height: 100%;

    aspect-ratio: 4 / 5; /* fashion-friendly */

    display: flex;
    align-items: center;
    justify-content: center;

    background: #000;
    overflow: hidden;
}

/* ẢNH / VIDEO – TRÀN FULL, KHÔNG VỠ */
.reels-image-frame img,
.reels-image-frame video {
    width: 100%;
    height: 100%;

    object-fit: cover; /* 🔥 full bleed */
    display: block;
}


/* ===============================
   PRODUCT BAR (BOTTOM FIXED – FINAL)
   =============================== */
.lx-reels-product-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;

    min-height: 144px;
    max-height: 42vh;

    padding: 16px;

    display: flex;
    flex-direction: column;
    gap: 10px;

    background: linear-gradient(
        to top,
        rgba(0,0,0,.92),
        rgba(0,0,0,.65)
    );

    backdrop-filter: blur(12px);
    overflow-y: auto;
}

/* ===============================
   ROWS – STABLE
   =============================== */
.lx-reels-row {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.lx-reels-row-top {
    align-items: flex-start;
    min-height: 72px; /* 🔒 khóa chiều cao – chống xô thumb */
}

.lx-reels-row-meta {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.lx-reels-row-action {
    align-items: center;
    gap: 12px;
}

/* ===============================
   THUMB + SALE BADGE
   =============================== */
.lx-reels-thumb {
    position: relative;

    width: 64px;
    height: 64px;

    border-radius: 12px;
    overflow: hidden;
    background: #111;
    flex-shrink: 0;
}

.lx-reels-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* SALE BADGE – KHÔNG ẢNH HƯỞNG LAYOUT */
.lx-reels-sale-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    z-index: 2;

    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;

    color: #fff;
    background: linear-gradient(135deg, #ff3b30, #ff6a5c);

    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(255,59,48,.35);
    pointer-events: none;
}

/* ===============================
   PRODUCT MAIN (NAME + PRICE)
   =============================== */
.lx-reels-product-main {
    flex: 1;
    min-width: 0;
    color: #fff;
}

.lx-reels-product-main strong {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* PRICE INLINE – KHÓA KHÔNG REFLOW */
.lx-reels-price-inline {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 4px;
    white-space: nowrap; /* 🔥 không wrap – không đẩy layout */
}

.lx-reels-price {
    font-size: 15px;
    font-weight: 700;
    color: #E86A6A;
}

.lx-reels-price-old {
    font-size: 12px;
    color: rgba(255,255,255,.55);
    text-decoration: line-through;
}

/* DESC */
.lx-reels-desc {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(255,255,255,.75);
    line-height: 1.35;
}

/* ===============================
   META
   =============================== */
.lx-reels-tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,.15);
    color: #fff;
}

.lx-reels-attr {
    font-size: 12px;
    color: rgba(255,255,255,.7);
}

/* ===============================
   CTA – NORMALIZED (KHÔNG NHẢY)
   =============================== */
.lx-reels-btn-primary,
.lx-reels-btn-secondary {
    height: 46px;
    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    line-height: 1;

    border-radius: 24px;
    white-space: nowrap;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CTA CHÍNH */
.lx-reels-btn-primary {
    flex: 1;

    background: #fff;
    color: #000;

    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;

    border: none;
    cursor: pointer;
}

/* CTA PHỤ */
.lx-reels-btn-secondary {
    border: 1px solid rgba(255,255,255,.35);
    background: transparent;

    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

/* ===============================
   WISHLIST
   =============================== */
.lx-reels-wishlist-btn {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 18px;
    background: rgba(255,255,255,.15);
    color: #fff;

    border: none;
    flex-shrink: 0;
    font-size: 18px;
}

/* ===============================
   ACTION ICONS (NẾU DÙNG)
   =============================== */
.lx-reels-action-btn {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 24px;
    background: rgba(255,255,255,.95);
    border: none;
    color: #000;
}

.lx-reels-action-btn svg {
    width: 22px;
    height: 22px;
}
/* ===============================
   DESC INLINE – 1 LINE ONLY
   =============================== */
.lx-reels-desc-inline {
    margin-top: 4px;

    font-size: 12px;
    line-height: 1.3;
    color: rgba(255,255,255,.7);

    white-space: nowrap;       /* 🔒 chỉ 1 dòng */
    overflow: hidden;
    text-overflow: ellipsis;   /* … nếu dài */

    pointer-events: none;      /* không ảnh hưởng gesture */
}




/* HOVER / ACTIVE (desktop nhẹ nhàng) */
@media (hover:hover) {
    .lx-reels-btn-primary:hover {
        background: #f5f5f5;
    }

    .lx-reels-btn-secondary:hover {
        background:


/* ===============================
   MINI LOADING
   =============================== */
.lx-reels-mini-loading {
    position: absolute;
    top: calc(var(--lx-reels-header-h) + 4px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;

    display: flex;
    gap: 6px;
    padding: 6px 10px;

    border-radius: 14px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 12px;

    opacity: 0;
    pointer-events: none;
}

.lx-reels-mini-loading.active {
    opacity: 1;
}

/* ===============================
   UX POLISH
   =============================== */
.swiper-slide {
    -webkit-user-select: none;
    user-select: none;
}

button {
    -webkit-tap-highlight-color: transparent;
}

/* ===============================
   SAFE AREA (iOS)
   =============================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    :root {
        --lx-reels-product-bar-h: calc(144px + env(safe-area-inset-bottom));
    }

    .lx-reels-product-bar {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

