/* =========================================================
   Loja (Agente C): gift cards (gc-) e pacotes (pk-)
   ========================================================= */

/* ---------- Legenda de níveis ---------- */
.gc-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 12px 16px; margin-bottom: 16px;
}
.gc-legend-title { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.gc-legend-title .ic { width: 16px; height: 16px; color: var(--primary-2); }
.gc-legend-items { display: flex; flex-wrap: wrap; gap: 8px; }
.gc-legend-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
}
.gc-legend-pref { font-size: 12px; color: var(--text-2); letter-spacing: .04em; }

/* ---------- Filtros ---------- */
.gc-filters {
  display: grid; gap: 10px; margin-bottom: 14px;
  grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr));
}
.gc-filters > * { min-width: 0; }
.gc-filters select.input { width: 100%; }
.gc-search .input { width: 100%; }

.gc-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; margin-bottom: 10px; font-size: 14px; }
.gc-count strong { color: var(--text); }

/* ---------- Tabela (grid) ---------- */
.gc-table { padding: 0; overflow: hidden; }
.gc-row {
  display: grid; align-items: center; gap: 12px;
  /* colunas fixas iguais em todas as linhas (cada linha é um grid próprio) */
  --gc-acoes: 236px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .9fr) minmax(0, .95fr) minmax(0, .85fr) var(--gc-acoes);
  padding: 12px 16px; border-top: 1px solid var(--border);
  transition: background .15s ease;
}
.gc-row:not(.gc-head):hover { background: var(--surface-2); }
.gc-head {
  border-top: 0; background: var(--surface-2);
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding-top: 10px; padding-bottom: 10px;
}
.gc-h-acoes { text-align: right; }
.gc-row-lend { background: linear-gradient(90deg, rgba(251, 191, 36, .07), transparent 45%); }
.gc-row-lend:hover { background: linear-gradient(90deg, rgba(251, 191, 36, .12), var(--surface-2) 45%) !important; }

.gc-c { min-width: 0; }
.gc-c-nome { display: flex; align-items: center; gap: 10px; }
.gc-nome-txt { display: flex; flex-direction: column; min-width: 0; }
.gc-nome-txt strong, .gc-nome-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-nome-txt small { font-size: 12px; }

.gc-code { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; max-width: 100%; overflow: hidden; }
.gc-pref {
  font-weight: 700; font-size: 13.5px; letter-spacing: .06em; color: var(--primary-3);
  background: var(--primary-soft); padding: 2px 6px; border-radius: 6px;
}
.gc-mask { color: var(--muted); font-size: 12px; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; }
.gc-gold {
  color: #fde68a !important; background: rgba(251, 191, 36, .14) !important;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, .45), 0 0 14px rgba(251, 191, 36, .25);
  text-shadow: 0 0 8px rgba(251, 191, 36, .45);
}
.gc-legend-pref.gc-gold { padding: 1px 6px; border-radius: 6px; }

