.cart-container {
    max-width: 1000px;
    margin: 120px auto 40px;
    padding: 0 20px;
}

/* Badge del carrello */
.cart-icon {
    position: relative;
}

.cart-icon .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff3b30;
    color: white;
    font-size: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.cart-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.cart-main {
    background: white;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cart-sidebar {
    position: sticky;
    top: 120px;
}

.cart-container h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(120deg, #0fd27a, #007ffa, #00b300);
    background-size: 200%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: moveGradient 5s ease-in-out infinite;
}

.carrello-container h1 {
    font-family: 'Segoe UI', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(120deg, #000000, #007ffa, #00b300);
    background-size: 200%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    text-align: left;
    animation: moveGradient 5s ease-in-out infinite;
  }
  
  @keyframes moveGradient {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}



/* Stili per gli elementi del carrello */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 24px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    align-items: center;
    margin-bottom: 16px;
}

@media (max-width: 767px) {
    .cart-item {
        grid-template-columns: 80px 1fr auto;
        gap: 12px;
        padding: 16px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
        grid-row: 1;
    }

    .cart-item-name {
        grid-column: 2;
        grid-row: 1;
    }

    .cart-item-name h3 {
        font-size: 16px;
        margin: 0;
    }

    .cart-item-specs {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .cart-item-specs .spec {
        font-size: 13px;
        background: #f5f5f7;
        padding: 4px 8px;
        border-radius: 4px;
    }

    .cart-item-accessories {
        grid-column: 2;
        grid-row: 3;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .cart-item-accessories span {
        font-size: 13px;
        background: #f5f5f7;
        padding: 4px 8px;
        border-radius: 4px;
    }

    .cart-item-price {
        grid-column: 2;
        grid-row: 4;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .remove-item {
        grid-column: 3;
        grid-row: 1;
        padding: 4px;
    }

    .remove-item img {
        width: 16px;
        height: 16px;
    }
}

.cart-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f7;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.cart-item-details h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.cart-item-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 16px;
}

.cart-item-options .option {
    font-size: 14px;
    color: #86868b;
    background: #f5f5f7;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.cart-item-options .option span {
    font-weight: 500;
    color: #1d1d1f;
}

.cart-item-price {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin-right: 16px;
}

.cart-item-price .price {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    white-space: nowrap;
}

.cart-item-footer .price {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.remove-item {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.remove-item:hover {
    opacity: 1;
}

.remove-item img {
    width: 20px;
    height: 20px;
}

/* Stili per il carrello vuoto */
.empty-cart {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 18px;
    color: #86868b;
    font-size: 16px;
}

/* Stili per la notifica toast */
.toast-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: #34c759;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification i {
    font-size: 20px;
    color: white;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
}

/* Stili per la notifica */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007aff;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Stili per i metodi di pagamento */
.payment-methods {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.payment-methods img {
    height: 30px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.payment-methods img:hover {
    opacity: 1;
}

/* Stili per il layout principale */
.cart-layout {
    width: 100%;
    max-width: 1400px;
    margin: 30px auto;
    display: flex;
    gap: 30px;
}

.cart-main {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* Stili per gli elementi del carrello */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-items .empty-cart {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.cart-item-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-name {
    width: 250px;
}

.cart-item-name h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.cart-item-specs, .cart-item-accessories {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: #555;
    min-width: 160px; /* Assicura che la colonna occupi spazio */
}

.spec {
    color: #666;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.4;
}

.cart-item-price {
    width: 120px;
    text-align: right;
    margin-left: auto;
}

.cart-item-price .price {
    font-size: 20px;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0;
}

.remove-item {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: 10px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.remove-item:hover {
    background-color: #f5f5f5;
}

.remove-item img {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.remove-item:hover img {
    opacity: 1;
}

/* Stili per il riepilogo del carrello */
.cart-summary {
    flex: 1;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 100px;
    height: fit-content;
}

.cart-summary h2 {
    margin: 0 0 20px;
    font-size: 1.5rem;
}

.summary-details {
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    font-size: 1.1rem;
}

.summary-row.total {
    font-size: 1.3rem;
    font-weight: bold;
    border-top: 2px solid #eee;
    margin-top: 20px;
    padding-top: 20px;
}

.checkout-button {
    display: block;
    width: 100%;
    padding: 16px;
    background-color: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 20px 0;
    transition: background-color 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.checkout-button:hover {
    background: #0056b3;
}

/* Media Queries */
@media (max-width: 1200px) {
    .cart-layout {
        flex-direction: column;
    }

    .cart-summary {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-item {
        flex-wrap: wrap;
        gap: 15px;
    }

    .cart-item-name,
    .cart-item-specs,
    .cart-item-accessories {
        width: 100%;
    }

    .cart-item-price {
        margin-left: 0;
    }
}

/* Stile per il container del carrello */
.cart-container {
    cursor: pointer;
    position: relative;
}

.cart-icon .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #007aff;
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Badge contatore carrello - animazioni */

.cart-badge.hidden {
    display: none;
}

.cart-badge.bounce {
    animation: cartBadgeBounce 0.5s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

@keyframes cartBadgeBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Animazione icona carrello */
.cart-icon img.shake {
    animation: cartShake 0.5s ease-in-out;
}



.cart-preview-product {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 12px;
    align-items: center;
}

.cart-preview-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: #f8f8f8;
    padding: 5px;
}

.cart-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-preview-info {
    min-width: 0; /* Permette il truncate del testo */
}

.cart-preview-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-preview-specs {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-preview-remove {
    background: none;
    border: none;
    color: #ff3b30;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    line-height: 1;
    height: 24px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-preview-empty {
    text-align: center;
    color: #666;
    font-size: 13px;
    padding: 8px 0;
}



@keyframes cartBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.cart-badge.bounce {
    animation: cartBounce 0.5s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

@keyframes cartShake {
    0% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0); }
}

.cart-icon img.shake {
    animation: cartShake 0.5s ease-in-out;
}

.summary-details {
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    font-size: 1.1rem;
}

.summary-row.total {
    font-size: 1.3rem;
    font-weight: bold;
    border-top: 2px solid #eee;
    margin-top: 20px;
    padding-top: 20px;
}

.checkout-button {
    display: block;
    width: 100%;
    padding: 16px;
    background-color: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 20px 0;
    transition: background-color 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.checkout-button:hover {
    background: #0056b3;
}

.checkout-btn {
  padding: 15px;
  background: #0071e3;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 20px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: 0 4px 10px rgba(0, 113, 227, 0.3);
}

.checkout-btn:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 5px rgba(0, 113, 227, 0.2);
}

.metodi-pagamento {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.metodi-pagamento img {
    height: 30px;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
  }
  
  .metodi-pagamento img:hover {
    filter: grayscale(0%);
  }

  .switch-group {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #333;
    width: 100%;
  }
  
  .switch-input {
    display: none;
  }
  
  .switch-slider {
    position: relative;
    width: 50px;
    height: 28px;
    background-color: #ccc;
    border-radius: 34px;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  .switch-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    top: 4px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
  }
  
  /* Stato attivo */
  .switch-input:checked + .switch-slider {
    background-color: #0071e3;
  }
  
  .switch-input:checked + .switch-slider::before {
    transform: translateX(22px);
  }

  .opzioni-extra {
    background: #fff;
    padding: 15px 20px;
    margin-top: -10px;
    margin-bottom: 20px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
  }