/* CSS Variables per personalizzazione colori */

:root {
    --fffc-primary: #667eea;
    --fffc-secondary: #764ba2;
    --fffc-text: #ffffff;
    --fffc-badge: #ff4757;
}

#fffc-floating-cart {
    position: fixed;
    right: 20px;
    bottom: 180px; /* MODIFICATO: era 100px - Opzione A */
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#fffc-floating-cart.fffc-hidden {
    display: none;
}

/* Trigger Button */
.fffc-trigger {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--fffc-primary) 0%, var(--fffc-secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.fffc-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.fffc-trigger.fffc-active {
    transform: scale(0.95);
}

.fffc-cart-icon {
    width: 28px;
    height: 28px;
    color: var(--fffc-text);
}

.fffc-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--fffc-badge);
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Panel */
.fffc-panel {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 350px;
    max-height: 600px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.fffc-panel.fffc-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header */
.fffc-header {
    padding: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--fffc-primary) 0%, var(--fffc-secondary) 100%);
}

.fffc-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--fffc-text);
    letter-spacing: 0.3px;
}

.fffc-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fffc-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.fffc-close svg {
    width: 18px;
    height: 18px;
    color: var(--fffc-text);
}

/* Body */
.fffc-body {
    padding: 20px;
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden;
    background: #fafafa;
    transition: max-height 0.3s ease;
}

.fffc-body.fffc-scrollable {
    max-height: 320px;
    overflow-y: auto;
}

.fffc-body::-webkit-scrollbar {
    width: 8px;
}

.fffc-body::-webkit-scrollbar-track {
    background: #e8e8e8;
    border-radius: 4px;
    margin: 5px 0;
}

.fffc-body::-webkit-scrollbar-thumb {
    background: var(--fffc-primary);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.fffc-body::-webkit-scrollbar-thumb:hover {
    background: var(--fffc-secondary);
}

.fffc-body {
    scrollbar-width: thin;
    scrollbar-color: var(--fffc-primary) #e8e8e8;
}

.fffc-empty-message {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 40px 20px;
}

/* Items */
.fffc-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fffc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.fffc-item:hover {
    border-color: var(--fffc-primary);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.fffc-item-content {
    flex: 1;
}

.fffc-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
}

.fffc-item-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--fffc-primary);
}

.fffc-remove-item {
    background: var(--fffc-badge);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.fffc-remove-item:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

.fffc-remove-item svg {
    width: 14px;
    height: 14px;
    color: #ffffff;
}

/* Footer Section - Totale */
.fffc-footer {
    background: #ffffff;
    border-top: 2px solid #f0f0f0;
    padding: 0;
}

.fffc-total {
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--fffc-primary) 0%, var(--fffc-secondary) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--fffc-text);
}

.fffc-total-label {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.fffc-total-amount {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Language Toggle Button */
#fffc-language-toggle {
    position: fixed;
    right: 20px;
    bottom: 255px; /* MODIFICATO: era 175px - mantiene distanza di 75px */
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--fffc-primary) 0%, var(--fffc-secondary) 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 999998;
}

#fffc-language-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#fffc-language-toggle:active {
    transform: scale(0.95);
}

.fffc-lang-icon {
    width: 24px;
    height: 24px;
    color: var(--fffc-text);
    margin-bottom: 2px;
}

.fffc-lang-code {
    font-size: 10px;
    font-weight: 700;
    color: var(--fffc-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#fffc-language-toggle.fffc-lang-active {
    opacity: 0.85;
}

#fffc-language-toggle.fffc-lang-active .fffc-lang-code::after {
    content: ' ✓';
}

/* Animations */
@keyframes fffc-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.fffc-trigger.fffc-new-item {
    animation: fffc-bounce 0.5s ease;
}

@keyframes fffc-slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fffc-item {
    animation: fffc-slideIn 0.3s ease;
}

/* Responsive */
@media (max-width: 480px) {
    .fffc-panel {
        width: calc(100vw - 40px);
        right: -10px;
    }

    #fffc-floating-cart {
        right: 10px;
        bottom: 180px; /* MODIFICATO: mantiene la stessa proporzione */
    }

    #fffc-language-toggle {
        right: 10px;
        bottom: 255px; /* MODIFICATO: mantiene la stessa proporzione */
    }

    .fffc-body.fffc-scrollable {
        max-height: 280px;
    }
}
