/* --- Cards de destaques (grid de ícones) — mobile --- */
@media (max-width: 480px) {
  /* Grid: reduz gap */
  .grid.grid-cols-2.sm\:grid-cols-3 {
    gap: 6px !important;
  }
  /* Cards: reduz padding e gap */
  .grid.grid-cols-2.sm\:grid-cols-3 > .flex.items-start {
    gap: 8px;
    padding: 8px 10px;
  }
  /* Ícone menor */
  .grid.grid-cols-2.sm\:grid-cols-3 > .flex.items-start .w-9,
  .grid.grid-cols-2.sm\:grid-cols-3 > .flex.items-start .w-8 {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    border-radius: 7px;
  }
  .grid.grid-cols-2.sm\:grid-cols-3 > .flex.items-start .w-9 i,
  .grid.grid-cols-2.sm\:grid-cols-3 > .flex.items-start .w-8 i {
    font-size: 13px !important;
  }
  /* Container de texto: permite wrap */
  .grid.grid-cols-2.sm\:grid-cols-3 > .flex.items-start > div:last-child {
    min-width: 0;
    overflow: hidden;
  }
  /* Títulos: menores */
  .grid.grid-cols-2.sm\:grid-cols-3 > .flex.items-start .text-xs.font-bold {
    font-size: 10px !important;
    line-height: 1.3;
  }
  /* Valores: menores e com word-break */
  .grid.grid-cols-2.sm\:grid-cols-3 > .flex.items-start .text-\[11px\].font-bold,
  .grid.grid-cols-2.sm\:grid-cols-3 > .flex.items-start .text-\[10px\].font-bold {
    font-size: 9.5px !important;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

/* Nomes das specs (1ª coluna): moto sans em todas as telas */
.table-spec tbody td:first-child {
  font-family: 'moto sans', system-ui, sans-serif !important;
  text-transform: lowercase;
  letter-spacing: -0.01em;
}

/* Hub landing cards: hover + imagem */
.hub-card {
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.hub-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99,104,128,0.3) !important;
  box-shadow: 0 12px 32px rgba(99,104,128,0.14);
}
.hub-card-img {
  transition: background 0.3s ease;
}
.hub-card:hover .hub-card-img {
  background: linear-gradient(135deg, #e9eaf2 0%, #dcdee8 100%) !important;
}
.hub-card img {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.hub-card:hover img {
  transform: scale(1.08);
}

/* ============================================================
   TABELA DE ESPECIFICAÇÕES — CARD LAYOUT NO MOBILE
   Cada linha vira um card: spec name no topo, 2 valores abaixo
   ============================================================ */

@media (max-width: 640px) {

  /* Container: sem scroll horizontal, padding ajustado */
  .overflow-x-auto.rounded-2xl {
    overflow-x: visible !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  /* Tabela: vira container de cards */
  .table-spec {
    display: block !important;
    width: 100% !important;
  }

  /* Thead: vira header fixo estilo "legenda" no topo */
  .table-spec thead {
    display: block;
    width: 100%;
    margin-bottom: 8px;
  }
  .table-spec thead tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: transparent !important;
    border: none !important;
  }
  /* Esconde o "Especificação" do header */
  .table-spec thead th:first-child {
    display: none;
  }
  /* Mostra os nomes dos modelos como legenda */
  .table-spec thead th {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px !important;
    font-size: 12px !important;
    border-radius: 10px;
    margin: 0 2px;
  }
  .table-spec thead th:nth-child(2) {
    background: #f3f4f6;
    color: #6b7280;
  }
  .table-spec thead th:nth-child(3),
  .table-spec thead .th-destaque {
    background: var(--slate-blue, #636880);
    color: white !important;
  }

  /* Tbody: container de cards */
  .table-spec tbody {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
  }

  /* Cada <tr> vira um card */
  .table-spec tbody tr {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease;
  }
  .table-spec tbody tr:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
  }

  /* Primeira célula (nome da spec): barra no topo, ocupa as 2 colunas */
  .table-spec tbody td:first-child {
    grid-column: 1 / -1;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 14px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    font-family: 'moto sans', system-ui, sans-serif !important;
    color: var(--moto-black, #131417);
    text-transform: lowercase;
    letter-spacing: 0.02em;
  }

  /* Células de valor: lado a lado, mesma altura */
  .table-spec tbody td:nth-child(2),
  .table-spec tbody td:nth-child(3) {
    padding: 10px 12px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    text-align: left;
    word-break: break-word;
    min-height: 44px;
    display: flex;
    align-items: flex-start;
  }

  /* Separador entre as 2 colunas de dados */
  .table-spec tbody td:nth-child(2) {
    border-right: 1px solid #f0f0f0;
    color: #6b7280;
  }

  /* Coluna do modelo novo: destaque visual */
  .table-spec tbody td:nth-child(3) {
    color: var(--moto-black, #131417);
    font-weight: 600;
  }

  /* Célula com evolução: fundo sutil */
  .table-spec tbody .cell-evolucao {
    background: rgba(99,104,128,0.08) !important;
    color: var(--moto-black, #131417) !important;
    font-weight: 700 !important;
    font-size: 12px !important;
  }

  /* Título da seção: menor */
  [id$="-especificacoes"] > h2 {
    font-size: 1.1rem !important;
    line-height: 1.25;
    text-align: center;
  }
}

/* Refinamento para telas muito pequenas */
@media (max-width: 380px) {
  .table-spec tbody td:first-child {
    padding: 7px 12px !important;
    font-size: 10px !important;
  }
  .table-spec tbody td:nth-child(2),
  .table-spec tbody td:nth-child(3) {
    padding: 8px 10px !important;
    font-size: 11px !important;
  }
}
