/* ============================================
   MY ACCOUNT PAGE REDESIGN
   Stili Premium per WooCommerce Dashboard
   ============================================ */

.woocommerce-account .woocommerce {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    max-width: 1400px; /* Allargato per dare spazio alle card garage */
    margin: 40px auto;
    padding: 0 20px;
}

/* Sblocca il contenitore padre del tema per la sola pagina account */
.woocommerce-account .site-main,
.woocommerce-account main.site-main {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Elementor container constraint override */
.woocommerce-account .elementor-section-boxed > .elementor-container,
.woocommerce-account .e-con-boxed > .e-con-inner {
    max-width: 1440px !important;
}


/* --- SIDEBAR NAVIGATION (Stile identico ai filtri accordion dello Shop) --- */
.woocommerce-MyAccount-navigation {
    flex: 0 0 280px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    position: sticky;
    top: 90px;
    height: fit-content;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* LI = .cat-accordion.sidebar-accordion */
.woocommerce-MyAccount-navigation ul li {
    margin: 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #E9ECEF;
    /* Identico: transition box-shadow e border-color 0.3s */
    transition: box-shadow 0.3s, border-color 0.3s;
}

/* LI:hover = .cat-accordion:hover */
.woocommerce-MyAccount-navigation ul li:hover {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border-color: #D1D5DB;
}

/* LI.is-active = .cat-accordion.active */
.woocommerce-MyAccount-navigation ul li.is-active {
    border-color: #0A1929;
    box-shadow: 0 4px 10px rgba(10, 25, 41, 0.08);
}

/* LINK = .cat-acc-header */
.woocommerce-MyAccount-navigation ul li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border: none;
    color: #0A1929;
    font-weight: 700;
    text-decoration: none;
    /* Identico: transition all 0.25s ease-in-out */
    transition: all 0.25s ease-in-out;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
}

/* LINK ACTIVE = .cat-accordion.active .cat-acc-header */
.woocommerce-MyAccount-navigation ul li.is-active a {
    background: #0A1929;
    color: #fff;
}

/* LINK HOVER (solo se NON attivo) */
.woocommerce-MyAccount-navigation ul li:not(.is-active) a:hover {
    background: #F8F9FA;
}

/* ICONA = .cat-acc-icon */
.woocommerce-MyAccount-navigation ul li a:before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #D91E36; /* Rosso identico allo shop */
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4F6F8; /* Grigio identico allo shop */
    border-radius: 6px;
    font-size: 16px;
    flex-shrink: 0;
    margin-right: 12px;
    /* Identico: transition all 0.3s */
    transition: all 0.3s;
    border: 1px solid transparent;
}

/* Mappatura Icone (Manteniamo i content code) */
.woocommerce-MyAccount-navigation-link--dashboard a:before { content: "\f015"; } /* fa-home */
.woocommerce-MyAccount-navigation-link--battel-garage a:before { content: "\f494"; } /* fa-warehouse */
.woocommerce-MyAccount-navigation-link--battel-notifiche a:before { content: "\f0f3"; } /* fa-bell */
.woocommerce-MyAccount-navigation-link--orders a:before { content: "\f49e"; } /* fa-box-open */
.woocommerce-MyAccount-navigation-link--edit-address a:before { content: "\f3c5"; } /* fa-map-marker-alt */
.woocommerce-MyAccount-navigation-link--edit-account a:before { content: "\f4fa"; } /* fa-user-cog */
.woocommerce-MyAccount-navigation-link--customer-logout a:before { content: "\f2f5"; } /* fa-sign-out-alt */

/* ICONA ACTIVE = .cat-accordion.active .cat-acc-icon */
.woocommerce-MyAccount-navigation ul li.is-active a:before {
    background: transparent;
    color: #D91E36;
    transform: scale(1.05);
    border: 1px solid rgba(217, 30, 54, 0.3);
}

/* Nessuna freccia/chevron — rimosso: non serve nel contesto di navigazione account */

/* Special Button Logout */
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout {
    margin-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a {
    color: #64748b;
}

.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
    color: #fff;
    background: #0a1929;
    border-left: none;
    padding-left: 24px;
}

/* --- CONTENT AREA --- */
.woocommerce-MyAccount-content {
    flex: 1;
    min-width: 0;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 32px 32px; /* Ridotto da 40px per dare spazio alle card garage */
}

/* Tab Garage: rimuovi il box blanc intorno e lascia le card full-width */
.woocommerce-account .battel-garage-tab .garage-grid {
    gap: 20px;
}

/* Assicura che le card garage usino tutta la larghezza disponibile */
.woocommerce-MyAccount-content .garage-card {
    width: 100%;
}

/* Griglia specs su 6 colonne in una singola riga anche nell'account */
.woocommerce-MyAccount-content .garage-card-body {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}


.woocommerce-MyAccount-content>h3 {
    font-size: 24px;
    font-weight: 800;
    color: #0a1929;
    margin-top: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 16px;
    font-family: 'Montserrat', sans-serif;
}

