/* ==========================================================================
   Kibhu · Recompensas, cupones y ahorros
   Blanco, negro y azul Kibhu. Dorado = premios. Verde = solo ahorro/beneficio.
   Todas las clases usan el prefijo .kr- para no chocar con el resto del sitio.
   ========================================================================== */
:root {
  --kr-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --kr-blue: #1D63ED;
  --kr-blue-600: #1752CC;
  --kr-blue-50: #EEF3FE;
  --kr-blue-100: #DCE7FD;
  --kr-ink: #0B1220;
  --kr-ink-2: #0F1B3D;
  --kr-text: #334155;
  --kr-muted: #667085;
  --kr-line: #E6EAF2;
  --kr-bg: #F5F7FB;
  --kr-surface: #FFFFFF;
  --kr-gold: #E9A400;
  --kr-gold-2: #FFC83D;
  --kr-gold-50: #FFF7E0;
  --kr-gold-ink: #7A5200;
  --kr-green: #12924A;
  --kr-green-50: #E6F6EC;
  --kr-red: #C4320A;
  --kr-red-50: #FEF1EC;
  --kr-radius: 14px;
  --kr-radius-lg: 20px;
  --kr-shadow: 0 1px 2px rgba(11, 18, 32, .04), 0 8px 24px rgba(11, 18, 32, .06);
  --kr-ease: cubic-bezier(.2, .8, .2, 1);
}

.kr { font-family: var(--kr-font); color: var(--kr-text); -webkit-font-smoothing: antialiased; }
.kr *, .kr *::before, .kr *::after { box-sizing: border-box; }
.kr [hidden] { display: none !important; }
.kr-page { max-width: 1080px; margin: 0 auto; padding: 16px; }
@media (min-width: 1024px) { .kr-page { padding: 28px 36px; } }

.kr h1, .kr h2, .kr h3 { color: var(--kr-ink); margin: 0; letter-spacing: -.01em; }
.kr h1 { font-size: 1.5rem; font-weight: 800; }
.kr h2 { font-size: 1.125rem; font-weight: 800; }
.kr h3 { font-size: 1rem; font-weight: 700; }
.kr-sub { color: var(--kr-muted); font-size: .875rem; margin-top: 2px; }
.kr-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.kr-head__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--kr-gold-50); font-size: 22px; flex: none; }

.kr-money { font-variant-numeric: tabular-nums; font-weight: 800; }
.kr-gain { color: var(--kr-green); }
.kr-prize { color: var(--kr-gold-ink); }
.kr-strike { text-decoration: line-through; color: var(--kr-muted); font-weight: 500; }

/* ---------- Tarjetas ---------- */
.kr-card { background: var(--kr-surface); border: 1px solid var(--kr-line); border-radius: var(--kr-radius-lg); box-shadow: var(--kr-shadow); padding: 18px; }
.kr-card + .kr-card { margin-top: 14px; }
.kr-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .kr-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kr-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kr-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Saldo principal ---------- */
.kr-hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px;
  background: radial-gradient(120% 140% at 100% 0%, #1D63ED 0%, #0F1B3D 55%, #0B1220 100%);
  color: #fff; box-shadow: 0 18px 40px rgba(15, 27, 61, .28);
}
.kr-hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 61, .35), rgba(255, 200, 61, 0) 70%);
}
.kr-hero__label { font-size: .8125rem; opacity: .8; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kr-hero__amount { font-size: 2.6rem; line-height: 1.1; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.kr-hero__amount small { font-size: 1rem; opacity: .7; font-weight: 600; margin-left: 4px; }
.kr-hero__row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.kr-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: rgba(255, 255, 255, .12); color: #fff; }
.kr-pill--gold { background: var(--kr-gold-2); color: #3b2700; }
.kr-hero__gift { position: absolute; right: 18px; bottom: 14px; font-size: 54px; opacity: .95; z-index: 1; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }

/* ---------- Meta / progreso ---------- */
.kr-goal { margin-top: 14px; position: relative; z-index: 1; }
.kr-goal__text { font-size: .85rem; font-weight: 600; opacity: .95; }
.kr-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); overflow: hidden; margin-top: 8px; }
.kr-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--kr-gold), var(--kr-gold-2)); transition: width .8s var(--kr-ease); }
.kr-bar--light { background: var(--kr-blue-50); }