.gc-c-data { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.gc-c-data .ic { width: 14px; height: 14px; flex: none; }
.gc-c-valor strong { font-family: var(--font-display); font-size: 15.5px; color: var(--text); white-space: nowrap; }

.gc-c-acoes { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.gc-c-acoes .btn { white-space: nowrap; }
.gc-c-acoes .gc-add, .gc-c-acoes .gc-incart { flex: none; }
.gc-c-acoes .gc-recarga { flex: 1 1 0; min-width: 0; justify-content: center; }
.gc-c-acoes .gc-recarga span { overflow: hidden; text-overflow: ellipsis; }
.gc-add-txt { display: none; }
.gc-incart { opacity: .9; }

/* desktop médio: botão de recarga só com ícone, "No carrinho" só com check */
@media (max-width: 1280px) and (min-width: 860px) {
  .gc-row { --gc-acoes: 132px; }
  .gc-recarga span, .gc-incart span { display: none; }
}

/* ---------- Mobile/tablet: cada linha vira card ---------- */
@media (max-width: 1080px) {
  .gc-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gc-search { grid-column: 1 / -1; }
}

@media (max-width: 859.98px) {
  .gc-table { background: transparent; border: 0; box-shadow: none; overflow: visible; display: grid; gap: 10px; }
  .gc-head { display: none; }
  .gc-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "nome  valor"
      "cod   nivel"
      "reg   data"
      "acoes acoes";
    gap: 10px 12px; padding: 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  }
  .gc-row:not(.gc-head):hover { background: var(--surface); }
  .gc-row-lend { border-color: rgba(251, 191, 36, .4); background: linear-gradient(160deg, rgba(251, 191, 36, .08), var(--surface) 55%); }
  .gc-row-lend:hover { background: linear-gradient(160deg, rgba(251, 191, 36, .08), var(--surface) 55%) !important; }
  .gc-c-nome { grid-area: nome; }
  .gc-c-valor { grid-area: valor; justify-self: end; }
  .gc-c-valor strong { font-size: 17px; }
  .gc-c-cod { grid-area: cod; }
  .gc-c-nivel { grid-area: nivel; justify-self: end; }
  .gc-c-reg { grid-area: reg; }
  .gc-c-data { grid-area: data; justify-self: end; }
  .gc-c-acoes {
    grid-area: acoes; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px;
    padding-top: 10px; border-top: 1px dashed var(--border);
  }
  .gc-c-acoes .btn { width: 100%; justify-content: center; min-height: 40px; }
  .gc-add-txt { display: inline; }
  .gc-recarga span, .gc-incart span { display: inline; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 420px) {
  .gc-filters { grid-template-columns: minmax(0, 1fr); }
  .gc-legend { padding: 10px 12px; }
  .gc-legend-items { gap: 6px; }
  .gc-row { padding: 12px; }
  .gc-c-acoes { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Pacotes (página) ----------
   O card em si (.pk-*) mora em /css/pacote-card.css (compartilhado com o admin).
   Aqui só o que é da página da loja: quadro informativo (.pkl-) e modais de compra (.pkm-). */
.pkl-info {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; margin-bottom: 18px;
  border-color: var(--border-2);
  background: linear-gradient(120deg, var(--primary-soft), var(--surface) 60%);
}
.pkl-info-ic {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--primary-soft); color: var(--primary-2);
}
.pkl-info-ic .ic { width: 20px; height: 20px; }
.pkl-info > div { flex: 1; min-width: 0; }
.pkl-info p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; }
.pkl-info b, .pkl-info strong { color: var(--text); }
.pkl-info-cta { flex: none; align-self: center; }

/* modal de compra / entrega (<dialog>) */
.pkm {
  padding: 0; border: 0; background: transparent; color: var(--text);
  width: 480px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); margin: auto; overflow: hidden;
}
.pkm::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); }
.pkm-box {
  display: flex; flex-direction: column; max-height: calc(100dvh - 24px); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}
.pkm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; }
.pkm-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; overflow-wrap: anywhere; }
.pkm-body { padding: 4px 18px 16px; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.pkm-body > p { margin: 0; font-size: 14px; line-height: 1.5; }
.pkm-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 18px 16px; border-top: 1px solid var(--border); }
.pkm-nome { display: flex; align-items: center; gap: 10px; font-weight: 600; overflow-wrap: anywhere; }
.pkm-nome i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--pk, var(--primary)); }
.pkm-itens { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pkm-itens li {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px;
}
.pkm-itens li span:first-child { flex: none; font-weight: 800; }
.pkm-itens li span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkm-itens li span:last-child { flex: none; color: var(--text-2); font-weight: 600; }
.pkm-resumo { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); }
.pkm-resumo div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.pkm-resumo strong { font-size: 15px; }
.pkm-resumo .pkm-total strong { font-family: var(--font-display); font-size: 20px; }
.pkm-resumo .pkm-neg { color: var(--red); }
.pkm-aviso {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.45;
  color: var(--amber); background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .35);
}
.pkm-aviso.err { color: var(--red); background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .35); }
.pkm-aviso .ic { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.pkm-ok { display: flex; align-items: center; gap: 10px; color: var(--green); font-weight: 600; }
.pkm-ok .ic { width: 22px; height: 22px; }
.pkm-entregas { display: flex; flex-direction: column; gap: 10px; }
.pkm-ent { padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.pkm-ent-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13.5px; min-width: 0; }
.pkm-ent-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 600px) {
  .pkl-info { flex-wrap: wrap; }
  .pkl-info-cta { width: 100%; justify-content: center; }
  .pkm-foot .btn { flex: 1 1 auto; justify-content: center; }
}
