/**
 * WooCommerce Variations Gallery - Stili Slider
 */

.wc-variations-gallery-wrapper {
    margin: 20px 0 30px;
    clear: both;
    width: 100%;
}

.wc-variations-gallery-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

/* Contenitore slider */
.wc-variations-slider-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Wrapper dello slider */
.wc-variations-gallery {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Track che contiene gli items */
.wc-variations-slider-track {
    display: flex;
    gap: 15px;
    transition: transform 0.4s ease;
    will-change: transform;
}

/* Pulsanti di navigazione */
.wc-slider-nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.wc-slider-nav:hover:not(:disabled) {
    border-color: #0071a1;
    background: #0071a1;
    color: white;
    transform: scale(1.1);
}

.wc-slider-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wc-slider-nav span {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-slider-nav {
        width: 35px;
        height: 35px;
    }
    
    .wc-slider-nav span {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .wc-variations-slider-container {
        gap: 5px;
    }
    
    .wc-slider-nav {
        width: 30px;
        height: 30px;
    }
    
    .wc-slider-nav span {
        font-size: 18px;
    }
}

.wc-variation-gallery-item {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    flex-shrink: 0;
    width: 150px;
}

@media (max-width: 768px) {
    .wc-variation-gallery-item {
        width: 130px;
    }
}

@media (max-width: 480px) {
    .wc-variation-gallery-item {
        width: 110px;
    }
}

.wc-variation-gallery-item:hover {
    border-color: #999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.wc-variation-gallery-item.selected {
    border-color: #0071a1;
    box-shadow: 0 0 0 2px #0071a1;
}

.wc-variation-gallery-item.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.wc-variation-gallery-image {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1;
    object-fit: cover;
}

.wc-variation-gallery-info {
    padding: 10px;
    text-align: center;
    background: #f9f9f9;
}

.wc-variation-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.wc-variation-price {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #0071a1;
}

.wc-variation-price del {
    opacity: 0.6;
    margin-right: 5px;
}

.wc-variation-out-of-stock {
    display: block;
    font-size: 13px;
    color: #e74c3c;
    font-weight: 500;
}

.wc-variation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-variation-overlay::after {
    content: '✕';
    font-size: 48px;
    color: #e74c3c;
    font-weight: bold;
}

/* Badge "Selezionato" */
.wc-variation-gallery-item.selected::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #0071a1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    z-index: 1;
}

/* Animazioni */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 113, 161, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 113, 161, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 113, 161, 0);
    }
}

.wc-variation-gallery-item.selected {
    animation: pulse 0.5s;
}

/* Stili admin */
.variation-gallery-images {
    margin-top: 10px;
}

.variation-gallery-images-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    padding: 0;
    list-style: none;
}

.variation-gallery-images-list li {
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.variation-gallery-images-list li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-variation-gallery-image {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: #dc3232;
    color: white;
    text-align: center;
    line-height: 20px;
    border-radius: 50%;
    text-decoration: none;
    font-weight: bold;
}

.delete-variation-gallery-image:hover {
    background: #a00;
}

.add-variation-gallery-images {
    margin-top: 10px;
}
