/**
 * Alientech Vehicle List - Frontend Styles
 *
 * Stili per le pagine pubbliche del plugin:
 * - Archivio veicoli (/vehicles/)
 * - Dettaglio ECU (/vehicles/ecu/{id}/)
 *
 * Naming convention: BEM-like con prefisso `attnvl-`
 * Approccio: Mobile-first con breakpoint desktop a 800px
 *
 * Struttura file:
 * 1. CSS Variables (:root)
 * 2. Layout (.attnvl-wrap, .attnvl-card)
 * 3. Typography (.attnvl-h1, .attnvl-h2)
 * 4. Navigation (.attnvl-breadcrumb)
 * 5. Search Controls (.attnvl-controls, .attnvl-input)
 * 6. Loading State (.attnvl-loader, .attnvl-spinner)
 * 7. Vehicle Table - Mobile (.attnvl-table, .attnvl-mobile-row)
 * 8. ECU Card (.attnvl-ecu-card)
 * 9. Pills (.attnvl-pills, .attnvl-pill)
 * 10. Vehicle Table - Desktop (@media 800px)
 * 11. ECU List (.attnvl-ecu-list)
 * 12. Pagination (.attnvl-pagination)
 * 13. Messages (.attnvl-empty, .attnvl-error)
 * 14. ECU Detail Page
 * 15. Tool Section
 * 16. Connection Method
 * 17. Extras Section
 * 18. Definition List
 * 19. FAB Search Toggle (.attnvl-fab)
 * 20. Accessibility (.attnvl-sr-only)
 * 21. Reduced Motion Preference (@media prefers-reduced-motion)
 *
 * @package ATTNVL
 * @since 0.1.0
 */


/**
 * CSS Custom Properties (Variables)
 *
 * Variabili globali per colori e theming.
 * Possono essere sovrascritte nel tema WordPress.
 *
 * @var --attnvl-accent-color         Colore accento principale (pills, badge)
 * @var --attnvl-border-color         Colore bordi card ECU
 * @var --attnvl-results-divider-color Colore separatore risultati
 * @var --attnvl-ecu-badge-background-color Sfondo badge "ECU"
 * @var --attnvl-obd-icon-color       Colore icona OBD (verde)
 * @var --attnvl-bench-icon-color     Colore icona Bench (blu)
 * @var --attnvl-boot-icon-color      Colore icona Boot (viola)
 * @var --attnvl-vehicle-type-color   Colore icone tipo veicolo
 */
:root {
  --attnvl-accent-color: #ffee00;
  --attnvl-border-color: #C0C1C0;
  --attnvl-results-divider-color: #F0B100;
  --attnvl-ecu-badge-background-color: #555958;
  --attnvl-obd-icon-color: #00c78b;
  --attnvl-bench-icon-color: #1d86da;
  --attnvl-boot-icon-color: #662482;
  --attnvl-vehicle-type-color: #262626;
  --attnvl-pill-color: #3F4443;
  --attnvl-pill-background-color: #D6D6D4;
}

table tbody+tbody {
    border-block-start: none !important;
}

table caption+thead tr:first-child td, table caption+thead tr:first-child th, table colgroup+thead tr:first-child td, table colgroup+thead tr:first-child th, table thead:first-child tr:first-child td, table thead:first-child tr:first-child th {
    border-block-start: none !important;
}
table {
  border-color: transparent !important;
}

/* ==========================================================================
   Layout
   ========================================================================== */

/**
 * Container principale - centra il contenuto con max-width
 */
.attnvl-wrap {
  padding: 24px 0;
  margin: 0 auto;
  max-width: 1200px;
}

/**
 * Card container - box bianco con bordo e ombra leggera
 */
