/**
 * Stili Pagina Prodotto Dimsport - Versione Moderna
 */

/* ==========================================================================
   Sezione Veicolo nella Pagina Prodotto
   ========================================================================== */

.dimsport-product-vehicle-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
}

/* Responsive: riduce padding su mobile */
@media (max-width: 768px) {
    .dimsport-product-vehicle-section {
        padding: 0px;
        border-radius: 12px;
    }
}

.dimsport-product-vehicle-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Veicolo Selezionato */
.dimsport-vehicle-selected {
    background: white;
    border-radius: 12px;
    padding: 28px;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.dimsport-vehicle-selected:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0,0,0,0.1);
}

.vehicle-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.vehicle-title::before {
    content: '🚗';
    font-size: 24px;
}

.vehicle-info-box {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 4px;
    border: 2px solid #ff0000;
    padding: 24px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.vehicle-info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vehicle-info-box:hover::before {
    opacity: 1;
}

.vehicle-main-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.vehicle-main-info strong {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.vehicle-specs {
    opacity: 0.95;
    font-size: 14px;
    font-weight: 400;
}

.change-vehicle-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.4);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.change-vehicle-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.change-vehicle-btn:active {
    transform: translateY(-1px);
}

/* Selettore Varianti */
.variant-selector-box {
    background: linear-gradient(135deg, #fff9e6 0%, #ffeaa7 100%);
    border: 2px solid #ffd93d;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
    transition: all 0.3s ease;
}

.variant-selector-box:hover {
    box-shadow: 0 6px 25px rgba(255, 193, 7, 0.3);
}

.variant-selector-box label {
    display: block;
    margin-bottom: 10px;
    color: #856404;
    font-size: 15px;
    font-weight: 600;
}

.variant-count {
    font-weight: 500;
    font-size: 13px;
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.variant-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ffd93d;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.variant-select:hover {
    border-color: #e0a800;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.variant-select:focus {
    outline: none;
    border-color: #e0a800;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.2);
}

/* Dettagli Configurazione */
.config-details-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}

.config-details-box h4 {
    margin: 0 0 16px 0;
    font-size: 17px;
    color: #2c3e50;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-details-box h4::before {
    content: '⚙️';
    font-size: 20px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.config-item:hover {
    padding-left: 8px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px;
}

.config-item:last-child {
    border-bottom: none;
}

.config-label {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.config-value {
    font-weight: 700;
    color: #2c3e50;
    font-size: 14px;
}

.config-item.highlight {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    padding: 14px 16px;
    border-radius: 8px;
    margin: 10px 0;
    border: none;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

.config-item.highlight .config-value {
    color: #ff0000;
    font-size: 16px;
}

.config-item.performance {
    background: linear-gradient(135deg, #d4edff 0%, #c3e0ff 100%);
    padding: 14px 16px;
    border-radius: 8px;
    margin: 6px 0;
    border: none;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.config-value.gain {
    color: #28a745;
    font-size: 17px;
    font-weight: 800;
}

.config-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    border: 2px solid #ff0000;
    font-size: 13px;
    font-weight: 700;
    margin: 10px 10px 10px 0;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.config-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.config-code {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px dashed #dee2e6;
    font-family: 'Courier New', monospace;
    color: #6c757d;
    font-size: 13px;
    font-weight: 600;
}

/* ==========================================================================
   Nessun Veicolo - Warning e Configuratore Inline
   ========================================================================== */

.dimsport-vehicle-required {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    position: relative;
    z-index: 1;
}

.warning-box {
    background: linear-gradient(135deg, #fff9e6 0%, #ffeaa7 100%);
    border: 2px solid #ffd93d;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
    position: relative;
    overflow: hidden;
}

.warning-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

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

.warning-icon {
    font-size: 36px;
    flex-shrink: 0;
    animation: bounce 2s infinite;
    position: relative;
    z-index: 1;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.warning-content {
    position: relative;
    z-index: 1;
}

.warning-content h3 {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 19px;
    font-weight: 700;
}

.warning-content p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
}

/* Configuratore Inline */
.dimsport-inline-configurator {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .dimsport-inline-configurator {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.inline-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inline-selector label {
    font-weight: 700;
    color: #2c3e50;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.inline-selector label::before {
    content: '▶';
    color: #667eea;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.inline-selector:hover label::before {
    transform: translateX(3px);
}

.inline-selector select {
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.inline-selector select:hover:not(:disabled) {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.inline-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.inline-selector select:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.5;
    transform: none !important;
}

.inline-selector select:disabled:hover {
    box-shadow: none;
}

/* Loading Indicator */
.inline-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.inline-loading span {
    font-weight: 600;
    color: #ff0000;
    font-size: 15px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 4px solid #333333;
    border-top: 4px solid #ff0000;
    border-right: 4px solid #cc0000;
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Risultato Compatibilità */
.inline-result {
    grid-column: 1 / -1;
    margin-top: 20px;
}

.compatibility-success,
.compatibility-error {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: 8px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.compatibility-success {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #00ff00;
    border-left: 5px solid #00ff00;
}

.compatibility-error {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #ff0000;
    border-left: 5px solid #ff0000;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.2);
}

/* Selettore Varianti Inline (nel risultato compatibilità) */
.inline-variant-selector {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.inline-variant-selector label {
    display: block;
    margin-bottom: 8px;
    color: #856404;
    font-size: 14px;
}

.inline-variant-selector .variant-count {
    font-weight: normal;
    font-size: 13px;
    opacity: 0.8;
}

.inline-variant-selector .variant-select {
    width: 100%;
    padding: 8px;
    border: 2px solid #ffc107;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Dettagli Variante Selezionata */
.selected-variant-details {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    border: 1px solid #d4edda;
}

.variant-details-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant-details-info .detail-item {
    font-size: 14px;
    color: #2c3e50;
}

.variant-details-info .detail-item.gain {
    color: #28a745;
    font-weight: 600;
}

.variant-details-info .detail-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #ff0000;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.success-icon,
.error-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.success-content h4,
.error-content h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.compatibility-success h4 {
    color: #00ff00;
}

.compatibility-error h4 {
    color: #ff0000;
}

.success-content p,
.error-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.5;
}

.compatibility-success p {
    color: #cccccc;
}

.compatibility-error p {
    color: #cccccc;
}

.error-content p.hint {
    font-weight: 700;
    margin-top: 8px;
    color: #ffffff;
}

/* CTA Button per Incompatibilità */
.incompatible-cta-button {
    display: inline-block;
    margin-top: 20px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 900;
    border-radius: 4px;
    border: 2px solid #ff0000;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.incompatible-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(255, 0, 0, 0.6);
    background: linear-gradient(135deg, #ff3333 0%, #ff0000 100%);
    color: #ffffff;
    text-decoration: none;
    border-color: #ff3333;
}

.incompatible-cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 15px rgba(255, 0, 0, 0.4);
}

/* Info Badges Veloci */
.quick-config-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px 0;
}

.info-badge {
    display: inline-block;
    background: #155724;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.info-badge.gain {
    background: #28a745;
}

/* Pulsante Conferma */
.confirm-vehicle-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.confirm-vehicle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .dimsport-product-vehicle-section {
        padding: 0px;
        margin-bottom: 20px;
    }
    
    .dimsport-vehicle-selected {
        padding: 20px;
    }
    
    .vehicle-title {
        font-size: 18px;
    }
    
    .dimsport-inline-configurator {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .vehicle-info-box {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 20px;
    }
    
    .vehicle-main-info strong {
        font-size: 18px;
    }
    
    .change-vehicle-btn {
        width: 100%;
        padding: 14px 24px;
    }
    
    .warning-box {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    
    .warning-icon {
        font-size: 42px;
    }
    
    .compatibility-success,
    .compatibility-error {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    
    .config-details-box {
        padding: 16px;
    }
    
    .variant-selector-box {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .dimsport-product-vehicle-section {
        padding: 0px;
        border-radius: 12px;
    }
    
    .config-badge {
        display: block;
        margin: 8px 0;
    }
    
    .incompatible-cta-button {
        display: block;
        width: 100%;
        padding: 14px 24px;
        font-size: 14px;
        margin-top: 16px;
    }
}

/* ==========================================================================
   Modifica Pulsante Add to Cart
   ========================================================================== */

.single_add_to_cart_button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Highlight quando pulsante diventa "Configura Veicolo" */
button.single_add_to_cart_button:not(.added) {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button.single_add_to_cart_button:not(.added):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

button.single_add_to_cart_button:not(.added):focus {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

button.single_add_to_cart_button:not(.added):active {
    transform: translateY(0);
}

/* ==========================================================================
   Animazioni di Caricamento
   ========================================================================== */

.dimsport-vehicle-selected.loading {
    opacity: 0.6;
    pointer-events: none;
}

.dimsport-vehicle-selected.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Smooth transitions per tutti gli elementi */
* {
    transition-duration: 0.3s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

select, button, input {
    transition-property: all;
}

/* ==========================================================================
   NUOVO DESIGN - SET UP YOUR CAR (Stato 1)
   ========================================================================== */

.warning-box-new {
    background: #FFF8DC;
    border: 1px solid #F0E68C;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

@media (max-width: 768px) {
    .warning-box-new {
        padding: 12px 16px;
        margin-bottom: 16px;
        border-radius: 6px;
    }
}

.warning-icon {
    font-size: 24px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .warning-icon {
        font-size: 20px;
    }
}

.warning-content h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

@media (max-width: 768px) {
    .warning-content h3 {
        font-size: 14px;
    }
}

.warning-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

@media (max-width: 768px) {
    .warning-content p {
        font-size: 12px;
    }
}

.setup-your-car-box {
    background: #2D2D2D;
    border-radius: 8px;
    padding: 24px;
    color: #fff;
}

@media (max-width: 768px) {
    .setup-your-car-box {
        padding: 16px;
        border-radius: 6px;
    }
}

.setup-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .setup-title {
        font-size: 16px;
        margin-bottom: 16px;
    }
}

.setup-selectors {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
}

.setup-selector-group {
    max-width: 100%;
    overflow: hidden;
}

.setup-selector-group:nth-child(3) {
    grid-column: 1 / -1; /* ENGINE occupa tutta la larghezza */
}

@media (max-width: 768px) {
    .setup-selectors {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .setup-selector-group:nth-child(3) {
        grid-column: 1;
    }
}

.setup-select {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .setup-select {
        padding: 10px 12px;
        font-size: 13px;
    }
}

.setup-select option {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.setup-select:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.setup-select:not(:disabled):hover {
    border-color: #CC0000;
}

.setup-select:not(:disabled):focus {
    outline: none;
    border-color: #CC0000;
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.setup-footer {
    text-align: center;
    margin-top: 16px;
}

.setup-help {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

/* ==========================================================================
   NUOVO DESIGN - Compatibilità (Stato 2)
   ========================================================================== */

.compatibility-success-new {
    background: #2D2D2D;
    border-radius: 8px;
    padding: 24px;
}

@media (max-width: 768px) {
    .compatibility-success-new {
        padding: 0;
        border-radius: 6px;
    }
}

/* Header compatto (solo mobile) */
.success-header-compact {
    display: none; /* Nascosto su desktop */
    background: #4CAF50;
    border-radius: 6px;
    padding: 14px 16px;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .success-header-compact {
        display: flex;
    }
}

.success-header-compact:active {
    background: #45a049;
}

.compact-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compact-icon {
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #4CAF50;
}

.compact-text {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.toggle-arrow {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.3s ease;
}

.compatibility-success-new.expanded .toggle-arrow {
    transform: rotate(180deg);
}

/* Contenuto espandibile */
.success-expandable {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

@media (max-width: 768px) {
    .success-expandable {
        max-height: 0;
        opacity: 0;
        padding: 0;
    }
    
    .compatibility-success-new.expanded .success-expandable {
        max-height: 600px;
        opacity: 1;
        padding: 16px;
    }
}

/* Desktop: sempre visibile */
@media (min-width: 769px) {
    .success-expandable {
        max-height: none !important;
        opacity: 1 !important;
        padding: 0;
    }
}

.success-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .success-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
}

.success-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #4CAF50;
    flex: 1;
}

@media (max-width: 768px) {
    .success-title {
        font-size: 14px;
        text-align: center;
    }
}

.change-vehicle-btn-inline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 8px 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .change-vehicle-btn-inline {
        padding: 10px 16px;
        font-size: 12px;
    }
}

.change-vehicle-btn-inline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.change-vehicle-btn-inline:active {
    transform: scale(0.98);
}

.success-badges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.success-badges .badge-item:nth-child(3) {
    grid-column: 1 / -1; /* ENGINE occupa tutta la larghezza */
}

@media (max-width: 768px) {
    .success-badges {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .success-badges .badge-item:nth-child(3) {
        grid-column: 1;
    }
}

.badge-item {
    background: #383838;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Badge cliccabili */
.badge-item.badge-clickable {
    cursor: pointer;
    position: relative;
}

.badge-item.badge-clickable:hover {
    background: #484848;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.badge-item.badge-clickable:active {
    transform: translateY(0);
}

.badge-item.badge-clickable:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Icona di modifica (matita) */
.badge-edit-icon {
    opacity: 0;
    font-size: 16px;
    color: #4CAF50;
    transition: opacity 0.3s ease;
    margin-left: 4px;
}

.badge-item.badge-clickable:hover .badge-edit-icon,
.badge-item.badge-clickable:focus .badge-edit-icon {
    opacity: 1;
}

@media (max-width: 768px) {
    .badge-item {
        padding: 10px 12px;
        gap: 6px;
    }
    
    /* Su mobile, mostra sempre l'icona edit sui badge cliccabili */
    .badge-item.badge-clickable .badge-edit-icon {
        opacity: 0.7;
        font-size: 14px;
    }
    
    .badge-item.badge-clickable:hover .badge-edit-icon,
    .badge-item.badge-clickable:focus .badge-edit-icon {
        opacity: 1;
    }
}

.badge-label {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* Importante per far funzionare ellipsis in flexbox */
}

@media (max-width: 768px) {
    .badge-label {
        font-size: 12px;
    }
}

.badge-check {
    width: 24px;
    height: 24px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* ==========================================================================
   NUOVO DESIGN - Incompatibilità (Stato 3)
   ========================================================================== */

.compatibility-error-new {
    background: #2D2D2D;
    border-radius: 8px;
    padding: 0 24px 24px 24px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .compatibility-error-new {
        padding: 0 16px 16px 16px;
        border-radius: 6px;
    }
}

.error-title {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #DC2626;
    text-align: center;
}

@media (max-width: 768px) {
    .error-title {
        font-size: 14px;
        margin-bottom: 16px;
    }
}

.error-badges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.error-badges .badge-item:nth-child(3) {
    grid-column: 1 / -1; /* ENGINE occupa tutta la larghezza */
}

@media (max-width: 768px) {
    .error-badges {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .error-badges .badge-item:nth-child(3) {
        grid-column: 1;
    }
}

.error-badges .badge-item {
    background: #3D3D3D;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.badge-cross {
    width: 28px;
    height: 28px;
    background: #DC2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.error-footer {
    text-align: center;
    margin-bottom: 16px;
}

.error-help {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.find-product-button {
    display: block;
    background: #fff;
    color: #CC0000;
    text-align: center;
    padding: 14px 32px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.find-product-button:hover {
    background: #f5f5f5;
    color: #CC0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Versione inline per risultato incompatibile nel configuratore */
.compatibility-error-new-inline {
    background: #2D2D2D;
    border-radius: 8px;
    padding: 24px;
    margin-top: 16px;
}

.compatibility-error-new-inline .error-title {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #DC2626;
    text-align: center;
}

.compatibility-error-new-inline .error-badges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.compatibility-error-new-inline .error-badges .badge-item:nth-child(3) {
    grid-column: 1 / -1; /* ENGINE occupa tutta la larghezza */
}

@media (max-width: 768px) {
    .compatibility-error-new-inline .error-badges {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .compatibility-error-new-inline .error-badges .badge-item:nth-child(3) {
        grid-column: 1;
    }
}

.compatibility-error-new-inline .badge-item {
    background: #3D3D3D;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.compatibility-error-new-inline .error-footer {
    text-align: center;
    margin-bottom: 16px;
}

.compatibility-error-new-inline .error-help {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

/* ==========================================================================
   UX MIGLIORATA - Stato Incompatibile del Form Originale
   ========================================================================== */

/* Trasforma il form originale in stato di errore/incompatibilità */
.setup-your-car-box.incompatible-state {
    background: #CC0000 !important;
    transition: background-color 0.4s ease;
}

.setup-your-car-box.incompatible-state .setup-title {
    color: #fff !important;
}

.setup-your-car-box.incompatible-state .setup-title::before {
    content: "The product is not available for this vehicle.";
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.setup-your-car-box.incompatible-state .setup-help {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Select in stato incompatibile - mantengono interattività */
.setup-your-car-box.incompatible-state .setup-select {
    background: rgba(0, 0, 0, 0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    position: relative;
    cursor: pointer !important;
}

.setup-your-car-box.incompatible-state .setup-select:hover {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
}

.setup-your-car-box.incompatible-state .setup-select:focus {
    outline: none !important;
    border: 1px solid #fff !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3) !important;
}

.setup-your-car-box.incompatible-state .setup-select:disabled {
    background: rgba(0, 0, 0, 0.1) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: not-allowed !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Wrapper per aggiungere la X */
.setup-selector-group.incompatible {
    position: relative;
}

.setup-selector-group.incompatible::after {
    content: "✕";
    position: absolute;
    right: 35px; /* Spostato più a sinistra per evitare la freccia del select */
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #CC0000;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .setup-selector-group.incompatible::after {
        right: 32px;
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
}

/* Aggiusta padding per fare spazio alla X mantenendo la freccia del select */
.setup-your-car-box.incompatible-state .setup-select {
    padding-right: 60px !important; /* Spazio per X + freccia dropdown */
}

/* Bottone CTA per prodotto non compatibile */
.incompatible-cta {
    margin-top: 16px;
}

.incompatible-cta .find-product-button {
    display: block;
    background: #fff;
    color: #CC0000;
    text-align: center;
    padding: 14px 32px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.incompatible-cta .find-product-button:hover {
    background: #f5f5f5;
    color: #CC0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Link per 'Can't find your car?' */
.setup-help-link {
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
    font-style: italic;
    transition: color 0.2s;
}
.setup-help-link:hover {
    color: #ffd93d;
    text-decoration: underline;
}

/* In stato incompatibile, il link resta visibile */
.setup-your-car-box.incompatible-state .setup-help-link {
    color: #fff;
    text-decoration: underline;
}
.setup-your-car-box.incompatible-state .setup-help-link:hover {
    color: #ffd93d;
}

/* ==========================================================================
   Add to Cart Button - Disabled State (Incompatible Product)
   ========================================================================== */

/* Quando il prodotto non è compatibile, disabilita visivamente il button */
.compatibility-error-new ~ * form.cart button[type="submit"].disabled,
.compatibility-error-new ~ * form.cart .single_add_to_cart_button.disabled,
form.cart button[type="submit"].disabled,
form.cart .single_add_to_cart_button.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #cccccc !important;
    border-color: #999999 !important;
    color: #666666 !important;
}

/* Nasconde il prezzo quando il prodotto non è compatibile */
.compatibility-error-new ~ * .price,
.compatibility-error-new + .price {
    opacity: 0.5;
}

/* Disabled quantity input */
form.cart input.qty:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* ==========================================================================
   Pulsante "Configure Product" - Disabilitato
   ========================================================================== */

/* Quando il pulsante mostra "Configure Product" (nessun veicolo configurato) */
.single_add_to_cart_button.dimsport-configure-required,
button.single_add_to_cart_button.dimsport-configure-required {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: all !important; /* Permette hover per mostrare cursor */
    filter: grayscale(0.4);
    transition: all 0.3s ease;
}

.single_add_to_cart_button.dimsport-configure-required:hover {
    transform: none !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

.single_add_to_cart_button.dimsport-configure-required:active {
    transform: none !important;
}