/* --- MESSAGGI DI WOOCOMMERCE --- */
.woocommerce-message,
.woocommerce-info {
    border-radius: 8px;
    border-top: none;
    border-left: 4px solid #10b981;
    background: #f0fdf4;
    padding: 16px 20px;
    color: #065f46;
}

.woocommerce-error {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    border-top: none;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .woocommerce-account .woocommerce {
        flex-direction: column;
    }

    .woocommerce-MyAccount-navigation {
        position: static;
        flex: none;
        width: 100%;
        margin-bottom: 20px;
    }

    .woocommerce-MyAccount-content {
        padding: 24px;
    }
}

/* ============================================
   STILI TAB "IL MIO GARAGE" E "NOTIFICHE"
   ============================================ */

/* Componenti Condivisi */
.battel-acc-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.battel-acc-card-header {
    padding: 16px 24px;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.battel-acc-vehicle-name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Targa Realistica - Versione Mini */
.battel-mini-plate {
    display: inline-flex;
    align-items: stretch;
    background: #e2e4e6;
    border: 1px solid #0a0a0a;
    border-radius: 4px;
    height: 24px;
    overflow: hidden;
}

.battel-mini-plate-band {
    width: 16px;
    background: #0d47a1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 8px;
    font-weight: bold;
}

.battel-mini-plate-text {
    padding: 0 8px;
    font-family: 'Inter', monospace;
    font-weight: 800;
    font-size: 13px;
    color: #111;
    display: flex;
    align-items: center;
}

/* Toggles Notifiche */
.battel-acc-toggles {
    padding: 24px;
}

.battel-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.battel-toggle-row:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.battel-toggle-row.active {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.battel-toggle-info {
    flex: 1;
}

.battel-toggle-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 16px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.battel-toggle-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* Switch CSS */
.battel-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
    margin-top: 5px;
}

.battel-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.battel-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.battel-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.battel-slider {
    background-color: #10b981;
    /* Verde Successo */
}

input:checked+.battel-slider:before {
    transform: translateX(24px);
}

/* Loading Overlay for Toggles */
.battel-toggle-row.loading {
    opacity: 0.6;
    pointer-events: none;
}/* ============================================
   REDESIGN WOOCOMMERCE FORMS (Edit Account, Edit Address)
   ============================================ */

/* Container and layout */
.woocommerce-MyAccount-content form {
    background: #fff;
    padding: 0;
    border-radius: 0;
}

/* Fields Grid & Layout */
.woocommerce-form-row {
    margin-bottom: 24px;
}

.woocommerce-form-row label {
    display: block;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.woocommerce-form-row label .required {
    color: #ef4444;
    text-decoration: none;
    border-bottom: none;
}

/* Base Inputs */
.woocommerce-MyAccount-content input[type="text"],
.woocommerce-MyAccount-content input[type="email"],
.woocommerce-MyAccount-content input[type="password"],
.woocommerce-MyAccount-content input[type="tel"],
.woocommerce-MyAccount-content select,
.woocommerce-MyAccount-content textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 15px;
    color: #1e293b;
    background-color: #fafafa;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.woocommerce-MyAccount-content input:focus,
.woocommerce-MyAccount-content select:focus,
.woocommerce-MyAccount-content textarea:focus {
    outline: none;
    border-color: #0d47a1;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.1);
}

/* Fieldset (Password Change) */
.woocommerce-MyAccount-content fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-top: 32px;
    background-color: #f8fafc;
}

.woocommerce-MyAccount-content fieldset legend {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    padding: 0 12px;
    background: #f8fafc;
}

/* Buttons */
.woocommerce-MyAccount-content button.button[type="submit"],
.woocommerce-MyAccount-content .woocommerce-Button.button {
    background: #0a1929;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 14px 28px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
    box-shadow: 0 4px 6px -1px rgba(10, 25, 41, 0.1), 0 2px 4px -1px rgba(10, 25, 41, 0.06);
}

.woocommerce-MyAccount-content button.button[type="submit"]:hover,
.woocommerce-MyAccount-content .woocommerce-Button.button:hover {
    background: #D91E36;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(217, 30, 54, 0.2), 0 4px 6px -2px rgba(217, 30, 54, 0.1);
}

/* Specific Address Grid Edit Page */
.woocommerce-Address-title h3 {
    font-size: 20px;
    color: #0f172a;
    margin-bottom: 8px;
}

.woocommerce-Addresses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-top: 24px;
}

.woocommerce-Address {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.woocommerce-Address header {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
    border-bottom: 1px solid #f1f5f9;
    padding: 24px !important;
}

/* Blocco icona + titolo */
.woocommerce-Address header > div {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    gap: 20px !important;
    width: 100% !important;
}

/* Forza dimensioni icone */
.woocommerce-Address header > div > div {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 12px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
}

.woocommerce-Address header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}

.woocommerce-Address address {
    font-style: normal;
    color: #475569;
    line-height: 1.6;
    font-size: 15px;
}

