/* Estilos do Spoke Catálogo e Micro-Cards */

.catalogo-container {
  padding: 12px 14px;
}

/* Barra de Pesquisa e Filtros */
.search-bar-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  background-color: var(--bg-primary);
  padding: 6px 0;
  z-index: 50;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input {
  width: 100%;
  height: var(--touch-target);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 14px 0 38px;
  color: var(--text-primary);
  outline: none;
}
.search-input:focus {
  border-color: var(--border-focus);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.btn-filter-trigger {
  width: var(--touch-target);
  height: var(--touch-target);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.btn-filter-trigger.has-active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.filter-badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-primary);
}

/* Chips de Filtros Ativos */
.filter-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.filter-chip {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* Contador e Ordenação */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.sort-select {
  background-color: transparent;
  color: var(--text-secondary);
  border: none;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  text-align: right;
}

/* Micro-card */
.micro-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.micro-card:active {
  border-color: var(--border-focus);
}

.card-top-row {
  display: flex;
  gap: 12px;
}

.card-thumb {
  width: 96px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: var(--bg-surface-elevated);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage-pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background-color: var(--bg-surface-active);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.card-specs-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-primary);
}

.card-price-main {
  font-weight: 700;
  color: #38bdf8; /* Azul claro de alto contraste */
}

.card-price-m2 {
  font-size: 12px;
  color: var(--text-muted);
}

.card-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.action-link {
  flex: 1;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.action-link:active {
  background-color: var(--bg-surface-active);
}

/* Filtros Painel Bottom Sheet */
.filter-group {
  margin-bottom: 18px;
}

.filter-group-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.filter-pill.active {
  background-color: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.filter-select {
  width: 100%;
  height: var(--touch-target);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 0 12px;
  outline: none;
}

.filter-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Linha de Estoque no Micro-Card */
.card-estoque-row {
  font-size: 12px;
  font-weight: 600;
  color: #10b981; /* Verde esmeralda de alto contraste */
}

/* Sentinela de paginação infinita */
.scroll-sentinel {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Tabela de Tipologias (Design Responsivo do Site JMC adaptado para PWA) */
.ref-tipologias-secao {
  margin-top: 16px;
  margin-bottom: 16px;
}

.ref-tipologias-titulo {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ref-tipologias-table-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface-elevated);
}

.ref-tipologias-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  display: block;
}

.ref-tipologias-table thead {
  display: none;
}

.ref-tipologias-table tbody {
  display: block;
  width: 100%;
}

.ref-tipologias-table tbody tr {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  gap: 0;
}

.ref-tipologias-table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.025);
}

.ref-tipologias-table tbody tr:last-child {
  border-bottom: none;
}

.ref-tipologias-table td {
  display: block;
  text-align: center;
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  border: none;
  overflow: hidden;
}

/* Labels acima de cada valor */
.ref-tipologias-table tbody td::before {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 4px;
}

.ref-tipologias-table tbody td:nth-child(1)::before { content: "Tipo"; }
.ref-tipologias-table tbody td:nth-child(2)::before { content: "Dorm"; }
.ref-tipologias-table tbody td:nth-child(3)::before { content: "Suíte"; }
.ref-tipologias-table tbody td:nth-child(4)::before { content: "Vaga"; }
.ref-tipologias-table tbody td:nth-child(5)::before { content: "Banh."; }
.ref-tipologias-table tbody td:nth-child(6)::before { content: "Área"; }
.ref-tipologias-table tbody td:nth-child(7)::before { content: "Valor"; }

/* Coluna Tipo: alinhada à esquerda, semi-negrito */
.ref-tipologias-table tbody td:nth-child(1) {
  font-weight: 600;
  text-align: left;
  padding-left: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Linha 2 de separação visual */
.ref-tipologias-table tbody td:nth-child(5),
.ref-tipologias-table tbody td:nth-child(6),
.ref-tipologias-table tbody td:nth-child(7) {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
  padding-top: 6px;
}

/* Coluna Valor: destaque âmbar, ocupa 2 colunas */
.ref-tipologias-table tbody td:nth-child(7) {
  grid-column: span 2;
  font-weight: 700;
  color: #FFAF00 !important;
  text-align: left;
  padding-left: 12px;
  padding-right: 10px;
  white-space: nowrap;
}
