/* ============================================================
   NgPaymentSimulator v3.0 — ngps.css — Telinea
   ============================================================ */

:root {
  --ngps-primary:    #1a73e8;
  --ngps-primary-dk: #1558b0;
  --ngps-green:      #2e7d32;
  --ngps-green-bg:   #f1faf2;
  --ngps-amber:      #e65100;
  --ngps-amber-bg:   #fff3e0;
  --ngps-border:     #e0e4ea;
  --ngps-bg:         #f7f9fc;
  --ngps-text:       #222;
  --ngps-muted:      #888;
  --ngps-radius:     6px;
  --ngps-featured:   #fff8e1;
}

/* ── BLOCO INLINE (abaixo do preco) ───────────────────────── */
.ngps-inline {
  margin: 6px 0 4px;
  line-height: 1.5;
}
.ngps-inline--list {
  margin: 4px 0 2px;
}

.ngps-inline-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 3px;
}
.ngps-inline--list .ngps-inline-row {
  justify-content: center;
}

/* Preco a vista inline */
.ngps-inline-cash .ngps-inline-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--ngps-green);
}
.ngps-inline--list .ngps-inline-cash .ngps-inline-price {
  font-size: 13px;
}

.ngps-inline-cash .ngps-inline-label {
  font-size: 12px;
  color: var(--ngps-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Parcelamento inline */
.ngps-inline-inst .ngps-inline-label {
  font-size: 13px;
  color: var(--ngps-text);
}
.ngps-inline--list .ngps-inline-inst .ngps-inline-label {
  font-size: 12px;
}
.ngps-inline-inst strong {
  color: var(--ngps-primary);
}

/* Imagem inline (PIX, etc) */
.ngps-il-img {
  height: 16px;
  width: auto;
  vertical-align: middle;
}

/* Badge percentual de desconto */
.ngps-badge-off {
  display: inline-block;
  background: var(--ngps-green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  padding: 0 5px;
  line-height: 18px;
}

/* Badge sem juros */
.ngps-badge-free {
  display: inline-block;
  background: var(--ngps-green-bg);
  color: var(--ngps-green);
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  padding: 0 5px;
  line-height: 18px;
  border: 1px solid #c8e6c9;
}

/* Badge com juros */
.ngps-badge-interest {
  display: inline-block;
  background: var(--ngps-amber-bg);
  color: var(--ngps-amber);
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  padding: 0 5px;
  line-height: 18px;
  border: 1px solid #ffccbc;
}

/* Botao expandir */
.ngps-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--ngps-primary);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ngps-toggle-btn:hover { color: var(--ngps-primary-dk); }
.ngps-chevron { transition: transform .2s; }
.ngps-toggle-btn[aria-expanded="true"] .ngps-chevron { transform: rotate(180deg); }

/* ── TABELA EXPANDIDA ─────────────────────────────────────── */
.ngps-table-wrap {
  display: none; /* fechado por padrão — JS abre ao clicar */
  border: 1px solid var(--ngps-border);
  border-radius: var(--ngps-radius);
  overflow: hidden;
  margin-top: 8px;
  background: #fff;
}

/* Bandeiras */
.ngps-brands {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--ngps-bg);
  border-bottom: 1px solid var(--ngps-border);
}
.ngps-brand-img {
  height: 22px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.10));
}

/* Secoes */
.ngps-section {
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--ngps-border);
}
.ngps-section:last-of-type { border-bottom: none; }

.ngps-section-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ngps-primary-dk);
  margin-bottom: 8px;
}

/* Tabela */
.ngps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ngps-table th {
  padding: 5px 8px;
  background: var(--ngps-bg);
  border-bottom: 2px solid var(--ngps-border);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--ngps-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.ngps-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--ngps-border);
  vertical-align: middle;
}
.ngps-table tr:last-child td { border-bottom: none; }
.ngps-table tr:hover td { background: #f0f6ff; }

/* Linha destaque (featured) */
.ngps-row-featured td { background: var(--ngps-featured) !important; }

/* Linha sem juros */
.ngps-free-row td { background: var(--ngps-green-bg); }
.ngps-free-row:hover td { background: #e6f5e7; }

.ngps-td-price { font-weight: 700; color: var(--ngps-green); white-space: nowrap; }
.ngps-td-total { color: var(--ngps-muted); white-space: nowrap; }
.ngps-td-method { white-space: nowrap; }

.ngps-method-img { height: 20px; width: auto; vertical-align: middle; }
.ngps-featured-star { color: #f9a825; margin-left: 4px; font-size: 13px; }
.ngps-muted { color: var(--ngps-muted); }

/* Tabs de bandeiras */
.ngps-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.ngps-tab {
  border: 1px solid var(--ngps-border);
  border-radius: 5px;
  background: var(--ngps-bg);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transition: border-color .15s, background .15s;
}
.ngps-tab img.ngps-tab-img { height: 20px; width: auto; display: block; }
.ngps-tab:hover  { border-color: var(--ngps-primary); background: #e8f0fe; }
.ngps-tab.active { border-color: var(--ngps-primary); background: #e8f0fe; box-shadow: 0 0 0 1px var(--ngps-primary); }

/* Paineis */
.ngps-panel { display: none; }
.ngps-panel.active { display: block; }

/* Nota rodape */
.ngps-note {
  margin: 0;
  padding: 7px 12px;
  font-size: 10px;
  color: var(--ngps-muted);
  background: var(--ngps-bg);
  border-top: 1px solid var(--ngps-border);
}

/* ── RESPONSIVO ───────────────────────────────────────────── */
@media (max-width: 560px) {
  .ngps-table th, .ngps-table td { padding: 4px 5px; font-size: 12px; }
  .ngps-table--inst th:nth-child(3) { display: none; }
  .ngps-table--inst td:nth-child(3) { display: none; }
}

/* ── LISTAGEM (miniature card — contexto compacto) ───────── */
.product-miniature .ngps-inline {
  margin: 3px 0 2px;
  font-size: 12px;
}
.product-miniature .ngps-inline-cash .ngps-inline-price {
  font-size: 13px;
}
.product-miniature .ngps-inline-inst .ngps-inline-label {
  font-size: 12px;
}
.product-miniature .ngps-toggle-btn {
  font-size: 11px;
  margin-top: 1px;
}
.product-miniature .ngps-il-img {
  height: 13px;
}
/* Tabela expandida dentro do card — largura contida */
.product-miniature .ngps-table-wrap {
  position: relative;
  z-index: 10;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  border-radius: 6px;
  margin-top: 6px;
}
.product-miniature .ngps-table {
  font-size: 12px;
}
.product-miniature .ngps-table th,
.product-miniature .ngps-table td {
  padding: 4px 7px;
}

/* ── ADMIN: estrela de destaque ─────────────────────────── */
.ngps-star-btn.off {
  color: #ddd !important;
}
.ngps-star-btn.on {
  color: #f9a825 !important;
}
.ngps-star-btn:hover {
  color: #f9a825 !important;
}
