.contact-buttons {
    position: fixed;
    right: 20px;
    bottom: 250px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

/* Mỗi item */
.contact-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Icon tròn */
.contact-btn {
    border-radius: 50%;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-btn img {
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
}

.contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

/* Tooltip hiển thị text */
.contact-tooltip {
    position: absolute;
    right: 70px; /* cách icon */
    background: #0284c7;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(10px);
}

/* Mũi tên nhỏ */
.contact-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -8px; /* đẩy mũi tên ra sát icon */
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #0284c7; /* màu trùng background tooltip */
}

.contact-item:hover .contact-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* SALE OFF */
.tooltip-sale {
    background: #f97316; /* cam đỏ */
}
.tooltip-sale::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #f97316;
}

/* ZALO */
.tooltip-zalo {
    background: #007aff; /* xanh zalo */
}
.tooltip-zalo::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #007aff;
}

/* PHONE */
.tooltip-phone {
    background: #22c55e; /* xanh lá */
}
.tooltip-phone::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #22c55e;
}

.sale-off-btn {
    position: fixed;
    bottom: 50px;    /* chỉnh khoảng cách từ bottom */
    left: 40px;      /* cách cạnh trái */
    z-index: 9999;
    width: 60px;     /* full width icon */
    height: 60px;
}

/* Link chính */
.sale-off-link {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 15px 4px rgba(255, 215, 0, 0.7); /* phát sáng vàng */
    animation: glow 0.8s infinite ease-in-out; /* nhanh và rõ hơn */
}

/* Ảnh icon */
.sale-off-link img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 50%;
}

/* Badge số lượng */
.sale-off-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc2626; /* đỏ */
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    border-radius: 50%;
    padding: 4px 7px;
    min-width: 20px;
    text-align: center;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Hiệu ứng phát sáng vàng */
@keyframes glow {
    0% {
        box-shadow: 0 0 4px 1px rgba(255, 215, 0, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 12px 3px rgba(255, 215, 0, 0.9);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 4px 1px rgba(255, 215, 0, 0.5);
        transform: scale(1);
    }
}

/* Tooltip */
.sale-off-tooltip {
    position: absolute;
    left: 75px; /* cách icon 1 chút */
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #1d4ed8; /* xanh đậm */
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Mũi tên */
.sale-off-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #1d4ed8;
}

/* Hover hiển thị tooltip */
.sale-off-btn:hover .sale-off-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Popup mặc định ẩn */
.sale-off-popup {
    position: fixed;
    bottom: 50px;
    left: 40px;
    width: 400px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 9999999999;
    transform: translateX(-120%); /* ẩn sang trái */
    transition: transform 0.3s ease;
}

.sale-off-popup.active {
    display: flex;
    transform: translateX(0); /* trượt vào */
}

/* Header */
.sale-off-popup .popup-header {
    background: #0284c7;
    color: #fff;
    padding: 12px;
    font-weight: bold;
    font-size: 16px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sale-off-popup .popup-close {
    background: transparent;
    border: none;
    font-size: 22px;
    color: #fff;
    cursor: pointer;
}

/* Nội dung sản phẩm */
.popup-content {
    padding: 10px;
    max-height: 500px;
    overflow-y: auto;
}

/* Custom Scrollbar trong content */
.popup-content::-webkit-scrollbar {
    width: 6px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.popup-item {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    gap: 10px;
}

.popup-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}


.popup-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.item-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: bold;
}

.item-info p {
    margin: 2px 0 0;
    font-size: 13px;
    color: #666;
    display: -webkit-box;             /* Dùng box model của WebKit */
    -webkit-box-orient: vertical;     /* Xếp theo chiều dọc */
    -webkit-line-clamp: 2;            /* Giới hạn 2 dòng */
    overflow: hidden;                 /* Ẩn phần dư */
    text-overflow: ellipsis;          /* Thêm dấu ... */
}

/* Badge HOT */
.badge-hot {
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
}

/* Overlay nền mờ */
.sale-off-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5); /* màu đen trong suốt */
    z-index: 9999;
    display: none;
}

.cb-popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999999999;
}

.cb-hidden { display: none; }

.cb-popup-box {
    background: #fff;
    padding: 25px 30px;
    border-radius: 16px;
    width: 500px;
    position: relative;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    animation: cb-fadeIn 0.3s ease;
}

@keyframes cb-fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.cb-popup-close {
    position: absolute;
    right: 12px;
    top: 12px;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: #888;
}
.cb-popup-close:hover { color: #000; }

.cb-title {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
}

.cb-subtitle {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

/* Form */
.cb-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.cb-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}
.cb-input:focus {
    border-color: #28a745;
    box-shadow: 0 0 4px rgba(40,167,69,0.4);
}

.cb-btn-submit {
    background: #dc3545;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.2s;
}
.cb-btn-submit:hover {
    background: #c82333;
}

.cb-btn-submit:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* Spinner */
.cb-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Hotline list */
.cb-hotlines {
    font-size: 16px;
}

.cb-hotline-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.cb-hotlines ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cb-hotlines li {
    background: #f8f9fa;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.cb-hotlines li .cb-icon {
    color: #28a745;
    font-size: 16px;
}

.cb-hotlines a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}
.cb-hotlines a:hover {
    text-decoration: underline;
}

.cb-number {
    font-weight: bold;
    color: #007bff;
}

.cb-call-now {
    background: #28a745;
    color: #fff !important;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}
.cb-call-now:hover {
    background: #218838;
}

/* Overlay */
.cb-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.cb-modal.show {
    opacity: 1;
    pointer-events: auto;
}

/* Content */
.cb-modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 30px 40px;
    text-align: center;
    width: 400px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.cb-modal-content h2 {
    margin: 15px 0 10px;
    font-size: 20px;
    font-weight: bold;
    color: #1f2937;
}

.cb-modal-content p {
    font-size: 15px;
    color: #4b5563;
    margin-bottom: 15px;
}

.cb-modal-content small {
    color: #9ca3af;
    font-size: 13px;
}

/* Close button */
.cb-close {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 22px;
    cursor: pointer;
    color: #6b7280;
}
.cb-close:hover { color: #111; }

/* Icon success/error */
#cb-modal-icon {
    font-size: 50px;
    margin: 10px 0;
}
#cb-modal-icon.success { color: #16a34a; } /* xanh */
#cb-modal-icon.error { color: #dc2626; }   /* đỏ */



/* Mobile: màn hình dưới 768px */
@media (max-width: 768px) {
    .sale-off-btn {
        bottom: 80px;
        left: 18px;
    }

    .sale-off-popup {
        width: 90%;
        left: 50%;
        bottom: 140px;
        transform: translateX(-50%);
    }

    .sale-off-popup.active {
        transform: translateX(-50%) translateY(0);
        display: flex;
    }

    .sale-off-overlay.active {
        display: flex;
    }

    .popup-content {
        max-height: 400px;
    }
}

/* Mobile nhỏ hơn nữa: dưới 480px */
@media (max-width: 480px) {
    .contact-buttons {
        bottom: 200px; /* cao hơn để tránh đè nút điều hướng mobile */
        right: 18px;
    }
}
