/**
 * Stili per il modulo Prodotti Rimossi dal Carrello
 */
#cart .container.removed-products, #product .container.removed-products {
    padding: 0;
    margin: 0 auto;
    float: left;
    width: 100%;
    display: block;
}

#cart .removed-cart-products-block, #product .removed-cart-products-block {
    margin: 0;
    margin-bottom: 35px;
    padding: 0;
    float: left;
    width: 100%;
    max-width: 100%;
}

#cart .removed-cart-products-title {
    padding: 0;
    margin: 25px 0;
}

#product .removed-cart-products-block h3 {
    margin-top: 45px;
    margin-bottom: 0;
    background: #ffffff;
    padding: 20px 30px;
    padding-bottom: 0;
}

.cart_block .no-item .col-xs-12.col-sm-6.col-md-3 {
    width: 100%;
    margin-top: 0;
    max-width: 350px;
}

.cart_block .no-item .removed-cart-products-title {
    font-size: 17px;
    padding: 0 0 !important;
    margin: 0 !important;
    display: block;
    color: #9c0000;
}

.cart_block .no-item .removed-product-price .price {
    margin: 0 !important;
}

.cart_block .no-item .removed-product-name {
    min-height: auto;
}

.cart_block .no-item .removed-product-item {
    margin-top: 10px;
}

.cart_block .no-item .removed-product-date {
    margin-bottom: 5px;
}

.removed-cart-products-block {
    margin: 0;
    margin-bottom: 35px;
    padding: 0 25px;
}

.container.removed-products {
    padding: 15px;
    margin: 0 auto;
}

.removed-cart-products-title {
    font-size: 22px;
    font-weight: 600;
    color: #000;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.removed-cart-products-title .material-icons {
    font-size: 28px;
    color: #f39c12;
}

.removed-cart-products-container {
    background: #ffffff;
}

.removed-product-item {
    animation-delay: 0.1s;
    float: left;
    position: relative;
    text-align: center;
    width: 100%;
    overflow: hidden;
    border: solid 1px #e8e8e8;
    padding: 15px;
    margin: 25px 0;
    border-radius: 3px;
    transition: all 400ms 
ease-in-out 0s;
    -webkit-transition: all 400ms 
ease-in-out 0s;
    -moz-transition: all 400ms ease-in-out 0s;
    -o-transition: all 400ms ease-in-out 0s;
    -ms-transition: all 400ms ease-in-out 0s;
}

.removed-product-image {
    text-align: center;
    margin-bottom: 15px;
    overflow: hidden;
    background: #f9f9f9;
}

.removed-product-image img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    padding: 0;
    transition: transform 0.3s ease;
}

.removed-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.removed-product-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    min-height: 40px;
    text-align: left;
}

.removed-product-name a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.removed-product-name a:hover {
    color: #f39c12;
}

.removed-product-price {
    margin-bottom: 10px;
    text-align: left;
}

.removed-product-price .price {
    font-size: 17px;
    font-weight: 700;
    color: #000000;
}

