.sbmalpha-fixed-header {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.sbmalpha-bg-toggle {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #e5e7eb;
    color: #374151;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}
.sbmalpha-bg-toggle svg { width: 20px; height: 20px; }
.sbmalpha-bg-toggle:hover { transform: scale(1.05); background-color: #fff; }

.sbm-cart-button-wrapper { position: relative; }
.sbm-cart-button { background-color: rgba(255, 255, 255, 0.8); border: 1px solid #e5e7eb; color: #374151; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: all 0.2s ease; text-decoration: none; }
.sbm-cart-button:hover { transform: scale(1.1); }
.sbm-cart-count { position: absolute; top: -5px; right: -5px; background-color: var(--sbm-primary-color); color: white; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; font-weight: bold; display: flex; align-items: center; justify-content: center; border: 2px solid white; }

.sbm-mini-cart { display: none; position: absolute; top: calc(100% + 10px); right: 0; width: 380px; background-color: white; border-radius: 12px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); overflow: hidden; opacity: 0; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease; z-index: 1000; }
.sbm-cart-button-wrapper.is-active .sbm-mini-cart { display: block; opacity: 1; transform: translateY(0); }
.sbm-mini-cart-header { padding: 1rem 1.25rem; font-size: 1.1rem; font-weight: 600; border-bottom: 1px solid #f3f4f6; color: #111827; }
.sbm-mini-cart-body { max-height: 320px; overflow-y: auto; padding: 0.5rem 0; }
.sbm-mini-cart-item { display: flex; align-items: flex-start; padding: 1rem 1.25rem; gap: 1rem; }
.sbm-mini-cart-item:not(:last-child) { border-bottom: 1px solid #f3f4f6; }
.sbm-mini-cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; }
.sbm-mini-cart-item-details { flex-grow: 1; font-size: 0.95rem; }
.sbm-mini-cart-item-name { font-weight: 500; color: #1f2937; line-height: 1.4; text-decoration: none; }
.sbm-mini-cart-item-price { font-size: 0.9rem; color: #4b5563; }
.sbm-mini-cart-item-remove { font-size: 1rem; color: #9ca3af; text-decoration: none; background-color: #f3f4f6; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.2s; flex-shrink: 0; cursor: pointer; }
.sbm-mini-cart-item-remove:hover { color: #ef4444; background-color: #fee2e2; }
.sbm-mini-cart-footer { padding: 1.25rem; background-color: #f9fafb; border-top: 1px solid #f3f4f6; }
.sbm-mini-cart-subtotal { display: flex; justify-content: space-between; font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; color: #111827; }
.sbm-mini-cart-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.sbm-mini-cart-button { display: block; text-align: center; padding: 0.8rem; border-radius: 8px; text-decoration: none; font-weight: 600; transition: all 0.2s; border: 1px solid transparent; }
.sbm-mini-cart-button.view-cart { background-color: #fff; color: #374151; border-color: #d1d5db; }
.sbm-mini-cart-button.checkout { background-color: var(--sbm-primary-color); color: white; }
.sbm-mini-cart-empty { padding: 2.5rem 1.25rem; text-align: center; color: #6b7280; font-size: 0.95rem; }
.fly-to-cart-image { position: fixed; z-index: 99999; border-radius: 50%; transition: all 0.7s cubic-bezier(0.5, 0, 1, 0.5); object-fit: cover; }

/* [FIX] Canh hàng icon và chữ cho nút Mua Nhanh trong Mini-Cart */
#sbm-mini-cart-buy-now-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* === THANH TIẾN TRÌNH VOUCHER (MINI CART) === */
.sbm-mini-cart-progress-wrapper {
    padding: 12px 1.25rem;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}

.sbm-mini-cart-progress-text {
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.sbm-mini-cart-progress-text b {
    color: var(--sbm-primary-color);
}

.sbm-mini-cart-progress-bar {
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

/* === [FIX MOBILE] Căn giữa Giỏ hàng Mini === */
@media (max-width: 768px) {
    .sbm-mini-cart {
        position: fixed; /* Cố định vào màn hình thay vì dính vào nút */
        top: 80px;       /* Cách mép trên một khoảng vừa đủ dưới header */
        left: 50%;       /* Đẩy sang giữa */
        right: auto;     /* Bỏ căn phải */
        width: 94%;      /* Chiếm 94% chiều rộng màn hình */
        max-width: 400px; /* Không quá rộng trên tablet */
        
        /* Quan trọng: Căn giữa chính xác và đặt trạng thái ẩn ban đầu */
        transform: translate(-50%, 10px); 
        
        /* Thêm giới hạn chiều cao để không bị tràn màn hình nếu nhiều đồ */
        max-height: 70vh; 
        overflow-y: auto;
    }

    /* Khi giỏ hàng mở ra */
    .sbm-cart-button-wrapper.is-active .sbm-mini-cart {
        /* Giữ căn giữa (-50%) và trượt lên vị trí chuẩn (0) */
        transform: translate(-50%, 0); 
    }
}

.sbm-mini-cart-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444); /* Gradient Vàng -> Đỏ */
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Trạng thái hoàn thành */
.sbm-mini-cart-progress-wrapper.completed .sbm-mini-cart-progress-fill {
    background: #10b981; /* Xanh lá */
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}
.sbm-mini-cart-progress-wrapper.completed .sbm-mini-cart-progress-text {
    color: #059669;
    justify-content: center;
}