/* ==========================================================================
   CALCULADORA DE COMPRAS — solo celular y tablet (<1024px)
   En escritorio la calculadora se oculta y se muestra una invitación.
   ========================================================================== */

.pc-section {
  padding: 72px 0;
  background: var(--color-section-bg);
  text-align: center;
}

.pc-app {
  max-width: 560px;
  margin: 32px auto 0;
  --pc-green: var(--color-primary-green);
  --pc-green-dark: #0a7d36;
  --pc-ink: var(--color-text-dark);
  --pc-muted: var(--color-text-muted);
  --pc-border: var(--color-border);
  color: var(--pc-ink);
  text-align: left;
}

/* Invitación para escritorio: oculta en celular/tablet */
.pc-desktop-note {
  display: none;
  max-width: 440px;
  margin: 32px auto 0;
  padding: 36px 32px;
  background: #fff;
  border: 1px solid var(--pc-border, var(--color-border));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  text-align: center;
  flex-direction: column;
  align-items: center;
}
.pc-desktop-ico {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-light-mint);
  color: #0a7d36;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.pc-desktop-ico svg { width: 28px; height: 28px; }
.pc-desktop-t { font-size: 16px; font-weight: 800; color: var(--color-text-dark); }
.pc-desktop-p { margin-top: 8px; font-size: 14px; color: var(--color-text-muted); line-height: 1.5; }

@media (min-width: 1024px) {
  .pc-app { display: none; }
  .pc-desktop-note { display: flex; }
}

/* El enlace del menú solo existe donde existe la calculadora */
@media (min-width: 1024px) {
  .nav-link-touch-only { display: none !important; }
}

/* ---------- tarjetas y textos ---------- */
.pc-card {
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}
.pc-card-sm { padding: 14px 16px; box-shadow: var(--shadow-sm); }
.pc-card-red { background: #FEF3F2; border-color: #FDA29B; text-align: center; }
.pc-center { text-align: center; }
.pc-h3 { font-size: 20px; font-weight: 800; line-height: 1.25; }
.pc-muted { color: var(--pc-muted); font-size: 14px; margin-top: 4px; }
.pc-small { font-size: 12px; }
.pc-b { font-weight: 800; }
.pc-wrap { white-space: normal; overflow: visible; }
.pc-label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.pc-label.pc-small { font-size: 11.5px; margin-bottom: 6px; }
.pc-kicker { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--pc-muted); margin-bottom: 14px; }
.pc-mt-lg { margin-top: 22px; }
.pc-mb-sm { margin-bottom: 12px; }
.pc-err { color: #B42318; font-size: 12px; font-weight: 700; margin: 6px 0 10px; }

/* ---------- campos ---------- */
.pc-input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 12px;
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--pc-ink);
}
.pc-input:focus-visible { outline: 3px solid rgba(13, 177, 75, .35); outline-offset: 1px; border-color: var(--pc-green); }
.pc-input.is-err { border-color: #F04438; }
.pc-input-big { font-size: 18px; font-weight: 900; padding-left: 44px; }
.pc-money { position: relative; display: flex; align-items: center; }
.pc-money-sym { position: absolute; left: 14px; font-weight: 800; pointer-events: none; }
.pc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.pc-card-sm .pc-grid2 { margin-top: 0; }

/* ---------- botones ---------- */
.pc-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 48px;
}
.pc-btn-primary { background: var(--pc-green-dark); color: #fff; }
.pc-btn-primary:active { filter: brightness(.92); }
.pc-btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.pc-btn-ghost { background: #f8fafc; border-color: var(--pc-border); color: var(--pc-ink); }
.pc-btn-block { width: 100%; }
.pc-flex { flex: 1; }
.pc-btn:focus-visible, .pc-pill:focus-visible, .pc-link:focus-visible, .pc-back:focus-visible,
.pc-icon-btn:focus-visible, .pc-qty button:focus-visible, .pc-stepper button:focus-visible, .pc-demo-btn:focus-visible {
  outline: 3px solid rgba(13, 177, 75, .5);
  outline-offset: 2px;
}
.pc-actions { display: flex; gap: 12px; margin-top: 22px; }
.pc-actions-c { justify-content: center; }
.pc-link { background: none; border: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--pc-muted); cursor: pointer; padding: 8px 4px; }
.pc-back { background: none; border: 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--pc-muted); cursor: pointer; padding: 8px 0; margin-bottom: 8px; }
.pc-icon-btn { background: none; border: 0; width: 40px; height: 40px; font-size: 22px; line-height: 1; border-radius: 50%; cursor: pointer; flex-shrink: 0; color: var(--pc-muted); }

