/* =========================================
   1. RESET E STILI BASE
   ========================================= */
.am-wizard-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.am-wizard-container * { box-sizing: border-box; }

/* Bottoni */
.am-btn-primary {
    background-color: #0073aa;
    color: #fff!important;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
    transition: background 0.2s;
}
.am-btn-primary:hover { background-color: #005177; color: #fff!important; }
.full-width { width: 100%; }
.am-error { background: #f8d7da; color: #721c24; padding: 15px; border: 1px solid #f5c6cb; border-radius: 4px; margin-bottom: 20px; }

/* =========================================
   2. STEP 1: FORM DI RICERCA
   ========================================= */
.am-search-container { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 25px; margin-bottom: 40px; }
.am-search-box h3 { margin-top: 0; margin-bottom: 20px; font-size: 1.5rem; color: #333; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.am-search-form { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; }
.am-search-group { flex: 1 1 150px; }
.am-search-group label { display: block; font-weight: 700; margin-bottom: 8px; color: #444; font-size: 0.9rem; }
.am-search-group input, .am-search-group select { width: 100%; padding: 0 15px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; height: 50px; line-height: normal; background-color: #fff; color: #333; display: block; }
.am-search-action { flex: 1 1 auto; }
.am-search-action button { height: 50px; padding: 0 30px; border-radius: 4px; width:100%; }

/* =========================================
   3. STEP 1: LISTA AUTO (CARD)
   ========================================= */
.am-summary-bar { background: #343a40; color: #fff; padding: 15px 20px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.am-summary-item strong { display: block; font-size: 1.1rem; color: #fff; }
.am-summary-item small { color: #ccc; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; }
.am-btn-secondary { background: #555; color: #fff!important; padding: 5px 12px; font-size: 0.8rem; border-radius: 4px; text-decoration: none; display: inline-block; }

.am-vehicle-card { display: flex; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; margin-bottom: 30px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); transition: transform 0.2s; }
.am-vehicle-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }

.am-card-image { width: 30%; min-width: 300px; background: #f9f9f9; display: flex; align-items: center; justify-content: center; padding: 20px; border-right: 1px solid #eee; }
.am-card-image img { max-width: 100%; height: auto; mix-blend-mode: multiply; }

.am-card-details { flex: 1; padding: 25px; display: flex; flex-direction: column; justify-content: center; }
.am-group-badge { display: inline-block; background: #eee; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; color: #555; margin-bottom: 5px; width: fit-content; }
.am-vehicle-card h3 { margin: 5px 0; font-size: 1.8rem; color: #0073aa; }
.am-vehicle-desc { color: #888; font-style: italic; margin-bottom: 15px; font-size: 0.95rem; }

/* ICONE: Forza Dashicons con Span */
.am-specs-grid { display: flex; flex-wrap: wrap; gap: 20px; color: #555; font-size: 1rem; margin-bottom: 15px; }
.am-specs-grid span { display: flex; align-items: center; gap: 8px; }
.am-specs-grid .dashicons { color: #0073aa; font-size: 20px; width: 20px; height: 20px; display: inline-block; text-rendering: auto; -webkit-font-smoothing: antialiased; }

.am-card-price { width: 25%; min-width: 250px; background: #fbfbfb; border-left: 1px solid #eee; padding: 25px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.price-box small { display: block; color: #777; margin-bottom: 5px; font-size: 0.9rem; }
.am-price-tag { font-size: 2.2rem; font-weight: 800; color: #333; display: block; line-height: 1; }

/* FIX BOTTONE */
/* Il form deve essere largo 100% per far allargare il bottone */
.am-card-price form { width: 100%; } 
.am-btn-select { background: #28a745 !important; color: #fff !important; width: 100% !important; display: block !important; padding: 15px 0 !important; margin-top: 20px !important; border: none !important; border-radius: 4px !important; font-weight: 800 !important; font-size: 1.1rem !important; cursor: pointer; text-transform: uppercase; line-height: normal !important; text-align: center; text-decoration: none; }
.am-btn-select:hover { background: #218838 !important; }

.am-alert-info { background: #fff3cd; color: #856404; padding: 12px; border-radius: 4px; margin-top: 15px; font-size: 0.9rem; border: 1px solid #ffeeba; }

/* =========================================
   4. STEP 2: CHECKOUT
   ========================================= */
.am-step2-layout { display: flex; gap: 40px; margin-top: 30px; align-items: flex-start; }
.am-main-form { flex: 3; }
.am-sidebar { flex: 1; min-width: 350px; }
.am-form-section { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 35px; margin-bottom: 35px; }
.am-form-section h3 { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 25px; font-size: 1.5rem; color: #333; display: flex; align-items: center; gap: 10px; }
.am-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.am-input-group label { font-weight: 700; margin-bottom: 8px; display: block; font-size: 0.95rem; }
.am-input-group input, .am-input-group select { width: 100%; padding: 0 15px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; height: 50px; line-height: normal; background-color: #fff; color: #333; }
.am-input-group textarea { width: 100%; padding: 15px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; height: auto; }
.full-width { grid-column: span 2; }

/* Assicurazioni */
.am-insurance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.am-insurance-card { background: #fff; border: 2px solid #e0e0e0; border-radius: 8px; cursor: pointer; position: relative; overflow: hidden; transition: all 0.2s; }
.am-insurance-card:hover { border-color: #0073aa; transform: translateY(-3px); }
.am-insurance-card.selected { border-color: #0073aa; background-color: #f0f9ff; }
.am-insurance-card input { position: absolute; opacity: 0; }
.am-ins-header { background: #f8f9fa; padding: 20px; text-align: center; border-bottom: 1px solid #eee; }
.am-insurance-card.selected .am-ins-header { background-color: #e6f2ff; border-bottom-color: #b8daff; }
.am-ins-header h4 { margin: 0; font-size: 1.3rem; color: #333; }
.am-ins-price { display: block; font-weight: 800; color: #0073aa; font-size: 1.4rem; margin-top: 5px; }
.am-ins-features { padding: 20px; margin: 0; list-style: none; font-size: 1rem; color: #555; }
.am-ins-features li { margin-bottom: 10px; display: flex; align-items: start; }
.am-ins-features .dashicons { color: #28a745; margin-right: 10px; font-size: 20px; }
.am-insurance-card.am-disabled-card { opacity: 0.5; pointer-events: none; background: #eee; }
.am-lock-msg { background: #f8d7da; color: #721c24; padding: 8px; border-radius: 4px; font-size: 0.85rem; margin-top: 10px; display: block; font-weight: bold; }

/* Accessori & Pagamenti */
.am-extra-item, .am-payment-option { display: flex; align-items: center; padding: 15px 20px; border: 1px solid #e0e0e0; margin-bottom: 15px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.am-extra-item:hover, .am-payment-option:hover { background: #f9f9f9; border-color: #ccc; }
.am-extra-checkbox, .am-payment-option input { margin-right: 20px!important; transform: scale(1.5); cursor: pointer; }
.am-extra-info { flex: 1; font-weight: bold; font-size: 1.1rem; }
.am-extra-price { font-weight: 800; color: #0073aa; font-size: 1.2rem; }
.am-payment-options { display: grid; gap: 15px; }

/* Sidebar */
.am-summary-card { background: #fff; border: 1px solid #0073aa; border-radius: 8px; padding: 25px; box-shadow: 0 5px 25px rgba(0,0,0,0.08); }
.am-info-green-card { background: #e8f5e9; border: 1px solid #c8e6c9; padding: 25px; border-radius: 8px; margin-bottom: 25px; }
.am-card-list li { margin-bottom: 10px; display: flex; align-items: flex-start; font-size: 1rem; }
.am-check-list .dashicons { color: #2e7d32; margin-right: 10px; font-size: 20px; }
.am-summary-total { font-size: 1.8rem; font-weight: 800; color: #0073aa; margin-top: 25px; border-top: 2px solid #eee; padding-top: 20px; display: flex; justify-content: space-between; }

/* =========================================
   5. ANIMAZIONE PREZZO AGGIORNATO
   ========================================= */
@keyframes am-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #28a745; }
    100% { transform: scale(1); }
}

.am-price-pulse {
    animation: am-pulse 0.6s ease-in-out;
}

.am-price-updated-notice {
    animation: am-fadeIn 0.3s ease-in-out;
}

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

/* Mobile */
@media (max-width: 900px) {
    .am-search-form { flex-direction: column; gap: 15px; }
    .am-search-group { width: 100%; }
    .am-search-action button { width: 100%; }
    .am-step2-layout { flex-direction: column; }
    .am-vehicle-card { flex-direction: column; }
    .am-card-image, .am-card-details, .am-card-price { width: 100%; border: none; border-bottom: 1px solid #eee; min-width: auto; }
    .am-sidebar { order: 1; margin-bottom: 30px; width: 100%; max-width: none; }
    .am-main-form { order: 2; width: 100%; }
    .am-insurance-grid, .am-grid-2 { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
}