/* Thiết lập giao diện thân thiện với điện thoại */
        body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #fcf4f4; margin: 0; padding: 15px; }
        
        /* --- HEADER CÓ THANH TÌM KIẾM (SMART STICKY COMPACT) --- */
        .header { 
            background: #ffffff; 
            padding: 12px 18px; 
            border-radius: 16px; 
            box-shadow: 0 4px 20px rgba(232, 67, 147, 0.12); 
            margin-bottom: 18px; 
            position: sticky; 
            top: 8px; 
            z-index: 100; 
            border-bottom: 3px solid #fd79a8;
            transition: padding 0.25s ease, box-shadow 0.25s ease, margin 0.25s ease;
        }

        .header-top { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            margin-bottom: 10px; 
            gap: 12px;
            transition: all 0.25s ease;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
            flex: 1;
        }

        .brand-logo {
            height: 44px;
            width: 44px;
            border-radius: 50%;
            object-fit: cover;
            box-shadow: 0 2px 6px rgba(0,0,0,0.1);
            flex-shrink: 0;
            transition: height 0.25s ease, width 0.25s ease;
        }

        .brand-text {
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        .brand-slogan {
            font-size: 15px;
            color: #e84393;
            font-weight: 800;
            letter-spacing: -0.2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .brand-sub {
            font-size: 11px;
            color: #636e72;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Nút hành động nhanh trên header (Gom 1 hàng ngang siêu gọn) */
        .header-actions {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
        }

        .header-action-btn {
            border: none;
            padding: 7px 12px;
            border-radius: 999px;
            font-weight: 700;
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            white-space: nowrap;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }
        .header-action-btn:hover {
            transform: translateY(-1px);
        }

        .btn-action-free {
            background: linear-gradient(135deg, #ff7675, #e84393);
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(232, 67, 147, 0.35);
        }

        .btn-action-track {
            background: #f1f2f6;
            color: #0984e3;
            border: 1px solid #dff9fb;
        }
        .btn-action-track:hover {
            background: #e3f2fd;
        }

        .btn-action-cart {
            background: #00b894;
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(0, 184, 148, 0.35);
            padding: 7px 14px;
        }
        .btn-action-cart:hover {
            background: #00cec9;
        }

        .cart-pill-count {
            background: rgba(255, 255, 255, 0.25);
            padding: 1px 6px;
            border-radius: 10px;
            font-weight: 900;
            font-size: 12px;
        }
        .cart-pill-price {
            font-size: 11px;
            opacity: 0.95;
            margin-left: 2px;
        }

        /* Thanh công cụ phụ (Ký hiệu, Tính len, Kho Free) */
        .header-tools-bar {
            display: flex;
            gap: 6px;
            margin-top: 8px;
            justify-content: center;
            flex-wrap: wrap;
            transition: max-height 0.25s ease, opacity 0.25s ease, margin 0.25s ease;
            overflow: hidden;
            max-height: 40px;
            opacity: 1;
        }

        .tool-btn {
            background: #ffffff;
            color: #636e72;
            border: 1px solid #dfe6e9;
            padding: 5px 12px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .tool-btn:hover {
            border-color: #fd79a8;
            color: #e84393;
            background: #fff0f6;
        }

        /* ========================================================
           ✨ CHẾ ĐỘ THU GỌN KHI CUỘN TRANG (SMART STICKY COMPACT)
           ======================================================== */
        .header.header-compact {
            padding: 7px 14px;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(8px);
        }

        .header.header-compact .brand-sub {
            display: none;
        }

        .header.header-compact .brand-logo {
            height: 32px;
            width: 32px;
        }

        .header.header-compact .brand-slogan {
            font-size: 13px;
        }

        .header.header-compact .header-top {
            margin-bottom: 6px;
        }

        .header.header-compact .header-tools-bar {
            max-height: 0;
            opacity: 0;
            margin-top: 0;
            pointer-events: none;
        }

        .header.header-compact .category-filter {
            padding-top: 6px;
        }

        .header.header-compact .search-input {
            height: 38px;
            font-size: 13px;
            padding: 6px 14px;
        }
        
        .search-container { width: 100%; }
        .search-input { width: 100%; padding: 10px 15px; border: 1px solid #fd79a8; border-radius: 20px; outline: none; font-size: 15px; box-sizing: border-box; transition: 0.3s; background-color: #fff0f5;}
        .search-input:focus { box-shadow: 0 0 8px rgba(253, 121, 168, 0.4); background-color: #fff;}

        /* --- BẢNG HIỆU GIỚI THIỆU SHOP (HERO BANNER) --- */
        .hero-banner { background: linear-gradient(135deg, #ffeaa7 0%, #ffc3a0 100%); padding: 25px 20px; border-radius: 12px; text-align: center; margin-bottom: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
        .hero-banner h2 { color: #d63031; margin-top: 0; margin-bottom: 12px; font-size: 22px; }
        .hero-banner p { color: #2d3436; font-size: 15px; line-height: 1.6; margin-bottom: 15px; margin-top: 0;}
        .promo-badge { background: #fff; color: #d63031; font-size: 15px; font-weight: bold; padding: 8px 20px; border-radius: 20px; display: inline-block; animation: pulse 2s infinite; border: 2px dashed #ff7675;}
        @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
        @keyframes chartSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        /* --- HIỆU ỨNG NHÁY NHÁY NỔI BẬT CHO NÚT KHO CHART FREE (0đ) --- */
        @keyframes pulseFreeBtn {
            0% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(232, 67, 147, 0.8), 0 2px 8px rgba(232, 67, 147, 0.4);
            }
            50% {
                transform: scale(1.08);
                box-shadow: 0 0 0 12px rgba(232, 67, 147, 0), 0 4px 15px rgba(232, 67, 147, 0.6);
            }
            100% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(232, 67, 147, 0), 0 2px 8px rgba(232, 67, 147, 0.4);
            }
        }

        @keyframes blinkCategoryBtn {
            0%, 100% {
                background: #fff0f6;
                color: #e84393;
                border-color: #ff7675;
                transform: scale(1);
            }
            50% {
                background: linear-gradient(135deg, #ff7675, #e84393);
                color: #ffffff;
                border-color: #d63031;
                transform: scale(1.06);
                box-shadow: 0 2px 10px rgba(232, 67, 147, 0.5);
            }
        }

        .btn-free-blink {
            animation: pulseFreeBtn 1.4s infinite ease-in-out !important;
        }

        .category-btn-free-blink {
            animation: blinkCategoryBtn 1.6s infinite ease-in-out !important;
        }
        /* ----------------------------------------------- */

        .cart-container { text-align: right; }
        .cart-info { font-weight: 600; color: #2d3436; font-size: 14px; margin-bottom: 5px;}
        .cart-info span { color: #d63031; font-size: 16px; }
        
        /* CSS cho nút Thanh toán */
        .btn-checkout { background: #00b894; color: white; border: none; padding: 8px 15px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 14px;}
        .btn-checkout:hover { background: #00cec9; }
        
        /* Lưới hiển thị chart móc */
        .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
        .card { background: #ffffff; padding: 12px; border-radius: 12px; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: transform 0.2s;}
        .card:hover { transform: translateY(-3px); }
        
        /* Ảnh bình thường, hiển thị đầy đủ không bị cắt */
        .card img { 
            width: 100%; 
            height: 160px; 
            object-fit: contain; /* MỚI SỬA: Đổi từ cover sang contain để lấy trọn vẹn ảnh */
            border-radius: 8px; 
            background-color: #f1f2f6;
            transition: transform 0.3s ease; 
        }
        .card img:hover { transform: scale(1.03); }
        
        /* Tên chart được phép xuống dòng và bấm vào được */
        .chart-name { font-size: 15px; margin: 12px 0 8px; color: #2d3436; line-height: 1.4; word-wrap: break-word; cursor: pointer; transition: 0.2s; }
        .chart-name:hover { color: #e84393; text-decoration: underline; }
        .card p { color: #e84393; font-weight: bold; margin: 0 0 12px 0; }
        .btn-add { background: #fd79a8; color: #fff; border: none; padding: 10px; border-radius: 8px; cursor: pointer; width: 100%; font-weight: bold; font-size: 14px;}
        .btn-add:hover { background: #e84393; }
        
        .loading { text-align: center; color: #636e72; font-style: italic; width: 100%; grid-column: 1 / -1;}

        /* CSS cho Popup Thanh toán */
        .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999; justify-content: center; align-items: center; }
        .modal-content { 
            background: #fff; 
            padding: 25px; 
            border-radius: 12px; 
            width: 90%; 
            max-width: 400px; 
            text-align: center; 
            position: relative;
            max-height: 85vh; 
            overflow-y: auto; 
        }
        .close-btn { position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; color: #636e72;}
        .modal-content input { width: 90%; padding: 10px; margin: 15px 0; border: 1px solid #dfe6e9; border-radius: 8px; font-size: 14px;}
        #qr-code { max-width: 250px; display: none; margin: 10px auto; border: 2px dashed #fd79a8; padding: 10px; border-radius: 8px;}
        .btn-confirm { background: #e84393; color: white; border: none; padding: 12px; border-radius: 8px; width: 100%; font-weight: bold; cursor: pointer; font-size: 16px; margin-top: 10px;}

        /* CSS Danh sách Giỏ hàng */
        .cart-list { max-height: 180px; overflow-y: auto; margin: 15px 0; border-top: 1px solid #dfe6e9; border-bottom: 1px solid #dfe6e9; padding: 10px 0;}
        .cart-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 5px; border-bottom: 1px dashed #f1f2f6; font-size: 14px; text-align: left;}
        .cart-item:last-child { border-bottom: none; }
        .cart-item-name { color: #2d3436; font-weight: 500; }
        .cart-item-info { display: flex; align-items: center; }
        .cart-item-img { width: 45px; height: 45px; object-fit: cover; border-radius: 6px; margin-right: 12px; border: 1px solid #dfe6e9;}
        .btn-remove { color: #d63031; background: none; border: none; font-weight: bold; cursor: pointer; font-size: 13px;}
        
        /* CSS Nhắc nhở mua 5 tặng 1 */
        #promo-reminder { background: #e1f5fe; color: #0277bd; padding: 10px; border-radius: 8px; font-size: 14px; margin-bottom: 15px; border: 1px dashed #03a9f4; text-align: left; display: none;}

        /* CSS Bảng thông báo thành công */
        .icon-success { font-size: 50px; color: #00b894; margin-bottom: 10px;}
        .success-text { color: #2d3436; font-size: 15px; line-height: 1.5; margin-bottom: 20px;}
        .btn-close-success { background: #0984e3; color: white; border: none; padding: 10px 20px; border-radius: 8px; font-weight: bold; cursor: pointer;}

        /* CSS Phân trang thu gọn */
        .pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 25px; flex-wrap: wrap; }
        .page-btn { padding: 8px 12px; border: 1px solid #fd79a8; background: #fff; color: #fd79a8; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s;}
        .page-btn:hover:not(:disabled) { background: #ffeaa7; }
        .page-btn.active { background: #fd79a8; color: #fff; }
        .page-btn:disabled { opacity: 0.5; cursor: not-allowed; border-color: #dfe6e9; color: #b2bec3; }
        .page-dots { font-weight: bold; color: #636e72; padding: 0 5px;}

        /* CSS Popup Phóng to Ảnh */
        #img-viewer-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 200000; justify-content: center; align-items: center; }
        .img-viewer-content { max-width: 95%; max-height: 90vh; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.5); object-fit: contain;}
        .img-close-btn { position: absolute; top: 15px; right: 25px; color: #fff; font-size: 40px; font-weight: bold; cursor: pointer; transition: 0.2s;}
        .img-close-btn:hover { color: #fd79a8; }

        /* CSS Nút Chat Mặc Định (Cho Máy Tính) */
        .floating-contact {
            position: fixed;
            bottom: 25px;
            right: 25px;
            background-color: #0984e3;
            color: white;
            padding: 12px 20px;
            border-radius: 50px;
            font-weight: bold;
            font-size: 15px;
            text-decoration: none;
            box-shadow: 0 4px 15px rgba(9, 132, 227, 0.4);
            display: flex;
            align-items: center;
            gap: 8px;
            z-index: 1000;
            transition: 0.3s;
        }
        .floating-contact:hover {
            background-color: #0768b5;
            transform: translateY(-3px);
            color: white;
        }
        .chat-icon { font-size: 18px; }

        /* Tự động thu gọn trên màn hình Điện Thoại (dưới 600px) */
        @media (max-width: 600px) {
            .floating-contact {
                padding: 15px;
                border-radius: 50%; /* Bo tròn xoe */
                bottom: 20px;
                right: 20px;
            }
            .chat-text {
                display: none; /* Ẩn câu chữ đi cho gọn */
            }
            .chat-icon {
                font-size: 26px; /* Phóng to biểu tượng lên chút cho dễ bấm */
                margin: 0;
            }
            body {
                padding-bottom: 80px; /* Thêm gầm ở đáy trang để dễ cuộn qua phân trang */
            }
        }

        /* CSS NÚT NỔI ĐẾM HÀNG MÓC LEN (BÊN TRÁI MÀN HÌNH) */
        .floating-row-counter {
            position: fixed;
            bottom: 25px;
            left: 25px;
            background: linear-gradient(135deg, #6c5ce7, #a29bfe);
            color: white;
            padding: 12px 18px;
            border-radius: 50px;
            font-weight: bold;
            font-size: 14px;
            border: none;
            box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
            display: flex;
            align-items: center;
            gap: 8px;
            z-index: 1000;
            cursor: pointer;
            transition: 0.3s;
        }
        .floating-row-counter:hover {
            background: linear-gradient(135deg, #5b4cc4, #8c7ae6);
            transform: translateY(-3px);
            box-shadow: 0 6px 18px rgba(108, 92, 231, 0.5);
            color: white;
        }
        .counter-icon { font-size: 18px; }
        @media (max-width: 600px) {
            .floating-row-counter {
                padding: 12px 14px;
                border-radius: 30px;
                bottom: 20px;
                left: 15px;
                font-size: 13px;
            }
            .counter-text-long {
                display: none;
            }
        }

        /* 9:16 Vertical Video Mode */
        .video-container-vertical {
            padding-top: 0 !important;
            height: 65vh !important;
            max-height: 520px !important;
            width: auto !important;
            aspect-ratio: 9 / 16 !important;
            margin: 0 auto 14px auto !important;
        }
        /* --- BANNER KÊU GỌI LIKE FANPAGE --- */
        .fanpage-banner {
            background: #e3f2fd; 
            border: 2px dashed #74b9ff;
            border-radius: 12px;
            padding: 15px 20px;
            margin-bottom: 25px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }
        .fanpage-text h3 { margin: 0 0 5px 0; color: #0984e3; font-size: 16px; }
        .fanpage-text p { margin: 0; color: #2d3436; font-size: 14px; line-height: 1.5; }
        .btn-like-page {
            background: #0984e3;
            color: white;
            text-decoration: none;
            padding: 10px 20px;
            border-radius: 8px;
            font-weight: bold;
            font-size: 14px;
            white-space: nowrap;
            transition: 0.3s;
            margin-left: 15px;
            text-align: center;
            box-shadow: 0 4px 10px rgba(9, 132, 227, 0.3);
        }
        .btn-like-page:hover { background: #0768b5; transform: translateY(-2px); }

        /* Tự động gập gọn lại khi khách xem bằng Điện thoại */
        @media (max-width: 600px) {
            .fanpage-banner { flex-direction: column; text-align: center; }
            .btn-like-page { margin-left: 0; margin-top: 12px; width: 100%; box-sizing: border-box; }
        }
        .card { position: relative; } /* Để nhãn MỚI bám theo khung ảnh */
        .badge-new {
            position: absolute;
            top: 10px;
            left: 10px;
            background-color: #d63031; /* Màu đỏ nổi bật */
            color: white;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: bold;
            text-transform: uppercase;
            z-index: 10;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }

        .category-filter {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding-top: 12px;
            scrollbar-width: none;
        }

        .category-filter::-webkit-scrollbar {
            display: none;
        }

        .category-btn {
            border: 1px solid #fd79a8;
            background: #fff;
            color: #e84393;
            padding: 8px 14px;
            border-radius: 999px;
            font-weight: 700;
            font-size: 13px;
            white-space: nowrap;
            cursor: pointer;
        }

        .category-btn.active {
            background: #fd79a8;
            color: #fff;
        }

        /* ===== NÂNG CẤP MOBILE UI ===== */

        body {
            padding: 10px;
            background: linear-gradient(180deg, #fff7fb 0%, #fcf4f4 100%);
        }

        .header {
            top: 8px;
            padding: 14px;
            border-radius: 18px;
            border-bottom: 3px solid #fd79a8;
        }

        .header-top {
            gap: 12px;
        }

        .brand img {
            height: 52px !important;
        }

        .brand span {
            font-size: 15px !important;
            line-height: 1.35;
        }

        .cart-container {
            min-width: 125px;
        }

        .cart-info {
            font-size: 13px;
            line-height: 1.4;
        }

        .btn-checkout,
        .cart-container button {
            width: 100%;
            margin-top: 6px;
        }

        .search-input {
            height: 46px;
            font-size: 15px;
            border-radius: 999px;
        }

        .hero-banner {
            padding: 22px 16px;
            border-radius: 18px;
        }

        .hero-banner h2 {
            font-size: 20px;
            line-height: 1.4;
        }

        .hero-banner p {
            font-size: 15px;
        }

        .promo-badge {
            border-radius: 16px;
            line-height: 1.5;
        }

        .fanpage-banner {
            border-radius: 18px;
        }

        .grid {
            grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
            gap: 14px;
        }

        .card {
            border-radius: 18px;
            padding: 10px;
            box-shadow: 0 8px 20px rgba(232, 67, 147, 0.08);
        }

        .card img {
            height: 150px;
            border-radius: 14px;
        }

        .chart-name {
            min-height: 42px;
            font-size: 14px;
            font-weight: 700;
        }

        .btn-add {
            border-radius: 12px;
            min-height: 42px;
        }

        @media (max-width: 600px) {
            .header {
                padding: 10px 12px;
                top: 4px;
                margin-bottom: 14px;
            }

            .header-top {
                display: flex;
                justify-content: space-between;
                align-items: center;
                gap: 8px;
            }

            .brand-logo {
                height: 38px;
                width: 38px;
            }

            .brand-slogan {
                font-size: 13px;
            }

            .brand-sub {
                display: none;
            }

            .header-action-btn {
                padding: 6px 9px;
                font-size: 11px;
            }

            .header-action-btn span:not(.cart-pill-count):not(.cart-pill-price) {
                display: none; /* Trên màn hình điện thoại bé chỉ hiện icon để không chật */
            }

            .btn-action-free span,
            .btn-action-track span {
                display: inline !important;
                font-size: 10px;
            }

            .cart-pill-price {
                display: none; /* Trên mobile chỉ hiện số lượng chart trong giỏ để siêu gọn */
            }

            .header.header-compact {
                padding: 6px 10px;
            }

            .header.header-compact .brand-logo {
                height: 28px;
                width: 28px;
            }

            .header.header-compact .header-action-btn {
                padding: 4px 8px;
            }

            .hero-banner {
                margin-bottom: 16px;
            }

            .grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        .toast {
            position: fixed;
            left: 50%;
            bottom: 90px;
            transform: translateX(-50%);
            background: #2d3436;
            color: #fff;
            padding: 10px 16px;
            border-radius: 999px;
            font-size: 14px;
            font-weight: 600;
            z-index: 20000;
            opacity: 0;
            pointer-events: none;
            transition: 0.25s ease;
        }

        .toast.show {
            opacity: 1;
            bottom: 105px;
        }

        .cart-info {
            background: #fff0f6;
            border: 1px solid #ffd6e8;
            border-radius: 12px;
            padding: 8px 10px;
        }

        .cart-info span {
            font-weight: 900;
        }

        /* ===== SỬA NÚT CHAT KHÔNG BỊ TRÀN ===== */

        /* Màn hình lớn: hiện dạng nút dài đầy đủ chữ */
        .floating-contact {
            width: auto;
            max-width: 260px;
            height: auto;
            padding: 12px 18px;
            border-radius: 999px;
            justify-content: center;
            white-space: nowrap;
        }

        .chat-text {
            display: inline;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .chat-icon {
            flex-shrink: 0;
        }

        /* Màn hình nhỏ: chỉ hiện icon tròn */
        @media (max-width: 768px) {
            .floating-contact {
                width: 58px;
                height: 58px;
                padding: 0;
                border-radius: 50%;
                right: 18px;
                bottom: 18px;
            }

            .chat-text {
                display: none;
            }

            .chat-icon {
                font-size: 26px;
                margin: 0;
            }
        }

        /* ===== SỬA POPUP GIỎ HÀNG: NÚT TẠO QR LUÔN HIỆN Ở DƯỚI ===== */

        #checkout-modal .checkout-content {
            width: 90%;
            max-width: 480px;
            max-height: calc(100vh - 40px);
            padding: 24px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .checkout-title {
            color: #e84393;
            margin: 0 0 12px 0;
            font-size: 22px;
            flex-shrink: 0;
        }

        .checkout-scroll-area {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding-right: 6px;
            margin-bottom: 12px;
        }

        #checkout-modal .cart-list {
            max-height: none;
            overflow: visible;
            margin: 0 0 12px 0;
        }

        .checkout-bottom {
            flex-shrink: 0;
            background: #fff;
            border-top: 1px solid #f1f2f6;
            padding-top: 12px;
            box-shadow: 0 -8px 18px rgba(255, 255, 255, 0.95);
        }

        #checkout-modal .checkout-bottom input {
            width: 100% !important;
            box-sizing: border-box;
            padding: 12px;
            margin: 0 0 10px 0 !important;
            border-radius: 10px;
            border: 1px solid #ddd;
            font-size: 16px;
        }

        #checkout-modal #qr-code {
            max-width: 180px;
            max-height: 180px;
            display: none;
            margin: 8px auto;
            border: 2px dashed #fd79a8;
            padding: 8px;
            border-radius: 10px;
            box-sizing: border-box;
        }

        #checkout-modal #qr-instruction {
            display: none;
            color: #2d3436;
            font-size: 13px;
            margin: 4px 0 8px 0;
            text-align: center;
        }

        #checkout-modal #btn-action {
            width: 100%;
            margin-top: 8px;
            min-height: 48px;
            border-radius: 12px;
            font-size: 17px;
            box-shadow: 0 6px 16px rgba(232, 67, 147, 0.25);
        }

        @media (max-width: 600px) {
            #checkout-modal .checkout-content {
                width: 94%;
                max-height: calc(100vh - 24px);
                padding: 18px;
            }

            .checkout-title {
                font-size: 20px;
            }

            #checkout-modal #qr-code {
                max-width: 150px;
                max-height: 150px;
            }

            #checkout-modal .checkout-bottom input {
                font-size: 15px;
                padding: 11px;
            }

            #checkout-modal #btn-action {
                min-height: 46px;
                font-size: 16px;
            }
        }

        /* ===== BẢNG THÔNG BÁO RIÊNG, THAY CHO ALERT ===== */

        .notice-modal {
            z-index: 2000000 !important;
            background: rgba(45, 52, 54, 0.65);
        }

        .notice-box {
            width: 90%;
            max-width: 360px;
            background: #fff;
            border-radius: 22px;
            padding: 26px 22px 22px;
            text-align: center;
            position: relative;
            box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
            animation: noticePop 0.22s ease;
        }

        @keyframes noticePop {
            from {
                transform: scale(0.92);
                opacity: 0;
            }
            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .notice-close {
            position: absolute;
            top: 10px;
            right: 14px;
            border: none;
            background: transparent;
            font-size: 28px;
            color: #636e72;
            cursor: pointer;
        }

        .notice-icon {
            width: 62px;
            height: 62px;
            margin: 0 auto 12px;
            border-radius: 50%;
            background: #fff0f6;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 32px;
        }

        .notice-box h3 {
            margin: 0 0 10px;
            color: #e84393;
            font-size: 21px;
        }

        .notice-box p {
            margin: 0;
            color: #2d3436;
            font-size: 15px;
            line-height: 1.6;
        }

        .notice-ok {
            margin-top: 20px;
            width: 100%;
            border: none;
            background: #e84393;
            color: white;
            padding: 13px 18px;
            border-radius: 14px;
            font-weight: 800;
            font-size: 16px;
            cursor: pointer;
            box-shadow: 0 8px 18px rgba(232, 67, 147, 0.28);
        }

        .notice-ok:hover {
            background: #d63384;
        }

        /* ===== GIỮ GỢI Ý + SỐ TIỀN + NÚT QR LUÔN HIỆN Ở CUỐI POPUP ===== */

        #checkout-modal .checkout-content {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        #checkout-modal .checkout-scroll-area {
            flex: 1;
            min-height: 90px;
            overflow-y: auto;
            padding-right: 6px;
            margin-bottom: 10px;
        }

        #checkout-modal .checkout-bottom {
            flex-shrink: 0;
            background: #fff;
            border-top: 1px solid #f1f2f6;
            padding-top: 10px;
            box-shadow: 0 -10px 22px rgba(255, 255, 255, 0.96);
        }

        /* Gợi ý luôn gọn */
        #checkout-modal #promo-reminder {
            display: none;
            margin: 0 0 8px 0;
            padding: 8px 10px;
            border-radius: 10px;
            font-size: 14px;
            line-height: 1.45;
            text-align: left;
        }

        /* Số lượng + tiền luôn hiện rõ */
        #checkout-modal #checkout-summary {
            margin: 0 0 10px 0;
            padding: 8px 10px;
            background: #fff0f6;
            border: 1px solid #ffd6e8;
            border-radius: 12px;
            text-align: center;
            color: #2d3436;
            font-size: 16px;
            line-height: 1.45;
        }

        #checkout-modal #checkout-summary b {
            font-weight: 900;
        }

        /* Input gọn lại để QR vẫn nằm trong màn hình */
        #checkout-modal .checkout-bottom input {
            width: 100% !important;
            box-sizing: border-box;
            padding: 11px 12px;
            margin: 0 0 8px 0 !important;
            border-radius: 10px;
            border: 1px solid #ddd;
            font-size: 15px;
        }

        /* QR gọn hơn để không đẩy nút xuống dưới */
        #checkout-modal #qr-code {
            max-width: 145px;
            max-height: 145px;
            display: none;
            margin: 6px auto;
            border: 2px dashed #fd79a8;
            padding: 6px;
            border-radius: 10px;
            box-sizing: border-box;
        }

        #checkout-modal #qr-instruction {
            display: none;
            color: #2d3436;
            font-size: 13px;
            margin: 4px 0 7px 0;
            text-align: center;
        }

        #checkout-modal #btn-action {
            width: 100%;
            min-height: 48px;
            margin-top: 4px;
            border-radius: 12px;
            font-size: 17px;
        }

        /* Mobile: nén thêm một chút */
        @media (max-width: 600px) {
            #checkout-modal .checkout-scroll-area {
                min-height: 70px;
                margin-bottom: 8px;
            }

            #checkout-modal #promo-reminder {
                font-size: 13px;
                padding: 7px 9px;
            }

            #checkout-modal #checkout-summary {
                font-size: 15px;
                padding: 7px 9px;
                margin-bottom: 8px;
            }

            #checkout-modal .checkout-bottom input {
                padding: 10px 11px;
                font-size: 14px;
                margin-bottom: 7px !important;
            }

            #checkout-modal #qr-code {
                max-width: 125px;
                max-height: 125px;
            }

            #checkout-modal #btn-action {
                min-height: 45px;
                font-size: 15px;
            }
        }

        /* ===== ĐẨY NÚT "TÔI ĐÃ CHUYỂN KHOẢN XONG" LÊN MỘT CHÚT ===== */

        #checkout-modal .checkout-bottom {
            padding-bottom: 18px;
        }

        /* Thu QR lại nhẹ để nút không bị đẩy xuống */
        #checkout-modal #qr-code {
            max-width: 115px;
            max-height: 115px;
            margin: 4px auto;
        }

        /* Giảm khoảng cách chữ hướng dẫn */
        #checkout-modal #qr-instruction {
            margin: 2px 0 6px 0;
            font-size: 13px;
        }

        /* Đảm bảo nút luôn cách đáy popup */
        #checkout-modal #btn-action {
            margin-top: 6px;
            margin-bottom: 6px;
            min-height: 46px;
        }

        /* ===== FIX CUỐI: GIỎ HÀNG LUÔN HIỆN GỢI Ý + TIỀN + QR + NÚT ===== */

        #checkout-modal {
            align-items: center;
        }

        #checkout-modal .checkout-content {
            width: 90%;
            max-width: 520px;
            max-height: calc(100dvh - 120px);
            padding: 20px 24px 18px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        #checkout-modal .checkout-title {
            margin: 0 0 10px;
            font-size: 22px;
            flex-shrink: 0;
        }

        #checkout-modal .checkout-scroll-area {
            flex: 1;
            min-height: 70px;
            max-height: 150px;
            overflow-y: auto;
            margin-bottom: 10px;
            padding-right: 6px;
        }

        #checkout-modal .checkout-bottom {
            flex-shrink: 0;
            padding-top: 8px;
            padding-bottom: 0;
            background: #fff;
            border-top: 1px solid #f1f2f6;
        }

        #checkout-modal #promo-reminder {
            margin: 0 0 8px;
            padding: 8px 10px;
            font-size: 14px;
            line-height: 1.35;
        }

        #checkout-modal #checkout-summary {
            margin: 0 0 8px;
            padding: 8px 10px;
            font-size: 16px;
            line-height: 1.35;
        }

        #checkout-modal .checkout-bottom input {
            height: 42px;
            padding: 8px 12px !important;
            margin: 0 0 7px !important;
            font-size: 15px;
        }

        #checkout-modal #qr-code {
            max-width: 105px;
            max-height: 105px;
            margin: 4px auto;
            padding: 5px;
        }

        #checkout-modal #qr-instruction {
            margin: 3px 0 6px;
            font-size: 13px;
            line-height: 1.3;
        }

        #checkout-modal #btn-action {
            display: block;
            width: 100%;
            min-height: 46px;
            margin: 4px 0 0;
            border-radius: 12px;
            font-size: 16px;
        }

        /* Màn hình thấp như laptop 13 inch */
        @media (max-height: 760px) {
            #checkout-modal .checkout-content {
                max-height: calc(100dvh - 90px);
                padding-top: 16px;
                padding-bottom: 14px;
            }

            #checkout-modal .checkout-scroll-area {
                max-height: 95px;
            }

            #checkout-modal #qr-code {
                max-width: 90px;
                max-height: 90px;
            }

            #checkout-modal #promo-reminder {
                font-size: 13px;
                padding: 7px 9px;
            }

            #checkout-modal #checkout-summary {
                font-size: 15px;
                padding: 7px 9px;
            }

            #checkout-modal .checkout-bottom input {
                height: 39px;
                margin-bottom: 6px !important;
            }

            #checkout-modal #btn-action {
                min-height: 44px;
            }
        }

        /* --- BONG BÓNG MUA HÀNG ẢO (SOCIAL PROOF TOAST) --- */
        .social-proof-toast {
            position: fixed;
            bottom: 80px;
            left: 20px;
            z-index: 10002;
            display: flex;
            align-items: center;
            gap: 12px;
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1.5px solid #ffccd5;
            border-radius: 14px;
            padding: 9px 14px;
            box-shadow: 0 10px 28px rgba(232, 67, 147, 0.2), 0 2px 8px rgba(0, 0, 0, 0.06);
            max-width: 320px;
            transform: translateY(140px) scale(0.92);
            opacity: 0;
            pointer-events: none;
            transition: all 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            font-family: inherit;
        }
        .social-proof-toast.show {
            transform: translateY(0) scale(1);
            opacity: 1;
            pointer-events: auto;
        }
        .social-proof-img {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            object-fit: cover;
            border: 1.5px solid #ffd1dc;
            flex-shrink: 0;
            background: #fff5f8;
        }
        .social-proof-content {
            flex: 1;
            font-size: 12px;
            line-height: 1.35;
            color: #2d3436;
        }
        .social-proof-buyer {
            font-weight: 700;
            color: #2d3436;
        }
        .social-proof-loc {
            color: #636e72;
            font-size: 11px;
        }
        .social-proof-prod {
            color: #d63031;
            font-weight: 700;
            display: block;
            margin-top: 1px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 200px;
        }
        .social-proof-time {
            font-size: 10.5px;
            color: #00b894;
            display: flex;
            align-items: center;
            gap: 3px;
            margin-top: 2px;
            font-weight: 600;
        }
        .social-proof-close {
            background: none;
            border: none;
            color: #b2bec3;
            font-size: 16px;
            cursor: pointer;
            padding: 2px 4px;
            line-height: 1;
            border-radius: 50%;
            transition: 0.2s;
            align-self: flex-start;
        }
        .social-proof-close:hover {
            color: #d63031;
            background: #ffeaa7;
        }
        @media (max-width: 600px) {
            .social-proof-toast {
                bottom: 74px;
                left: 12px;
                max-width: calc(100vw - 24px);
                padding: 8px 12px;
                gap: 10px;
            }
            .social-proof-img {
                width: 38px;
                height: 38px;
            }
            .social-proof-prod {
                max-width: 170px;
            }
        }

        /* --- NÚT NỔI HỘP QUÀ MAY MẮN (FLOATING GIFT BUTTON) --- */
        .floating-gift-btn {
            position: fixed;
            bottom: 85px;
            right: 25px;
            z-index: 9999;
            background: linear-gradient(135deg, #ff7675, #e84393);
            color: white;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            box-shadow: 0 6px 20px rgba(232, 67, 147, 0.45);
            cursor: pointer;
            border: 2px solid #ffffff;
            animation: giftWiggle 3s infinite ease-in-out;
            transition: transform 0.25s ease;
        }
        .floating-gift-btn:hover {
            transform: scale(1.15) rotate(-6deg);
        }
        .floating-gift-badge {
            position: absolute;
            top: -4px;
            right: -4px;
            background: #ffeaa7;
            color: #d63031;
            font-size: 9px;
            font-weight: 800;
            padding: 2px 6px;
            border-radius: 10px;
            border: 1px solid #fab1a0;
            white-space: nowrap;
        }
        @keyframes giftWiggle {
            0%, 75%, 100% { transform: scale(1) rotate(0deg); }
            80% { transform: scale(1.1) rotate(-10deg); }
            85% { transform: scale(1.1) rotate(10deg); }
            90% { transform: scale(1.1) rotate(-8deg); }
            95% { transform: scale(1.1) rotate(6deg); }
        }
        @media (max-width: 600px) {
            .floating-gift-btn {
                bottom: 80px;
                right: 20px;
                width: 44px;
                height: 44px;
                font-size: 22px;
            }
        }

        /* --- MODAL HỘP QUÀ MAY MẮN CHÀO BẠN MỚI --- */
        #first-gift-modal {
            display: none;
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.65);
            z-index: 100010;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            padding: 16px;
            box-sizing: border-box;
        }
        .gift-box-card {
            background: #ffffff;
            border-radius: 24px;
            padding: 28px 22px;
            max-width: 400px;
            width: 100%;
            text-align: center;
            position: relative;
            box-shadow: 0 20px 60px rgba(232, 67, 147, 0.35);
            border: 3px solid #ffd1dc;
            animation: giftPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            overflow: hidden;
        }
        @keyframes giftPop {
            0% { transform: scale(0.7); opacity: 0; }
            100% { transform: scale(1); opacity: 1; }
        }
        .gift-hero-icon {
            font-size: 64px;
            margin-bottom: 6px;
            display: inline-block;
            cursor: pointer;
            filter: drop-shadow(0 8px 16px rgba(232, 67, 147, 0.4));
            animation: bounceGift 1.8s infinite ease-in-out;
            transition: transform 0.3s;
        }
        .gift-hero-icon:hover {
            transform: scale(1.2);
        }
        @keyframes bounceGift {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px) scale(1.05); }
        }
        .gift-voucher-ticket {
            background: linear-gradient(135deg, #fff5f8, #fff0f3);
            border: 2px dashed #ff7675;
            border-radius: 14px;
            padding: 14px 16px;
            margin: 16px 0;
            position: relative;
        }
        .gift-code-badge {
            display: inline-block;
            background: linear-gradient(135deg, #e84393, #d63031);
            color: #ffffff;
            font-size: 19px;
            font-weight: 900;
            letter-spacing: 2px;
            padding: 6px 18px;
            border-radius: 25px;
            box-shadow: 0 4px 12px rgba(232, 67, 147, 0.4);
            margin: 6px 0;
            cursor: pointer;
            user-select: all;
        }
        #gift-confetti-canvas {
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            pointer-events: none;
            z-index: 100015;
            display: none;
        }