.attnvl-card {
  padding: 16px;
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.attnvl-card__header {
  padding: 0 16px;
  margin-bottom: 12px;
}

/* ==========================================================================
   Typography
   ========================================================================== */

/**
 * Font N27 per headings
 * Il font N27 è caricato da Elementor Custom Fonts
 */
.attnvl-h1,
.attnvl-h2,
.attnvl-h3,
.attnvl-h4,
.attnvl-h5,
.attnvl-h6 {
  font-family: 'N27', sans-serif;
}

.attnvl-h1 {
  margin: 0 0 8px 0;
  font-size: 36px;
  line-height: 1.2;
  text-transform: uppercase;
}

.attnvl-ecu-detail .attnvl-h1 {
  font-size: 28px;
  margin-bottom: 0;
  text-transform: none;
}

.attnvl-center {
  text-align: center;
}

.attnvl-h2 {
  margin: 18px 0 10px 0;
  font-size: 18px;
  line-height: 1.2;
}

.attnvl-other-vehicles .attnvl-h2 {
  margin-top: 24px;
  padding-right: 16px;
  padding-left: 16px;
}

/**
 * Testo secondario/muted - colore grigio
 */
.attnvl-muted {
  margin: 0;
  color: #6b7280;
}

.attnvl-tagline {
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.attnvl-breadcrumb {
  margin: 0 0 8px 0;
}

.attnvl-breadcrumb a {
  text-decoration: none;
}

/* ==========================================================================
   Search Controls
   ========================================================================== */

/**
 * Barra di ricerca - flexbox per allineare input e controlli
 * Mobile: fixed in basso con transizione show/hide
 * Desktop: posizione DOM naturale (static)
 */
.attnvl-controls {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px;
  margin: 0;
  background-color: #F5F5F4;
  border-top: 1px solid #d1d5db;
  transform: translateY(0);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/**
 * Stato nascosto - scivola fuori dallo schermo (mobile only)
 */
.attnvl-controls--hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/**
 * Campo di ricerca - full width su mobile, max 520px su desktop
 */
.attnvl-input {
  padding: 10px 12px;
  width: 100%;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
}

.attnvl-input:focus {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

@media (min-width: 800px) {
  /**
   * Desktop: Search in posizione DOM naturale, sempre visibile
   */
  .attnvl-controls,
  .attnvl-controls--hidden {
    position: static;
    padding-bottom: 48px;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    border-top: none;
    border-bottom: none;
    background-color: transparent;
  }

  .attnvl-input {
    max-width: 360px;
  }
}

/* ==========================================================================
   Loading State
   ========================================================================== */

/**
 * Loader container - mostrato durante le richieste AJAX
 * IMPORTANTE: [hidden] deve sovrascrivere display:flex
 */
.attnvl-loader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.attnvl-loader[hidden] {
  display: none;
}

/**
 * Spinner animato - cerchio che ruota
 */
.attnvl-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-top-color: #111827;
  border-radius: 50%;
  animation: attnvl-spin 0.8s linear infinite;
}

@keyframes attnvl-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Vehicle Table - Mobile (card layout)
   ========================================================================== */

.attnvl-results {
  border-top: 1px solid var(--attnvl-results-divider-color);
  border-bottom: 1px solid var(--attnvl-results-divider-color);
}

/**
 * Mobile: tabella diventa lista di card
 * Ogni riga e' una card con label derivate da data-label
 */
.attnvl-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 1rem;
}

.attnvl-table thead {
  display: none;
}

.attnvl-table,
.attnvl-table tbody,
.attnvl-table tr,
.attnvl-table td {
  display: block;
  width: 100%;
}

.attnvl-table tr {
  padding: 0 16px;
  margin: 10px 0;
}

.attnvl-table td {
  padding: 0;
  border: none;
}

/**
 * Nasconde celle desktop su mobile
 */
.attnvl-table .attnvl-desktop-cell {
  display: none !important;
}

/**
 * Mobile Row - Card layout per ogni veicolo
 */
td.attnvl-mobile-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 24px 12px;
  padding: 24px 0;
  background-color: #ffffff !important;
  border: none;
  border-bottom: 1px solid var(--attnvl-border-color);
  border-radius: 0;
  box-shadow: none;
}

.attnvl-vehicle-group:last-child td.attnvl-mobile-row {
  border-bottom: none;
}

/**
 * Icona Type veicolo - container
 */
.attnvl-vehicle-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--attnvl-vehicle-type-color);
  text-align: center;
  background-color: #ffffff;
  border-radius: 8px;
}

/**
 * Icona tipo veicolo (SVG o img)
 */
.attnvl-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--attnvl-vehicle-type-color);
}

.attnvl-type-icon svg,
.attnvl-type-icon img {
  width: 100%;
  height: 100%;
}

.attnvl-type-icon svg {
  fill: currentColor;
}

@media screen and (min-width: 800px) {
  .attnvl-type-icon {
    width: 32px;
    height: 32px;
  }
}

/* Mobile: icona più grande nel container */
.attnvl-vehicle-type-icon .attnvl-type-icon {
  width: 28px;
  height: 28px;
}

/* Desktop: icona centrata */
.attnvl-desktop-cell .attnvl-type-icon {
  vertical-align: middle;
}

/**
 * Info veicolo con label
 */