/* ---------- barra de saldo ---------- */
.pc-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 12px 16px; border-radius: 14px; margin-bottom: 16px; }
.pc-bar-k { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.pc-bar-v { font-size: 22px; font-weight: 900; }
.pc-bar-r { text-align: right; margin-left: auto; }
.pc-bar-s { font-size: 11px; color: var(--pc-muted); }
.pc-bar-s.pc-b { font-weight: 800; }

/* ---------- carrito ---------- */
.pc-promo { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 6px 10px 14px; margin-bottom: 16px; background: rgba(13, 177, 75, .08); border: 1px solid rgba(13, 177, 75, .25); border-radius: 12px; }
.pc-promo-t { font-size: 12px; font-weight: 800; color: #0a7d36; }
.pc-promo-d { font-size: 11.5px; color: var(--pc-muted); }
.pc-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pc-row .pc-label { margin-bottom: 0; }
.pc-confirm { text-align: center; padding: 12px; margin-bottom: 14px; background: #FEF3F2; border: 1px solid #FECDCA; border-radius: 12px; }
.pc-confirm p { font-size: 12px; font-weight: 800; color: #B42318; margin-bottom: 8px; }
.pc-confirm-btns { display: flex; justify-content: center; gap: 8px; }
.pc-pill { font: inherit; font-size: 12px; font-weight: 700; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--pc-border); background: #fff; cursor: pointer; min-height: 40px; }
.pc-pill-red { background: #D92D20; color: #fff; border-color: #D92D20; }
.pc-empty { text-align: center; padding: 36px 12px; border: 1px dashed #cbd5e1; border-radius: var(--radius-card); background: #fff; }
.pc-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.pc-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--pc-border); border-radius: 12px; }
.pc-item-main { min-width: 0; flex: 1; }
.pc-item-name { font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-item-sub { font-size: 11.5px; color: var(--pc-muted); }
.pc-thumb { flex-shrink: 0; border-radius: 10px; object-fit: cover; }
.pc-thumb-sm { width: 44px; height: 44px; }
.pc-thumb-lg { width: 64px; height: 64px; }
.pc-thumb-tile { display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; }
.pc-qty { display: flex; align-items: center; flex-shrink: 0; border: 1px solid var(--pc-border); border-radius: 999px; overflow: hidden; }
.pc-qty button { background: none; border: 0; width: 38px; height: 38px; font-size: 18px; cursor: pointer; font-family: inherit; }
.pc-qty span { min-width: 22px; text-align: center; font-size: 14px; font-weight: 900; }

/* ---------- escáner ---------- */
.pc-cam { position: relative; aspect-ratio: 4 / 3; margin-bottom: 16px; border-radius: var(--radius-card); background: #000; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pc-video { width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.pc-video.is-on { opacity: 1; }
.pc-cam-msg { position: absolute; left: 24px; right: 24px; text-align: center; font-size: 14px; font-weight: 700; color: #fff; }
.pc-cam-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .6); color: #fff; font-size: 14px; font-weight: 700; }
.pc-cam-loading[hidden], .pc-cam-msg[hidden], .pc-loaderr[hidden] { display: none; }
.pc-loaderr { display: flex; align-items: center; gap: 8px; padding: 12px; margin-bottom: 16px; background: #FEF3F2; border: 1px solid #FECDCA; border-radius: 12px; color: #B42318; }
.pc-loaderr p { font-size: 12px; font-weight: 700; }
.pc-code-row { display: flex; gap: 8px; margin-bottom: 22px; }
.pc-code-row .pc-btn { padding: 11px 18px; }
.pc-demo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 600px) { .pc-demo { grid-template-columns: repeat(3, 1fr); } }
.pc-demo-btn { font: inherit; text-align: left; padding: 10px; background: #fff; border: 1px solid var(--pc-border); border-radius: 12px; cursor: pointer; min-height: 48px; }
.pc-demo-btn:active { border-color: var(--pc-green); }
.pc-demo-n { display: block; font-size: 11.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-demo-p { display: block; font-size: 11px; color: var(--pc-muted); }

/* ---------- producto encontrado / alertas / resumen ---------- */
.pc-found { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pc-price { font-size: 14px; font-weight: 900; color: #0a7d36; }
.pc-stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 16px; }
.pc-stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--pc-border); background: #fff; font-size: 20px; cursor: pointer; font-family: inherit; }
.pc-stepper span { font-size: 20px; font-weight: 900; min-width: 28px; text-align: center; }
.pc-verdict { padding: 14px; border-radius: 12px; text-align: center; font-size: 14px; font-weight: 800; }
.pc-big-ico { font-size: 36px; line-height: 1; margin-bottom: 10px; color: #D92D20; }
.pc-big-ico.pc-ok { color: var(--pc-green-dark); }
.pc-alert-t { font-size: 16px; font-weight: 800; color: #B42318; }
.pc-alert-p { margin-top: 8px; font-size: 14px; color: #B42318; }
.pc-alert-s { margin-top: 4px; font-size: 12px; color: #D92D20; }
.pc-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; background: #f8fafc; border-radius: 12px; margin-top: 8px; }
.pc-sum p { font-size: 10.5px; font-weight: 800; color: var(--pc-muted); }
.pc-sum b { font-size: 14px; font-weight: 900; }

/* ---------- aviso emergente ---------- */
.pc-toast {
  position: fixed; left: 50%; top: 16px; z-index: 9999;
  width: calc(100% - 32px); max-width: 380px;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  padding: 12px 16px; text-align: center;
  background: #fff; border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--shadow-lg);
  transition: opacity .2s ease, transform .2s ease;
}
.pc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.pc-toast-msg { font-size: 14px; font-weight: 800; color: var(--color-text-dark); }
.pc-toast-sub { font-size: 12px; color: var(--color-text-muted); }

@media (max-width: 480px) {
  .pc-section { padding: 48px 0; }
  .pc-card { padding: 20px; }
}