.woocommerce-Address header a.edit {
    font-size: 13px;
    font-weight: 700;
    color: #D91E36;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    background: #fef2f2;
    transition: all 0.3s;
}

.woocommerce-Address header a.edit:hover {
    background: #D91E36;
    color: #fff;
}


/* ============================================
   REDESIGN WOOCOMMERCE TABLES (Orders)
   ============================================ */

table.shop_table.my_account_orders,
table.shop_table.woocommerce-orders-table,
table.shop_table.order_details,
table.shop_table.customer_details {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 24px;
}

table.shop_table thead {
    background-color: #f8fafc;
}

table.shop_table thead th {
    padding: 16px;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

table.shop_table tbody td {
    padding: 20px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    font-size: 14px;
    vertical-align: middle;
}

table.shop_table tbody tr:last-child td {
    border-bottom: none;
}

table.shop_table .order-total .woocommerce-Price-amount {
    font-weight: 700;
    color: #D91E36;
}

table.shop_table td.woocommerce-orders-table__cell-order-actions a.button {
    font-size: 12px;
    padding: 8px 16px;
    margin-right: 8px;
    background: #fff;
    color: #0a1929;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

table.shop_table td.woocommerce-orders-table__cell-order-actions a.button:hover {
    background: #0a1929;
    color: #fff;
    border-color: #0a1929;
    transform: translateY(-1px);
}

mark.order-status {
    background: transparent;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

mark.status-completed { color: #065f46; background: #d1fae5; }
mark.status-processing { color: #92400e; background: #fef3c7; }
mark.status-on-hold { color: #991b1b; background: #fee2e2; }
mark.status-cancelled { color: #475569; background: #e2e8f0; }

/* ============================================
   RESTYLING DETTAGLIO ORDINE SINGOLO (FATTURA)
   ============================================ */

.battel-view-order-details table.shop_table.order_details {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.battel-view-order-details table.shop_table.order_details thead th {
    background-color: #f8fafc;
    color: #475569;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.battel-view-order-details table.shop_table.order_details tfoot th,
.battel-view-order-details table.shop_table.order_details tfoot td {
    background-color: #f8fafc;
    border-top: 2px solid #e2e8f0;
    font-weight: 700;
}

/* Formattazione Customer details / Billing Address */
.woocommerce-customer-details {
    margin-top: 40px;
}

.woocommerce-customer-details h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    color: #0a1929;
    margin-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

.woocommerce-customer-details address {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    color: #475569;
    line-height: 1.8;
    font-style: normal;
    font-size: 15px;
    box-shadow: 0 4px 10px -2px rgba(0,0,0,0.03);
}

.woocommerce-customer-details address p {
    margin-bottom: 0;
}

/* Evidenziamo il nome in grassetto */
.woocommerce-customer-details address::first-line {
    font-weight: 700;
    color: #0f172a;
    font-size: 18px;
}

/* Rimozione forzata bordi verticali su tabelle ordini per similitudine con carrello */
.battel-view-order-details table.shop_table.order_details th,
.battel-view-order-details table.shop_table.order_details td {
    border-left: none !important;
    border-right: none !important;
}

/* Ripristino bordi completi per tabella Dettaglio Ordine con spessore identico ovunque (1px) */
.battel-view-order-details table.shop_table {
    border-collapse: collapse;
}

.battel-view-order-details table.shop_table.order_details th,
.battel-view-order-details table.shop_table.order_details td {
    border: 1px solid #e2e8f0 !important;
}

/* Correzione griglia: angoli curvi + header formattato */
.battel-view-order-details table.shop_table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    overflow: hidden;
}

.battel-view-order-details table.shop_table th,
.battel-view-order-details table.shop_table td {
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
}

.battel-view-order-details table.shop_table th:last-child,
.battel-view-order-details table.shop_table td:last-child {
    border-right: none !important;
}

.battel-view-order-details table.shop_table tr:last-child th,
.battel-view-order-details table.shop_table tr:last-child td {
    border-bottom: none !important;
}

/* Modifica stile header della tabella (Prodotto, Totale) */
.battel-view-order-details table.shop_table.order_details thead th {
    background-color: #f8fafc !important;
    color: #0a1929 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
}

/* Evidenzia il nome nell'elenco indirizzi My Account */
.battel-addresses-dashboard .woocommerce-Address address::first-line {
    font-weight: 700;
    color: #0f172a;
    font-size: 16px;
}

/* INTERATTIVITA' PULSANTI MODIFICA / AGGIUNGI (Rubrica Indirizzi) */
.battel-edit-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.battel-edit-btn:hover {
    background: #0f172a !important;   /* Diventa Blu Navy scuro forte */
    color: #ffffff !important;        /* Testo brillante */
    border-color: #0f172a !important;
    transform: translateY(-2px);      /* Leggera elevazione ("Levitation effect") */
    box-shadow: 0 4px 10px -2px rgba(15, 23, 42, 0.3) !important;
}
.battel-edit-btn:hover i {
    color: #ffffff !important;        /* L'icona a penna segue il testo in bianco */
}
