/* Floating Elements CSS (Fab buttons, Cart Float, Stock Label) */
.float-buttons-container {
    position: fixed;
    bottom: 85px; /* Above mobile nav */
    right: 18px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align right */
    gap: 12px;
}

.float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 2px solid #d1d9e6; /* Outline Abu-abu */
    background: #2f74f5; /* Unified blue background */
}

.float-btn:hover {
    transform: scale(1.1);
    color: #fff;
}

.float-btn i {
    font-size: 1.5rem;
}

/* WhatsApp Green Mode */
.btn-whatsapp-float {
    background: #25D366 !important;
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.4);
    border: 2px solid #ffffff !important;
}

/* Stock Blue */
.btn-stock-float {
    box-shadow: 0 4px 18px rgba(47, 116, 245, 0.4);
}

/* Side Text Style */
.float-side-label {
    position: absolute;
    right: 60px;
    background: #2f74f5;
    color: #fff;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #d1d9e6;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.4s ease;
    pointer-events: none;
}

.btn-stock-float.active .float-side-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .float-btn-tooltip {
        display: none !important; /* No tooltips on mobile */
    }

    .float-side-label {
        background: rgba(0, 0, 0, 0.5) !important; /* More transparent dark glass */
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        color: #fff !important;
    }
}

.float-btn-tooltip {
    position: absolute;
    right: 64px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.float-btn:not(.active):hover .float-btn-tooltip {
    opacity: 1;
    visibility: visible;
}

@keyframes wiggle-whatsapp {
    0%, 90%, 100% { transform: rotate(0deg); }
    92% { transform: rotate(-15deg); }
    96% { transform: rotate(15deg); }
}

.float-btn i.fa-whatsapp {
    animation: wiggle-whatsapp 2.5s infinite;
}

@media (min-width: 992px) {
    .float-buttons-container {
        bottom: 30px;
        right: 30px;
    }

    .float-btn {
        width: 58px;
        height: 58px;
    }

    .float-btn i {
        font-size: 1.7rem;
    }

    .float-side-label {
        right: 70px;
    }
}

/* Floating Cart Styles */
.btn-cart-float {
    background: linear-gradient(135deg, #2F74F5 0%, #1a56cc 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(47, 116, 245, 0.4);
}

.btn-cart-float:hover {
    background: linear-gradient(135deg, #1a56cc 0%, #2F74F5 100%);
    color: white;
    transform: scale(1.1);
}

/* Pulse Animation */
@keyframes pulse-cart {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(47, 116, 245, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(47, 116, 245, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(47, 116, 245, 0);
    }
}

.pulse-animation {
    animation: pulse-cart 2s infinite;
}

/* Wiggle Animation for when items are added */
@keyframes wiggle-cart {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    50% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

.wiggle {
    animation: wiggle-cart 0.5s ease-in-out;
}

#cartModal .modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Constraint height to avoid overlap with bottom navigation on mobile */
@media (max-width: 991px) {
    #cartModal .modal-dialog {
        margin: 0.5rem;
        display: flex;
        align-items: center;
        min-height: calc(100% - 140px);
    }

    #cartModal .modal-content {
        max-height: calc(100vh - 140px);
        height: auto;
    }

    #cartModal .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.cart-modal-dialog {
    max-width: 400px;
    transition: max-width 0.3s ease;
}

@media (min-width: 992px) {
    .cart-modal-dialog {
        max-width: 650px; /* More space for PC */
    }
}

#cartModal .modal-header {
    background: #2563eb;
    color: #fff;
    border-bottom: none;
    flex-shrink: 0;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

#cartModal .modal-title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Force scrollbar visibility on mobile */
#cartModal .modal-body::-webkit-scrollbar,
#productModal .modal-body::-webkit-scrollbar,
.announce-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    display: block !important;
}

#cartModal .modal-body::-webkit-scrollbar-track,
#productModal .modal-body::-webkit-scrollbar-track,
.announce-body::-webkit-scrollbar-track {
    background: #f8fafc;
}

#cartModal .modal-body::-webkit-scrollbar-thumb,
#productModal .modal-body::-webkit-scrollbar-thumb,
.announce-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