/* ---------- Avisos ---------- */
.kr-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--kr-radius); font-weight: 600; font-size: .9rem; margin-top: 14px; }
.kr-alert__icon { font-size: 20px; line-height: 1; }
.kr-alert--gold { background: var(--kr-gold-50); color: var(--kr-gold-ink); border: 1px solid #F7E0A3; }
.kr-alert--hot { background: var(--kr-red-50); color: var(--kr-red); border: 1px solid #F9CDBB; }
.kr-alert--blue { background: var(--kr-blue-50); color: var(--kr-blue-600); border: 1px solid var(--kr-blue-100); }
.kr-alert--green { background: var(--kr-green-50); color: var(--kr-green); border: 1px solid #BFE6CD; }
.kr-alert small { display: block; font-weight: 500; opacity: .85; margin-top: 2px; }

/* ---------- Accesos rápidos ---------- */
.kr-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.kr-quick button { all: unset; cursor: pointer; text-align: center; background: var(--kr-surface); border: 1px solid var(--kr-line); border-radius: var(--kr-radius); padding: 12px 6px; transition: transform .2s var(--kr-ease), border-color .2s; }
.kr-quick button:hover, .kr-quick button:focus-visible { transform: translateY(-2px); border-color: var(--kr-blue); }
.kr-quick__ico { font-size: 22px; display: block; }
.kr-quick__lbl { font-size: .72rem; font-weight: 700; color: var(--kr-ink); display: block; margin-top: 4px; }
.kr-quick__val { font-size: .72rem; color: var(--kr-muted); display: block; }

/* ---------- Pestañas ---------- */
.kr-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 22px 0 12px; padding-bottom: 2px; }
.kr-tabs::-webkit-scrollbar { display: none; }
.kr-tab { all: unset; cursor: pointer; white-space: nowrap; padding: 9px 14px; border-radius: 999px; font-size: .85rem; font-weight: 700; color: var(--kr-muted); background: var(--kr-surface); border: 1px solid var(--kr-line); }
.kr-tab[aria-selected="true"] { background: var(--kr-ink); color: #fff; border-color: var(--kr-ink); }
.kr-tab:focus-visible { outline: 2px solid var(--kr-blue); outline-offset: 2px; }
.kr-panel[hidden] { display: none; }

/* ---------- Listas ---------- */
.kr-list { list-style: none; margin: 0; padding: 0; }
.kr-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--kr-line); }
.kr-item:last-child { border-bottom: 0; }
.kr-item__ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--kr-bg); font-size: 18px; flex: none; overflow: hidden; }
.kr-item__ico img { width: 100%; height: 100%; object-fit: cover; }
.kr-item__body { min-width: 0; flex: 1; }
.kr-item__title { font-weight: 700; color: var(--kr-ink); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kr-item__meta { font-size: .78rem; color: var(--kr-muted); margin-top: 2px; }
.kr-item__end { text-align: right; flex: none; }
.kr-tag { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: var(--kr-bg); color: var(--kr-muted); }
.kr-tag--gold { background: var(--kr-gold-50); color: var(--kr-gold-ink); }
.kr-tag--green { background: var(--kr-green-50); color: var(--kr-green); }
.kr-tag--blue { background: var(--kr-blue-50); color: var(--kr-blue-600); }
.kr-empty { text-align: center; padding: 28px 12px; color: var(--kr-muted); font-size: .9rem; }
.kr-empty span { font-size: 34px; display: block; margin-bottom: 6px; }

/* ---------- Bienvenida ---------- */
.kr-welcome { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, #FFF7E0, #FFFFFF); border: 1px solid #F7E0A3; border-radius: var(--kr-radius-lg); padding: 16px; margin-top: 14px; }
.kr-welcome__ico { font-size: 34px; }
.kr-welcome__title { font-weight: 800; color: var(--kr-ink); }
.kr-welcome__amount { font-size: 1.6rem; font-weight: 800; color: var(--kr-gold-ink); margin-left: auto; }

/* ---------- Desglose (checkout / envío) ---------- */
.kr-break { font-size: .9rem; }
.kr-break__row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.kr-break__row--benefit { color: var(--kr-green); font-weight: 600; }
.kr-break__row--total { border-top: 1px dashed var(--kr-line); margin-top: 6px; padding-top: 10px; font-weight: 800; color: var(--kr-ink); font-size: 1.05rem; }
.kr-break__note { font-size: .75rem; color: var(--kr-muted); margin-top: 8px; display: flex; gap: 6px; }
.kr-earn { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--kr-gold-50); color: var(--kr-gold-ink); font-weight: 700; font-size: .88rem; }
.kr-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-weight: 600; color: var(--kr-ink); }

/* ---------- Insignia en producto ---------- */
.kr-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--kr-gold-50); color: var(--kr-gold-ink); font-weight: 700; font-size: .82rem; border: 1px solid #F7E0A3; }

