/**
 * Stili per la visualizzazione raggruppata del carrello
 */

/* Container principale per i prodotti raggruppati */
.cart-products-grouped {
    margin: 20px 0;
}

/* Stili per le card dei prodotti */
.product-group-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.product-group-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Header della card del prodotto */
.product-group-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-group-header .product-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.product-group-info h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.product-reference {
    opacity: 0.9;
    font-size: 14px;
    margin: 0;
}

/* Body della card */
.product-group-body {
    padding: 0;
}

/* Intestazione del colore */
.color-group-header {
    background-color: #f8f9fa;
    padding: 12px 20px;
    border-bottom: 1px solid #dee2e6;
    margin: 0;
}

.color-group-header strong {
    color: #495057;
    font-weight: 600;
}

/* Tabella delle taglie/varianti */
.size-variants-table {
    margin-bottom: 0;
    border-collapse: collapse;
}

.size-variants-table th {
    background-color: #f1f3f4;
    color: #495057;
    font-weight: 600;
    text-align: center;
    padding: 12px 8px;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
}

.size-variants-table td {
    text-align: center;
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.size-variant-row:hover {
    background-color: #f8f9fa;
}

/* Input quantità */
.js-cart-line-product-quantity {
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    padding: 8px;
}

.js-cart-line-product-quantity:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Pulsante rimuovi */
.remove-variant {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dc3545;
    background: white;
    color: #dc3545;
    transition: all 0.2s ease;
}

.remove-variant:hover {
    background-color: #dc3545;
    color: white;
    transform: scale(1.1);
}

.remove-variant .material-icons {
    font-size: 18px;
}

/* Prezzi */
.variant-price,
.variant-total {
    font-weight: 600;
    color: #28a745;
}

/* Stato carrello vuoto */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.cart-empty .material-icons {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.cart-empty h3 {
    margin: 0;
    font-weight: 400;
}

/* Responsive design */
@media (max-width: 768px) {
    .product-group-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .size-variants-table {
        font-size: 12px;
    }
    
    .size-variants-table th,
    .size-variants-table td {
        padding: 8px 4px;
    }
    
    .js-cart-line-product-quantity {
        width: 60px !important;
        font-size: 12px;
    }
}

/* Animazioni */
.product-group-card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Miglioramenti per l'accessibilità */
.js-cart-line-product-quantity:focus,
.remove-from-cart:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Indicatore di loading */
.loading-overlay {
    position: relative;
}

.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-overlay.active::after {
    content: '⟳';
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cart-grouped-product .product-header > .row {
  display: flex;
  align-items: end;
}
.cart-grouped-product .product-header {
    margin-bottom: 20px;
    margin-top:20px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}
.cart-grouped-product .color-info > p {
  color:#000 !important
}
.cart-item {
  padding: 0 !important;
}
.cart-grouped-product {
  margin-bottom: 20px;
}
.cart-grouped-product td {
  vertical-align: middle !important;
  padding: .2rem .5rem !important
}