/* 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-buttons-container {
        bottom: calc(82px + env(safe-area-inset-bottom, 0px));
        right: 14px;
        gap: 10px;
    }

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

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

    .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;
}

.cart-modal-dialog {
    width: calc(100% - 24px);
    max-width: 440px;
    margin-left: auto !important;
    margin-right: auto !important;
    transition: max-width 0.3s ease;
}

/* Tablet & iPad (Portrait & Landscape up to 991px) */
@media (min-width: 576px) and (max-width: 991px) {
    .cart-modal-dialog {
        max-width: 520px;
        margin: 1.5rem auto !important;
    }
}

@media (min-width: 992px) {
    .cart-modal-dialog {
        max-width: 650px;
        margin: 1.75rem auto !important;
    }
}

/* Constraint height and center modal on mobile/iPad */
@media (max-width: 991px) {
    #cartModal .modal-dialog {
        margin: 1rem auto !important;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100% - 120px);
    }

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

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

/* Cart Modal Content & Empty State Classes */
.empty-cart-container {
    padding: 45px 20px;
    text-align: center;
}

.empty-cart-icon-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    color: #94a3b8;
    margin: 0 auto 16px;
    font-size: 42px;
    transition: all 0.3s ease;
}

.empty-cart-title {
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.empty-cart-sub {
    color: #64748b;
    font-size: 0.9rem;
}

.modal-cart-content {
    background: #f8f9fc;
}

.product-group-card {
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    background: #fff;
    overflow: hidden;
}

.product-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fcfdfe;
    border-bottom: 1px solid #f1f5f9;
}

.product-group-thumb {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
}

.product-group-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

.modal-cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    align-items: start;
    border-bottom: 1px solid #f8fafc;
}

.modal-cart-item .item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    object-fit: cover;
}

.modal-cart-item .item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.25;
    margin-bottom: 4px;
}

.modal-cart-item .item-price-current {
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 700;
}

.modal-cart-item .qty-stepper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 2px;
}

.modal-cart-item .qty-btn {
    width: 28px;
    height: 28px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
}

.modal-cart-item .qty-input {
    width: 30px;
    background: transparent;
    border: none;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

.modal-cart-item .btn-remove-link {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-cart-summary {
    background: #fff;
    border-top: 1px solid #f1f5f9;
}

#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;
}
