/* Stili per il carrello flottante */

.cart-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-white, #ffffff);
    color: var(--color-primary, #ff6b00);
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid rgba(242, 140, 56, 0.2);
}

.cart-fab:hover {
    transform: scale(1.05);
}

.cart-fab.added {
    animation: cart-pulse 0.4s ease-out;
}

.cart-fab__label {
    font-size: 0.85rem;
    font-weight: 600;
}

.cart-fab__total {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.cart-fab__badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #ff3b30;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Pannello laterale / inferiore carrello */
.cart-panel {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
}

.cart-panel.open {
    pointer-events: auto;
}

.cart-panel__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 300ms ease;
}

.cart-panel.open .cart-panel__backdrop {
    opacity: 1;
}

.cart-panel__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-bg, #ffffff);
    border-radius: 24px 24px 0 0;
    max-height: 80vh;
    transform: translateY(100%);
    transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-panel.open .cart-panel__content {
    transform: translateY(0);
}

.cart-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border, #f0f0f0);
}

.cart-panel__header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.cart-panel__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--color-bg-alt, #f5f5f5);
    border: none;
    color: var(--color-text-light, #757575);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-panel__items {
    overflow-y: auto;
    padding: 16px 24px;
    max-height: 40vh;
}

.cart-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-light, #f5f5f5);
    animation: slideInRight 0.3s ease-out;
}

.cart-item__info {
    display: flex;
    flex-direction: column;
}

.cart-item__remove {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #F44336;
    color: white;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item.removing {
    animation: slideOutRight 300ms forwards;
}

.cart-panel__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border, #f0f0f0);
}

.cart-panel__total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.cart-panel__discount {
    background-color: #E8F5E9;
    color: #2E7D32;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    text-align: center;
}

.cart-panel__allestimento {
    font-size: 0.8rem;
    color: var(--color-text-light, #757575);
    font-style: italic;
    margin-bottom: 12px;
    text-align: center;
}

/* Pulsante scroll to top */
.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--color-primary, #ff6b00);
    color: white;
    border: none;
    box-shadow: var(--shadow-md, 0 4px 8px rgba(0,0,0,0.2));
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
}

.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

/* Animazioni carrello */
@keyframes cart-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(20px); opacity: 0; }
}

/* Wave + Sun Discount Animation */
.discount-animation {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary), #FFD54F);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-md);
  overflow: hidden;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-medium);
  animation: slideInUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.discount-animation::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 20px;
  background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 120 28" xmlns="http://www.w3.org/2000/svg"><path d="M0 28 Q 30 0, 60 14 T 120 28" fill="rgba(255,255,255,0.2)"/></svg>') repeat-x;
  background-size: 60px 20px;
  animation: waveAnim 3s linear infinite;
}

.discount-animation__sun {
  position: absolute;
  top: -10px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #FFF;
  border-radius: 50%;
  opacity: 0.2;
  animation: pulseSun 2s ease-in-out infinite alternate;
}

.discount-animation__badge {
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 1;
}

.discount-animation__prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 1;
}

.discount-animation__old-price {
  text-decoration: line-through;
  font-size: 0.8rem;
  opacity: 0.8;
}

.discount-animation__new-price {
  font-size: 1.2rem;
  font-weight: 700;
}

@keyframes waveAnim {
  0% { transform: translateX(0); }
  100% { transform: translateX(-60px); }
}
@keyframes pulseSun {
  0% { transform: scale(1); opacity: 0.2; }
  100% { transform: scale(1.2); opacity: 0.4; }
}
@keyframes slideInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.discount-animation__palm {
  position: absolute;
  top: 10px;
  right: 50px;
  font-size: 1.5rem;
  z-index: 2;
  transform-origin: bottom center;
  animation: swayPalm 2s ease-in-out infinite alternate;
}

@keyframes swayPalm {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(15deg); }
}
