/* ===================================
   D-NOVA - Floating Cart Button
   Pływający koszyk w prawym dolnym rogu
   Styl: BMW Matrix LED Premium
   =================================== */

.floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9998;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    opacity: 0;
    transform: translateY(100px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Visible state */
.floating-cart.visible {
    opacity: 1;
    pointer-events: auto;
}

.floating-cart.animated {
    transform: translateY(0) scale(1);
}

/* Inner container */
.floating-cart-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(20, 20, 20, 0.95), 
        rgba(10, 10, 10, 0.95)
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 rgba(100, 150, 255, 0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon */
.floating-cart-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Badge */
.floating-cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    background: linear-gradient(135deg, 
        rgba(255, 50, 100, 0.95), 
        rgba(255, 20, 80, 0.95)
    );
    border: 2px solid rgba(10, 10, 10, 0.95);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 
        0 0 20px rgba(255, 50, 100, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
}

.floating-cart-badge.visible {
    display: flex;
}

.floating-cart-badge.bounce {
    animation: badgeBounce 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes badgePulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 50, 100, 0.6);
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 0 0 30px rgba(255, 50, 100, 0.9);
    }
}

@keyframes badgeBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Pulse ring effect */
.floating-cart-pulse {
    position: absolute;
    inset: -10px;
    border: 3px solid rgba(100, 150, 255, 0.3);
    border-radius: 50%;
    opacity: 0;
    animation: pulseRing 2s ease-out infinite;
    pointer-events: none;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Glow effect */
.floating-cart-glow {
    position: absolute;
    inset: -5px;
    background: radial-gradient(circle, 
        rgba(100, 150, 255, 0.2) 0%, 
        transparent 70%
    );
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Hover state */
.floating-cart.hovered .floating-cart-inner {
    background: linear-gradient(135deg, 
        rgba(30, 30, 30, 0.98), 
        rgba(20, 20, 20, 0.98)
    );
    border-color: rgba(100, 150, 255, 0.4);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.6),
        0 0 50px rgba(100, 150, 255, 0.3);
    transform: scale(1.08);
}

.floating-cart.hovered .floating-cart-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 4px 12px rgba(100, 150, 255, 0.6));
}

.floating-cart.hovered .floating-cart-glow {
    opacity: 1;
}

.floating-cart.hovered .floating-cart-pulse {
    animation: pulseRingFast 1s ease-out infinite;
}

@keyframes pulseRingFast {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Click state */
.floating-cart.clicked .floating-cart-inner {
    transform: scale(0.92);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
}

/* Responsywność */
@media (max-width: 768px) {
    .floating-cart {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
    
    .floating-cart-icon {
        font-size: 28px;
    }
    
    .floating-cart-badge {
        min-width: 20px;
        height: 20px;
        font-size: 11px;
        top: -3px;
        right: -3px;
    }
}

/* ===================================
   LIGHT BEAM ANIMATION (BMW Matrix LED)
   Animacja wiązki światła jak w Water Nav
   =================================== */

.floating-cart-beam {
    position: fixed;
    width: 4px;
    height: 150px;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
}

/* Wiązka światła - gradient pionowy */
.floating-cart-beam::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.8) 20%,
        rgba(200, 220, 255, 1) 50%,
        rgba(100, 150, 255, 0.9) 80%,
        rgba(0, 100, 255, 0) 100%
    );
    box-shadow: 
        0 0 20px rgba(200, 220, 255, 0.8),
        0 0 40px rgba(100, 150, 255, 0.5),
        0 0 60px rgba(0, 100, 255, 0.3);
    filter: blur(2px);
}

/* Punkt świetlny na końcu wiązki */
.floating-cart-beam::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 1) 0%,
        rgba(200, 220, 255, 0.8) 40%,
        rgba(100, 150, 255, 0) 100%
    );
    border-radius: 50%;
    box-shadow: 
        0 0 15px rgba(255, 255, 255, 0.9),
        0 0 30px rgba(200, 220, 255, 0.6),
        0 0 45px rgba(100, 150, 255, 0.4);
}

/* Responsywność wiązki */
@media (max-width: 768px) {
    .floating-cart-beam {
        width: 3px;
        height: 100px;
    }
}

/* Dark theme enhancement */
[data-theme="dark"] .floating-cart-inner {
    background: linear-gradient(135deg, 
        rgba(10, 10, 10, 0.98), 
        rgba(0, 0, 0, 0.98)
    );
}

/* Accessibility */
.floating-cart:focus {
    outline: none;
}

.floating-cart:focus-visible .floating-cart-inner {
    border-color: rgba(100, 150, 255, 0.8);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 4px rgba(100, 150, 255, 0.3);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .floating-cart,
    .floating-cart-inner,
    .floating-cart-icon,
    .floating-cart-badge {
        transition: opacity 0.3s ease !important;
        animation: none !important;
    }
    
    .floating-cart-pulse,
    .floating-cart-glow {
        display: none;
    }
}

/* Scroll-aware positioning (dodatkowa animacja przy scrollu) */
@keyframes floatBob {
    0%, 100% { 
        transform: translateY(0) scale(1);
    }
    50% { 
        transform: translateY(-5px) scale(1);
    }
}

.floating-cart.visible.animated {
    animation: floatBob 3s ease-in-out infinite;
}

.floating-cart.hovered {
    animation: none !important;
}