.removed-product-date {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.removed-product-date small {
    font-size: 13px;
    color: #999999;
    display: flex;
    align-items: center;
    gap: 3px;
    letter-spacing: 1px;
}

.removed-product-date .material-icons {
    font-size: 21px;
    color: #850000;
    vertical-align: middle;
    display: inline-block;
}

.removed-product-actions {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.removed-product-actions .btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 15px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.removed-product-actions .btn-success {
    background-color: #000000;
    border-color: #000000;
    color: #fff;
}

.removed-product-actions .btn-success:hover {
    background-color: #006304;
    border-color: #006304;
    transform: translateY(-2px);
}

.removed-product-actions .btn-success:disabled {
    background-color: #95a5a6;
    border-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.removed-product-actions .btn-primary {
    background-color: #f39c12;
    border-color: #f39c12;
    color: #ffffff;
    text-decoration: none;
}

.removed-product-actions .btn-primary:hover {
    background-color: #e67e22;
    border-color: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
    text-decoration: none;
}

/* Animazione di caricamento per il pulsante */
.removed-product-actions .btn-success.loading {
    position: relative;
    pointer-events: none;
}

.removed-product-actions .btn-success.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Stato di successo confermato */
.removed-product-actions .btn-success-confirmed {
    background-color: #27ae60 !important;
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Stato di errore */
.removed-product-actions .btn-error {
    background-color: #e74c3c !important;
    border-color: #e74c3c !important;
}

/* Responsive per i pulsanti */
@media (min-width: 768px) {
    .removed-product-actions {
        flex-direction: row;
        gap: 5px;
    }
    
    .removed-product-actions .btn {
        width: auto;
        flex: 1;
        font-size: 17px;
        padding: 10px;
    }
}

@media (max-width: 767px) {
    .removed-product-actions .btn {
        font-size: 15px;
        padding: 12px 15px;
    }
}

/* ==========================================
   CAROUSEL SEMPLICE JQUERY
   ========================================== */

.removed-products-carousel {
    position: relative;
    padding: 35px 35px;
}

.carousel-viewport {
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
    gap: 0;
    will-change: transform;
}

.carousel-track.dragging {
    transition: none;
    cursor: grabbing;
}

/* Infinite scroll - assicura che le slide clonate siano identiche */
.carousel-slide.cloned {
    /* Le slide clonate non hanno bisogno di stili speciali */
}

.carousel-slide {
    flex: 0 0 25%; /* 4 prodotti = 25% ciascuno (home/product) */
    max-width: 25%;
    padding: 0 5px; /* Piccolo padding interno */
}

/* Cart page - 3 prodotti per slide */
.removed-products-carousel[data-context="cart"] .carousel-slide {
    flex: 0 0 33.333%; /* 3 prodotti = 33.333% ciascuno */
    max-width: 33.333%;
}

.carousel-slide .removed-product-item {
    margin: 0 auto;
}

/* Navigation Buttons */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 44px;
    height: 44px;
    border: 2px solid #850000;
    background: #fff;
    color: #850000;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 -20px;

}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: #850000;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev:disabled,
.carousel-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    background: #ffffff;
}

.carousel-prev .material-icons,
.carousel-next .material-icons {
    font-size: 24px;
}

/* Dots container */
.carousel-dots {
    text-align: center;
    padding: 20px 0 10px 0;
    position: relative;
    z-index: 5;
}

.carousel-dots .dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cccccc;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dots .dot.active {
    background: #850000;
    transform: scale(1.3);
}

.carousel-dots .dot:hover {
    background: #f5a5a5;
}

/* Responsive - Mobile: sempre 1 prodotto */
@media (max-width: 767px) {
    .carousel-slide {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0 5px;
    }
    
    /* Cart page - 1 prodotto su mobile (override) */
    .removed-products-carousel[data-context="cart"] .carousel-slide {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .removed-products-carousel {
        padding: 15px; /* Più spazio per le frecce */
    }
    
    /* Frecce più grandi e meglio posizionate su mobile */
    .carousel-prev,
    .carousel-next {
        width: 44px;
        height: 44px;
        margin: 0 -10px; /* Meno margine negativo */
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        z-index: 100;
        touch-action: manipulation; /* Migliora il touch */
    }
    
    .carousel-prev .material-icons,
    .carousel-next .material-icons {
        font-size: 24px; /* Icone più grandi */
    }
    
    /* Area di click più grande */
    .carousel-prev::before,
    .carousel-next::before {
        content: '';
        position: absolute;
        top: -10px;
        bottom: -10px;
        left: -10px;
        right: -10px;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .carousel-slide {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 5px;
    }
    
    /* Cart page - 1 prodotto anche su mobile grande */
    .removed-products-carousel[data-context="cart"] .carousel-slide {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .carousel-slide {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        padding: 0 5px;
    }
    
    /* Cart page - 2 prodotti su tablet */
    .removed-products-carousel[data-context="cart"] .carousel-slide {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Grid mode (quando non c'è carousel) */
.removed-products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-content: center;
    flex-direction: row;
}

.removed-product-actions .material-icons {
    font-size: 18px;
}

/* Responsive */
@media (max-width: 767px) {
    .removed-cart-products-block {
        padding: 0;
    }
    
    .removed-cart-products-title {
        font-size: 20px;
        padding: 0 15px;
    }
    
    .removed-product-item {
        float: none;
        max-width: 91%;
        margin: 17px auto;
    }
}

/* Animazione di caricamento */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.removed-product-item {
    animation: fadeIn 0.5s ease forwards;
}

.removed-product-item:nth-child(1) { animation-delay: 0.1s; }
.removed-product-item:nth-child(2) { animation-delay: 0.2s; }
.removed-product-item:nth-child(3) { animation-delay: 0.3s; }
.removed-product-item:nth-child(4) { animation-delay: 0.4s; }
.removed-product-item:nth-child(5) { animation-delay: 0.5s; }
