/* ===================================
   FLOATING CONTACT BUTTON
   =================================== */

.sm-floating-contact {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* ===================================
   CONTACT MENU
   =================================== */

.sm-contact-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 0;
    height: 0;
    overflow: hidden;
}

/* Show menu when active */
.sm-floating-contact.active .sm-contact-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    z-index: 999;
    height: max-content;
    overflow: visible;
}

/* ===================================
   CONTACT ITEMS
   =================================== */

.sm-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.sm-contact-item:hover {
    transform: translateX(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: white;
}

.sm-contact-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Phone Button */
.sm-contact-phone {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.sm-contact-phone:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
}

/* Zalo Button */
.sm-contact-zalo {
    background: linear-gradient(135deg, #0068FF, #0052CC);
    color: white;
}

.sm-contact-zalo:hover {
    background: linear-gradient(135deg, #0052CC, #0041A8);
}

/* Facebook Button */
.sm-contact-facebook {
    background: linear-gradient(135deg, #1877F2, #165ECC);
    color: white;
}

.sm-contact-facebook:hover {
    background: linear-gradient(135deg, #165ECC, #1350B3);
}

/* Youtube Button */
.sm-contact-youtube {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
}

.sm-contact-youtube:hover {
    background: linear-gradient(135deg, #CC0000, #990000);
}

/* Cart Button */
.sm-contact-cart {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    position: relative;
}

.sm-contact-cart:hover {
    background: linear-gradient(135deg, #F57C00, #E65100);
}

.sm-cart-count {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: #d32f2f;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    margin-left: 5px;
}

/* ===================================
   MAIN TOGGLE BUTTON
   =================================== */

.sm-contact-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2271b1, #135e96);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(34, 113, 177, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.sm-contact-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(34, 113, 177, 0.5);
}

.sm-contact-toggle:active {
    transform: scale(0.95);
}

/* Toggle Icons */
.sm-toggle-icon {
    width: 28px;
    height: 28px;
    position: absolute;
    transition: all 0.3s ease;
}

.sm-toggle-icon-open {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.sm-toggle-icon-close {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

/* Active state */
.sm-floating-contact.active .sm-toggle-icon-open {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
}

.sm-floating-contact.active .sm-toggle-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Pulse animation */
@keyframes sm-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(34, 113, 177, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(34, 113, 177, 0.7);
    }
}

.sm-contact-toggle {
    animation: sm-pulse 2s infinite;
}

.sm-floating-contact.active .sm-contact-toggle {
    animation: none;
}

/* ===================================
   FLOATING CART (standalone)
   =================================== */

.sm-floating-cart {
    position: fixed;
    right: 20px;
    bottom: 160px;
    z-index: 10000;
    width: 60px;
    height: 60px;
}

/* Keep button filling the container */
.sm-floating-cart-btn {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: #fff !important;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none;
    animation: sm-cart-pulse 2s infinite;
}

.sm-floating-cart-btn svg {
    width: 28px;
    height: 28px;
}

/* Badge positioned relative to .sm-floating-cart container */
.sm-floating-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    line-height: 22px;
    text-align: center;
    background: #d32f2f;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 0 7px;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Show badge when it has .show class */
.sm-floating-cart-count.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.sm-floating-cart.sm-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
    transition: all 0.25s ease;
}

/* Optional: ensure default state animates nicely */
.sm-floating-cart {
    transition: all 0.25s ease;
}

.cart-vat-amount {
    color: var(--primary);
    font-size: 16px;
    font-style: italic;
    display: block;
}

/* ===================================
   RESPONSIVE - MOBILE
   =================================== */

@media (max-width: 768px) {
    .sm-floating-contact {
        bottom: 90px;
        right: 27px;
        gap: 10px;
    }

    /* Smaller toggle button */
    .sm-contact-toggle {
        width: 50px;
        height: 50px;
    }

    .sm-toggle-icon {
        width: 24px;
        height: 24px;
    }

    /* Compact contact items */
    .sm-contact-item {
        font-size: 13px;
        gap: 8px;
    }

    .sm-contact-item svg {
        width: 20px;
        height: 20px;
    }

    .sm-cart-count {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 18px;
        height: 18px;
        line-height: 18px;
        font-size: 10px;
        margin: 0;
    }

    .sm-floating-cart {
        right: 27px;
        bottom: 160px;
        width: 50px;
        height: 50px;
    }

    .sm-floating-cart-btn {
        width: 100%;
        height: 100%;
    }

    .sm-floating-cart-btn svg {
        width: 24px;
        height: 24px;
    }

    .sm-floating-cart-count {
        top: -5px;
        right: -5px;
        min-width: 20px;
        line-height: 20px;
        font-size: 11px;
        padding: 0 6px;
    }
}

@media (max-width: 480px) {
    .sm-floating-contact {
        bottom: 80px;
        right: 27px;
    }

    .sm-contact-toggle {
        width: 46px;
        height: 46px;
    }

    .sm-contact-item svg {
        width: 18px;
        height: 18px;
    }

    .sm-floating-cart {
        bottom: 150px;
        width: 46px;
        height: 46px;
    }

    .sm-floating-cart-btn {
        width: 100%;
        height: 100%;
    }

    .sm-floating-cart-btn svg {
        width: 22px;
        height: 22px;
    }

    .sm-floating-cart-count {
        min-width: 18px;
        line-height: 18px;
        font-size: 10px;
    }
}