/**
 * GATE14 - CSS Card Varianti Espandibili v1.3.0
 * Stili per le card moderne che sostituiscono la tabella
 */

/* ========================================
   NASCONDI SELETTORE VARIANTI PRESTASHOP
   ======================================== */

.product-variants.js-product-variants {
    display: none !important;
}

/* ========================================
   RECAP VARIANTE SELEZIONATA
   ======================================== */

.g14-selected-recap {
    background: linear-gradient(135deg, #00a09e 0%, #008c8a 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    margin: 20px 0 20px 0 !important;
    box-shadow: 0 4px 12px rgba(0, 160, 158, 0.3);
    line-height: 1.6;
    position: relative !important;
    display: block !important;
    width: 100%;
    clear: both;
}

.g14-selected-recap-label {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.g14-selected-recap-value {
    font-size: 17px;
    font-weight: 700;
}

/* ========================================
   CONTAINER VARIANTI
   ======================================== */

.g14-variants-cards-container {
    margin: 40px 0;
    padding: 0 20px;
}

.g14-variants-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.g14-variants-grid {
    display: grid;
    gap: 16px;
}

/* ========================================
   CARD SINGOLA VARIANTE
   ======================================== */

.g14-variant-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    margin-bottom: 16px;
}

.g14-variant-card:last-child {
    margin-bottom: 0;
}

.g14-variant-card:hover {
    border-color: #14b8a6;
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.15);
}

.g14-variant-card.g14-expanded {
    border-color: #14b8a6;
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.2);
}

/* ========================================
   HEADER CARD (sempre visibile)
   ======================================== */

.g14-variant-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #f8fafc;
    transition: background 0.3s ease;
}

.g14-variant-card:hover .g14-variant-header {
    background: #f0fdfa;
}

.g14-variant-card.g14-expanded .g14-variant-header {
    background: linear-gradient(135deg, #f0fdfa 0%, #e6f7f5 100%);
}

.g14-variant-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.g14-variant-image,
.g14-variant-image-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    background: white;
    flex-shrink: 0;
}

.g14-variant-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #f1f5f9;
}

.g14-variant-main-info {
    flex: 1;
    min-width: 0;
}

.g14-variant-badge {
    display: inline-block;
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.g14-variant-model {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g14-variant-code {
    font-size: 13px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g14-variant-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.g14-variant-price {
    text-align: right;
}

.g14-variant-price-old {
    font-size: 14px;
    color: #94a3b8;
    text-decoration: line-through;
    white-space: nowrap;
}

.g14-variant-price-current {
    font-size: 24px;
    font-weight: 700;
    color: #0d9488;
    white-space: nowrap;
}

.g14-expand-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.g14-variant-card:hover .g14-expand-icon {
    background: #14b8a6;
    color: white;
}

.g14-expand-icon svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.g14-variant-card.g14-expanded .g14-expand-icon svg {
    transform: rotate(180deg);
}

/* ========================================
   BODY CARD (espandibile)
   ======================================== */

.g14-variant-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.g14-variant-card.g14-expanded .g14-variant-body {
    max-height: 1000px;
    padding: 0 20px 20px 20px;
}

/* TABELLA SPECIFICHE - TABLE STYLE */
.g14-variant-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: #cbd5e1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.g14-spec-item {
    background: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.g14-spec-item:hover {
    background: #f8fafc;
}

.g14-spec-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.g14-spec-value {
    font-size: 14px;
    color: #1e293b;
    font-weight: 600;
}

.g14-variant-actions {
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.g14-btn {
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-decoration: none;
}

.g14-btn-primary {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    color: white !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.g14-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
    text-decoration: none;
    color: white !important;
}

.g14-btn-primary svg {
    color: white;
    stroke: white;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .g14-variants-cards-container {
        padding: 0 12px;
        margin: 24px 0;
    }
    
    .g14-variant-header {
        padding: 16px;
        flex-wrap: wrap;
    }
    
    .g14-variant-header-left {
        width: 100%;
        margin-bottom: 12px;
    }
    
    .g14-variant-header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .g14-variant-image,
    .g14-variant-image-placeholder {
        width: 50px;
        height: 50px;
    }
    
    .g14-variant-model {
        font-size: 16px;
    }
    
    .g14-variant-price-current {
        font-size: 20px;
    }
    
    .g14-variant-specs {
        grid-template-columns: 1fr;
        gap: 1px;
    }
    
    .g14-spec-item {
        padding: 10px 14px;
    }
    
    .g14-variant-card.g14-expanded .g14-variant-body {
        padding: 0 16px 16px 16px;
    }
}

@media (max-width: 480px) {
    .g14-variants-title {
        font-size: 18px;
    }
    
    .g14-variant-badge {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .g14-variant-code {
        font-size: 12px;
    }
}