.attnvl-vehicle-info p {
  margin: 0;
  font-size: 1rem;
  line-height: 1;
}

.attnvl-vehicle-info strong {
  color: #111827;
}

/**
 * Container cards ECU
 */
.attnvl-ecu-cards {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attnvl-table td[data-label="Control Units"]::before {
  display: none;
}

/**
 * Pseudo-elemento per mostrare label da data-label attribute
 */
.attnvl-table td::before {
  display: inline;
  content: attr(data-label) ": ";
  font-weight: 600;
}

/**
 * Rimuove pseudo-elemento dalla cella mobile (deve essere DOPO td::before)
 */
.attnvl-table td.attnvl-mobile-row::before {
  display: none !important;
  content: none !important;
}

/* ==========================================================================
   ECU Card (mobile layout)
   ========================================================================== */

/**
 * Card ECU con badge, nome e icone metodi
 */
.attnvl-ecu-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  background-color: #ffffff;
  border: 1px solid var(--attnvl-border-color);
  border-radius: 8px;
}

/**
 * Badge "ECU" grigio
 */
.attnvl-ecu-card .attnvl-ecu-badge {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  align-self: stretch;
  width: 36px;
  height: 36px;
  padding: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffee00;
  background-color: var(--attnvl-ecu-badge-background-color);
  border-radius: 4px;
}

/**
 * Nome ECU (link)
 */
