/* ----------------------------------------------------
 * CSS cho Advanced Contact Buttons
 * ---------------------------------------------------- */

/* --- Cài đặt chung & Desktop --- */
#acb-container {
    position: fixed;
    bottom: 80px;
    z-index: 1000;
}
#acb-container.acb-container--right {
    right: 15px;
}
#acb-container.acb-container--left {
    left: 25px;
}

.acb-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    display: none; /* Mặc định sẽ ẩn, JS sẽ xử lý việc hiển thị */
}
#acb-container.acb-container--right .acb-list {
    align-items: flex-end;
}
#acb-container.acb-container--left .acb-list {
    align-items: flex-start;
}


.acb-item {
    margin-bottom: 12px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
#acb-container.acb-container--right .acb-item {
    transform: translateX(20px);
}
#acb-container.acb-container--left .acb-item {
    transform: translateX(-20px);
}


.acb-item a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-radius: 50px;
    padding: 8px 15px 8px 8px;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    white-space: nowrap;
	min-width : 150px;
}

.acb-item:hover a {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.acb-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.acb-icon-wrapper svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

/* Nút chính để bật/tắt */
#acb-main-button {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: #ff4d4d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    animation: acb-pulse 2.5s infinite; /* Hiệu ứng mới */
	line-height : 1;
}
#acb-container.acb-container--right #acb-main-button {
    margin-left: auto; /* Để nút luôn ở bên phải */
}
#acb-container.acb-container--left #acb-main-button {
    margin-right: auto;
}


#acb-main-button:hover {
    transform: scale(1.1);
    animation-play-state: paused; /* Tạm dừng animation khi hover */
}

#acb-main-button svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* Khi container active (được click) */
#acb-container.active .acb-list {
    display: flex;
}
#acb-container.active .acb-item {
    opacity: 1;
    transform: translateX(0);
}
/* Hiệu ứng xuất hiện so le */
#acb-container.active .acb-item:nth-child(1) { transition-delay: 0.05s; }
#acb-container.active .acb-item:nth-child(2) { transition-delay: 0.1s; }
#acb-container.active .acb-item:nth-child(3) { transition-delay: 0.15s; }
#acb-container.active .acb-item:nth-child(4) { transition-delay: 0.2s; }
#acb-container.active .acb-item:nth-child(5) { transition-delay: 0.25s; }

/* --- Tùy chỉnh màu sắc cho từng nút --- */
.acb-item--phone .acb-icon-wrapper { background-color: #ff4d4d; }
.acb-item--zalo .acb-icon-wrapper { background-color: #0068ff; }
.acb-item--zalo .acb-icon-wrapper svg { fill: #fff; } /* Riêng Zalo cần fill màu cho SVG */
.acb-item--messenger .acb-icon-wrapper { background-color: #0084ff; }
.acb-item--maps .acb-icon-wrapper { background-color: #34A853; }
.acb-item--contact_page .acb-icon-wrapper { background-color: #f0ad4e; }

/* --- Hiệu ứng rung lắc cho các nút con --- */
.acb-shake-anim {
    animation: acb-shake 3s ease-in-out infinite;
}

@keyframes acb-shake {
  0%, 100% { transform: rotate(0deg); }
  5%, 15% { transform: rotate(8deg); }
  10%, 20% { transform: rotate(-8deg); }
  25% { transform: rotate(0deg); }
}

/* --- Hiệu ứng mới cho nút chính --- */
@keyframes acb-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(255, 77, 77, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0);
  }
}


/* ----------------------------------------------------
 * Responsive cho Mobile (<= 768px)
 * ---------------------------------------------------- */
@media (max-width: 768px) {
    #acb-container {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
        padding: 5px 0;
    }
    #acb-main-button {
        display: none;
    }

.acb-list {
        display: flex;
    align-items: stretch;
    width: 100%;
    margin-bottom: 0;
}

.acb-item {
    width: var(--acb-mobile-item-width, 20%);
    margin-bottom: 0;
    opacity: 1;
    transform: none;
    display: flex; /* Cho phép thẻ a bên trong co giãn */
}

.acb-item a {
    flex-direction: column;
    justify-content: center;
    background-color: transparent;
    box-shadow: none;
    padding: 5px;
    font-size: 11px;
    color: #555;
    border-radius: 8px;
    flex-grow: 1; /* Thẻ a sẽ chiếm hết chiều cao của acb-item */
    width: 100%;
}
 .acb-item a:hover {
        background-color: #f0f0f0;
     }

    .acb-icon-wrapper {
        width: 38px;
        height: 38px;
        margin-right: 0;
        margin-bottom: 4px;
    }

    .acb-icon-wrapper svg {
        width: 22px;
        height: 22px;
    }
    
    .acb-text {
        text-align: center;
    }
	
#acb-container.acb-container--left {
    left: unset !important;
}	
.acb-list {
    flex-direction: unset !important;
}
.acb-item a {
    min-width: unset !important;
}	
}