/* ---------- Formularios (vendedor / admin) ---------- */
.kr-field { display: grid; gap: 6px; margin-bottom: 14px; }
.kr-field > label, .kr-label { font-size: .8rem; font-weight: 700; color: var(--kr-ink); }
.kr-help { font-size: .75rem; color: var(--kr-muted); }
.kr-input, .kr-select, .kr-textarea { width: 100%; border: 1px solid var(--kr-line); border-radius: 12px; padding: 10px 12px; font: inherit; color: var(--kr-ink); background: #fff; }
.kr-input:focus, .kr-select:focus, .kr-textarea:focus { outline: none; border-color: var(--kr-blue); box-shadow: 0 0 0 3px var(--kr-blue-100); }
.kr-select[multiple] { min-height: 110px; }
.kr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kr-chip { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--kr-line); font-weight: 700; font-size: .85rem; color: var(--kr-ink); background: #fff; }
.kr-chip[aria-pressed="true"] { background: var(--kr-ink); color: #fff; border-color: var(--kr-ink); }
.kr-chip:focus-visible { outline: 2px solid var(--kr-blue); outline-offset: 2px; }
.kr-options { display: grid; gap: 10px; }
@media (min-width: 720px) { .kr-options { grid-template-columns: 1fr 1fr; } }
.kr-option { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--kr-line); border-radius: var(--kr-radius); padding: 14px; cursor: pointer; }
.kr-option:has(input:checked) { border-color: var(--kr-blue); background: var(--kr-blue-50); }
.kr-option input { margin-top: 3px; accent-color: var(--kr-blue); }
.kr-option strong { color: var(--kr-ink); display: block; }
.kr-option span { font-size: .8rem; color: var(--kr-muted); }
.kr-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; color: var(--kr-ink); }
.kr-switch input { position: absolute; opacity: 0; }
.kr-switch i { width: 44px; height: 26px; border-radius: 999px; background: var(--kr-line); position: relative; transition: background .2s; flex: none; }
.kr-switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--kr-ease); }
.kr-switch input:checked + i { background: var(--kr-blue); }
.kr-switch input:checked + i::after { transform: translateX(18px); }
.kr-switch input:focus-visible + i { outline: 2px solid var(--kr-blue); outline-offset: 2px; }

.kr-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; font-weight: 800; font-size: .88rem; background: var(--kr-ink); color: #fff; transition: transform .15s var(--kr-ease), background .2s; }
.kr-btn:hover { background: #000; transform: translateY(-1px); }
.kr-btn:focus-visible { outline: 2px solid var(--kr-blue); outline-offset: 2px; }
.kr-btn--blue { background: var(--kr-blue); }
.kr-btn--blue:hover { background: var(--kr-blue-600); }
.kr-btn--ghost { background: #fff; color: var(--kr-ink); border: 1px solid var(--kr-line); }
.kr-btn--ghost:hover { background: var(--kr-bg); }
.kr-btn--sm { padding: 7px 12px; font-size: .78rem; }
.kr-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 8px; }

.kr-kpi { padding: 16px; }
.kr-kpi__lbl { font-size: .75rem; font-weight: 700; color: var(--kr-muted); text-transform: uppercase; letter-spacing: .04em; }
.kr-kpi__val { font-size: 1.45rem; font-weight: 800; color: var(--kr-ink); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kr-kpi__hint { font-size: .75rem; color: var(--kr-muted); margin-top: 2px; }

.kr-table-wrap { overflow-x: auto; }
.kr-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.kr-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--kr-muted); padding: 8px 10px; border-bottom: 1px solid var(--kr-line); white-space: nowrap; }
.kr-table td { padding: 10px; border-bottom: 1px solid var(--kr-line); white-space: nowrap; }
.kr-table td.kr-num, .kr-table th.kr-num { text-align: right; font-variant-numeric: tabular-nums; }

.kr-flash { padding: 12px 14px; border-radius: 12px; font-weight: 700; margin-bottom: 14px; }
.kr-flash--ok { background: var(--kr-green-50); color: var(--kr-green); }
.kr-flash--err { background: var(--kr-red-50); color: var(--kr-red); }

.kr-example { border: 1px dashed var(--kr-line); border-radius: var(--kr-radius); padding: 14px; background: var(--kr-bg); }
.kr-example__price { font-size: 1.3rem; font-weight: 800; color: var(--kr-ink); }

details.kr-more > summary { cursor: pointer; font-weight: 700; color: var(--kr-blue); list-style: none; }
details.kr-more > summary::-webkit-details-marker { display: none; }

.kr-skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%); background-size: 400% 100%; animation: kr-shimmer 1.4s ease infinite; border-radius: 10px; min-height: 14px; }
@keyframes kr-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.kr-celebrate { animation: kr-pop .6s var(--kr-ease); }
@keyframes kr-pop { 0% { transform: scale(.92); opacity: 0; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1); } }

@media (max-width: 420px) {
  .kr-hero__amount { font-size: 2.15rem; }
  .kr-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .kr *, .kr *::before, .kr *::after { animation: none !important; transition: none !important; }
}