.attnvl-ecu-name {
  flex: 1;
  color: #111827;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

.attnvl-ecu-name:hover {
  text-decoration: underline;
}

/**
 * Microprocessore ECU (testo secondario)
 */
.attnvl-micro {
  display: block;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 400;
  color: #6b7280;
}

/**
 * Container icone metodi connessione
 */
.attnvl-ecu-methods {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/**
 * Icone metodi (OBD, Bench, Boot)
 */

.attnvl-ecu-detail .attnvl-ecu-methods .attnvl-method {
  margin-left: 0;
}

.attnvl-ecu-methods .attnvl-method--obd,
.attnvl-ecu-methods .attnvl-method--bench,
.attnvl-ecu-methods .attnvl-method--boot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.attnvl-ecu-methods .attnvl-method--obd {
  color: #00c78b;
}

.attnvl-ecu-methods .attnvl-method--bench {
  color: #2563eb;
}

.attnvl-ecu-methods .attnvl-method--boot {
  color: #7c3aed;
}

/* ==========================================================================
   Pills (features)
   ========================================================================== */

/**
 * Container pills
 */
.attnvl-pills {
  grid-column: span 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/**
 * Pill singola - gialla
 */
.attnvl-pill {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--attnvl-pill-color);
  text-transform: uppercase;
  background-color: var(--attnvl-pill-background-color);
  border-radius: 9999px;
}

/**
 * Pills Row - nascosta su mobile (già presente in mobile-row)
 */
.attnvl-table .attnvl-pills-row {
  display: none;
}

/* ==========================================================================
   Vehicle Table - Desktop (table layout)
   ========================================================================== */

@media (min-width: 800px) {

  .attnvl-results {
    border: none !important;
  }

  /**
   * Nasconde mobile row e mostra celle desktop
   */
  .attnvl-mobile-row {
    display: none !important;
  }

  .attnvl-table .attnvl-desktop-cell {
    display: table-cell !important;
    background-color: #ffffff;
  }

  .attnvl-table thead {
    display: table-header-group;
  }

  .attnvl-table {
    display: table;
  }

  .attnvl-table tbody {
    display: table-row-group;
  }

  .attnvl-table tr {
    display: table-row;
    margin: 0;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  .attnvl-table thead tr {
    border-bottom: 1px solid var(--attnvl-border-color) !important;
  }

  .attnvl-table th,
  .attnvl-table td {
    display: table-cell;
    width: auto;
    vertical-align: top;
    padding: calc(12px + 16px) 8px 0 8px;
    border-bottom: 1px solid #f1f5f9;
  }

  .attnvl-table th {
    padding: 8px;
    vertical-align: middle;
    border: none;
    background-color: #ffffff !important;
  }

  .attnvl-table th:first-of-type {
    padding-top: 12px;
    text-align: center;
  }

  .attnvl-table td:hover {
    background-color: transparent !important;
  }

  .attnvl-table td[data-label="Control Units"] {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .attnvl-table td[data-label="Type"] {
    padding-top: calc(8px + 16px);
    text-align: center;
  }

  /**
   * Header tabella - sticky per scroll lunghi
   */
  .attnvl-table th {
    position: sticky;
    top: 60px;
    z-index: 1;
    text-align: left;
    font-weight: 600;
    background-color: #ffffff;
  }

  .attnvl-controls,
  .attnvl-pagination {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #ffffff;
  }

  /**
   * Nasconde pseudo-elemento label su desktop
   */
  .attnvl-table td::before {
    display: none;
  }

  /**
   * Vehicle group tbody - raggruppa veicolo + pills
   */
  .attnvl-vehicle-group {
    display: table-row-group;
    padding-top: 24px;
  }

  /**
   * Riga pills visibile su desktop
   */
  .attnvl-table .attnvl-pills-row {
    display: table-row;
  }

  .attnvl-pills-row td {
    padding: 16px 8px 32px 8px;
    border-bottom: 1px solid var(--attnvl-border-color);
  }

  /**
   * Rimuove bordo dalla riga dati (il bordo è sulla riga pills)
   * Esclude la cella ECU con rowspan che ha il suo bordo
   */
  .attnvl-vehicle-group > tr:first-child td:not([rowspan]) {
    border-bottom: none;
  }

  /**
   * Cella ECU con rowspan - allineamento verticale top e bordo
   */
  .attnvl-vehicle-group > tr:first-child td[rowspan] {
    vertical-align: top;
    border-bottom: 1px solid var(--attnvl-border-color);
  }

  /**
   * Prima riga compatta - prende solo lo spazio necessario
   * La riga pills si espande per occupare lo spazio rimanente
   */
  .attnvl-vehicle-group > tr:first-child {
    height: 1px;
  }

  .attnvl-pills-row .attnvl-pills {
    grid-column: unset;
  }

  /**
   * Grid layout per search + pagination sulla stessa riga
   */
  section[aria-labelledby="attnvl-title"] {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "header header"
      "search pagination"
      "loader loader"
      "results results"
      "empty empty";
    align-items: start;
    align-content: start;
  }

  .attnvl-card__header {
    grid-area: header;
  }

  .attnvl-controls {
    grid-area: search;
  }

  .attnvl-pagination {
    grid-area: pagination;
    align-self: start;
    margin-top: 0 !important;
    padding: 16px 16px 0 0 !important;
  }

  .attnvl-loader {
    grid-area: loader;
    grid-column: 1 / -1;
  }

  .attnvl-results {
    grid-area: results;
  }

  .attnvl-empty {
    grid-area: empty;
  }
}

/* ==========================================================================
   ECU List (in table cells)
   ========================================================================== */

/**
 * Lista ECU nella cella della tabella - grid verticale
 */
.attnvl-ecu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  list-style: none;
  line-height: 1;
}

.attnvl-ecu-item {
  display: flex;
  gap: 12px;
  border: 1px solid #C0C1C0;
  padding: 8px;
  border-radius: 8px;
}

/**
 * Link ECU - sottolineatura tratteggiata
 */
.attnvl-ecu-item a {
  flex: 1;
  align-self: center;
  font-size: 1rem;
  line-height: 1.3;
  text-decoration: none;
}

.attnvl-ecu-item a:focus {
  outline: 2px solid #111827;
  outline-offset: 2px;
  border-bottom-color: transparent;
}

@media screen and (min-width: 800px) {
  .attnvl-ecu-item a {
    line-height: 1.1;
  }
}

/**
 * ECU Type - testo grigio secondario
 */
.attnvl-ecu-type {
  align-content: center;
  order: -1;
  padding: 0 8px;
  color: #ffee00;
  font-weight: 600;
  font-size: 0.875rem;
  background-color: #555958;
  border-radius: 4px;
}

/**
 * Microprocessore nella lista desktop
 */
.attnvl-ecu-item .attnvl-micro {
  font-size: 0.75rem;
  color: #666;
}

/**
 * Container icone metodi connessione (desktop)
 */
.attnvl-ecu-item .attnvl-ecu-methods {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

/**
 * Icone metodi connessione (desktop)
 */
.attnvl-ecu-item .attnvl-method {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.attnvl-ecu-item .attnvl-method--obd {
  color: var(--attnvl-obd-icon-color);
}

.attnvl-ecu-item .attnvl-method--bench {
  color: var(--attnvl-bench-icon-color);
}

.attnvl-ecu-item .attnvl-method--boot {
  color: var(--attnvl-boot-icon-color);
}

/**
 * Container badge metodi lettura (legacy)
 */
.attnvl-badges {
  display: inline-flex;
  gap: 6px;
  margin-left: 4px;
}

/**
 * Badge base - pillola con bordo
 */
.attnvl-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  padding: 1px 4px;
  font-size: 0.35em;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 4px;
  vertical-align: middle;
  align-content: center;
}

.attnvl-badge--obd {
  color: #166534;
  background-color: #dcfce7;
}

.attnvl-badge--boot {
  color: #9a3412;
  background-color: #ffedd5;
}

.attnvl-badge--bench {
  color: #1e40af;
  background-color: #dbeafe;
}

/* ==========================================================================
   Pagination (frecce + input editabile)
   ========================================================================== */
/*  */
/**
 * Container paginazione
 */
.attnvl-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  margin-top: 14px;
}

/**
 * Bottoni freccia paginazione
 */
.attnvl-pagination__btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  background-color: #fff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease !important;
}

.attnvl-pagination__btn:hover:not([disabled]) {
  background-color: #f3f4f6;
}

.attnvl-pagination__btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.attnvl-pagination__btn svg {
  color: #6b7280;
}

/**
 * Input numero pagina editabile
 */
.attnvl-pagination__input {
  width: 60px !important;
  height: 44px !important;
  padding: 0 8px !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  text-align: center !important;
  background-color: #fff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

/* Nasconde spinner number input */
.attnvl-pagination__input::-webkit-outer-spin-button,
.attnvl-pagination__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.attnvl-pagination__input:focus {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

/**
 * Info "of X" pagine totali
 */
.attnvl-pagination__info {
  margin-left: 4px;
  color: #6b7280;
  font-size: 1rem;
}

/**
 * Bottone generico (legacy, mantenuto per compatibilità)
 */
.attnvl-btn {
  padding: 8px 12px;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
}

.attnvl-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   Messages
   ========================================================================== */

/**
 * Messaggio "nessun risultato"
 */
.attnvl-empty {
  margin-top: 12px;
  color: #6b7280;
}

/**
 * Messaggio di errore
 */
.attnvl-error {
  color: #b91c1c;
}

/* ==========================================================================
   ECU Detail Page
   ========================================================================== */

/**
 * Header ECU detail
 */
.attnvl-ecu-header {
  padding-bottom: 16px;
  margin: 0 16px;
  border-bottom: 1px solid #e5e7eb;
}

.attnvl-back {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  color: inherit;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
}

.attnvl-back:hover {
  text-decoration: underline;
}

.attnvl-ecu-header__content {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0 16px;
  align-items: start;
}

.attnvl-ecu-header__content > * {
  grid-column: 2 / 3;
}

/**
 * Badge ECU type (es. "Engine", "TCU")
 */
.attnvl-ecu-badge {
  grid-column: 1 / 2;
  grid-row: span 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 4px;
  color: #ffee00;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  background-color: #555958;
  border-radius: 4px;
}

.attnvl-ecu-subtitle {
  margin: 0 0 8px 0;
  font-size: 1rem;
  line-height: 1;
}

.attnvl-vehicle-name {
  font-size: 20px;
  margin-bottom: 0;
}

/* ==========================================================================
   Tool Section (KESS3, Powergate)
   ========================================================================== */

.attnvl-tool {
  padding: 32px 0;
  margin: 0 16px;
  border-bottom: 1px solid #e5e7eb;
}

.attnvl-tool__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/**
 * Placeholder icona tool - sostituire con immagine/SVG
 */
.attnvl-tool__icon {
  display: flex;
  align-items: center;
  width: 36px;
  background-color: #ffffff;
  border-radius: 8px;
}

/* Tool icons: sostituire background-color con background-image quando disponibili */

.attnvl-tool__label {
  display: block;
  color: #6b7280;
  font-size: 0.875rem;
}

.attnvl-tool__name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

/* ==========================================================================
   Connection Method (OBD, Bench, Boot)
   ========================================================================== */

.attnvl-method {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  margin-left: 0;
}

.attnvl-ecu-detail .attnvl-method {
  margin-left: 48px;
}

/**
 * Icona metodo connessione - colori distinti per tipo
 */
.attnvl-method__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background-color: #ffffff;
  border-radius: 6px;
}

.attnvl-method__icon--obd {
  color: var(--attnvl-obd-icon-color);
}

.attnvl-method__icon--bench {
  color: var(--attnvl-bench-icon-color);
}

.attnvl-method__icon--boot {
  color: var(--attnvl-boot-icon-color);
}

.attnvl-method__content {
  flex: 1;
  font-size: 1rem;
  line-height: 1.2;
}

.attnvl-method__content p {
  margin: 0;
}

.attnvl-method__features {
  margin: 8px 0 0 0;
  padding-left: 20px;
  list-style: disc;
  color: #6b7280;
  font-style: italic;
}

.attnvl-method__features li {
  margin: 4px 0;
}

/* ==========================================================================
   Extras Section
   ========================================================================== */

.attnvl-extras {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.attnvl-extras__title {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
}

.attnvl-extras p {
  margin: 8px 0;
}

/* ==========================================================================
   Discover Button
   ========================================================================== */

.attnvl-btn--discover {
  display: inline-block;
  padding: 12px 24px;
  margin-top: 16px;
  margin-left: 48px;
  color: #000;
  font-weight: 600;
  text-decoration: none;
  background-color: #ffee00;
  border: none;
  border-radius: 8px;
}

.attnvl-btn--discover:hover {
  background-color: #e6d700;
}



@media screen and (min-width: 800px) {
  .attnvl-ecu-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "detail-header detail-header"
                         "detail-kess   detail-powergate"
                         "detail-compat detail-compat";
  }

  .attnvl-ecu-header {
    grid-area: detail-header;
  }

  .attnvl-tool {
    border-bottom: none;
  }

  .attnvl-tool--kess3 {
    grid-area: detail-kess;
  }

  .attnvl-tool--powergate {
    grid-area: detail-powergate;
    padding-left: 16px;
    border-left: 1px solid var(--attnvl-border-color);
  }

  .attnvl-other-vehicles {
    grid-area: detail-compat;
    padding-top: 32px;
    border-top: 1px solid var(--attnvl-border-color);
  }
}

/* ==========================================================================
   Definition List (legacy, kept for compatibility)
   ========================================================================== */

/**
 * Lista definizioni per dettaglio ECU
 * Mobile: layout a colonna singola
 */
.attnvl-dl {
  margin: 0;
  border-top: 1px solid #f1f5f9;
}

.attnvl-dl__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.attnvl-dl dt {
  font-weight: 600;
}

.attnvl-dl dd {
  margin: 0;
  word-break: break-word;
}

/**
 * Desktop: layout a griglia 1:2
 */
@media (min-width: 800px) {
  .attnvl-dl__row {
    grid-template-columns: 1fr 2fr;
    gap: 12px;
  }
}

/* ==========================================================================
   FAB Search Toggle (Mobile only)
   ========================================================================== */

/**
 * Floating Action Button per toggle ricerca.
 * Visibile solo su mobile (< 800px), nascosto su desktop.
 * Posizionato in basso a destra con z-index sopra il search panel.
 */
.attnvl-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px !important;
  height: 60px !important;
  padding: 0;
  background-color: var(--attnvl-accent-color) !important;
  border: 1px solid #f4e402 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    bottom 0.3s ease;
}

.attnvl-fab:hover {
  background-color: #f4e402 !important;
  transform: scale(1.05);
}

.attnvl-fab:focus {
  outline: 2px solid #111827 !important;
  outline-offset: 2px;
}

/**
 * Icone FAB - transizione rotazione tra search e close
 */
.attnvl-fab-icon {
  color: #000000;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Default: mostra icona search, nascondi close */
.attnvl-fab-icon--search {
  opacity: 1;
}

.attnvl-fab-icon--close {
  position: absolute;
  top: 27%;
  left: 30%;
  opacity: 0;
  transform: rotate(-90deg);
}

/* Stato attivo: mostra close, nascondi search */
.attnvl-fab--active .attnvl-fab-icon--search {
  opacity: 0;
  transform: rotate(90deg);
}

.attnvl-fab--active .attnvl-fab-icon--close {
  opacity: 1;
  transform: rotate(0);
}

/**
 * Quando search è visibile, sposta FAB sopra la barra
 */
.attnvl-controls:not(.attnvl-controls--hidden) ~ .attnvl-fab {
  bottom: 88px;
}

/**
 * Desktop: FAB nascosto
 */
@media (min-width: 800px) {
  .attnvl-fab {
    display: none !important;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/**
 * Screen reader only - nasconde visivamente ma resta accessibile
 */
.attnvl-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ==========================================================================
   Reduced Motion Preference
   ========================================================================== */

/**
 * Rispetta la preferenza utente per movimento ridotto.
 * Disabilita animazioni, transizioni e scroll smooth per utenti
 * con impostazioni di sistema per ridurre il movimento.
 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
