/* ============================================================
   Utilities Bunker — Percent Off Calculator (v2.1)
   File: /assets/css/modules/calculators/financialcalculators/percent-off-calculator.v2.1.css
   Purpose:
   - Tool-only layout and visual styling for Percent Off Calculator
   - Keeps all custom styling outside ub-toolkit.v2.1.css
   - Mobile-first, accessible, fast, UB-consistent
   ============================================================ */

:root{
  --poc-radius: 16px;
  --poc-gap: 14px;
  --poc-soft: rgba(0,0,0,.06);
  --poc-accent: rgba(249,58,19,.14);
  --poc-accent-strong: rgba(249,58,19,.24);
}

/* Header */
.poc-head{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
}

.poc-title{
  margin:0;
  font-size:var(--ub-fs-5);
}

.poc-subtitle{
  margin:6px 0 0;
  max-width:78ch;
}

/* Lists */
.poc-list{
  margin:0;
  padding-left:18px;
}

.poc-list li + li{
  margin-top:8px;
}

/* Main hero */
.poc-hero{
  display:grid;
  grid-template-columns:1.08fr 0.92fr;
  gap:var(--poc-gap);
  align-items:start;
}

@media (max-width: 980px){
  .poc-hero{
    grid-template-columns:1fr;
  }
}

.poc-panel{
  background:var(--ub-surface-2);
  border:1px solid var(--ub-border);
  border-radius:var(--poc-radius);
  padding:12px;
}

.poc-panel--controls{
  padding:0;
  background:transparent;
  border:none;
}

.poc-form{
  margin-bottom:0;
}

.poc-panel-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
}

.poc-eyebrow{
  font-size:12px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--ub-muted);
}

.poc-panel-title{
  margin-top:4px;
  font-size:clamp(16px, 1rem + 0.35vw, 20px);
  font-weight:950;
  letter-spacing:-0.01em;
}

.poc-panel-sub{
  margin-top:4px;
  font-size:12px;
  color:var(--ub-muted);
  max-width:62ch;
}

/* Mode chips */
.poc-mode-chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.poc-mode-chips .ub-chip{
  min-height:44px;
  padding:10px 14px;
}

/* KPI cards */
.poc-kpis{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}

@media (max-width: 520px){
  .poc-kpis{
    grid-template-columns:1fr;
  }
}

.poc-kpi{
  min-height:86px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background:var(--ub-card-bg);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}

.poc-kpi .k{
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--ub-muted);
}

.poc-kpi .v{
  margin-top:6px;
  font-family:var(--ub-mono);
  font-size:clamp(16px, 0.98rem + 0.45vw, 20px);
  font-weight:950;
  line-height:1.2;
  overflow-wrap:anywhere;
}

/* Visual bar */
.poc-visual{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background:
    linear-gradient(180deg, rgba(249,58,19,.05), rgba(249,58,19,.02)),
    var(--ub-card-bg);
}

.poc-pricebar{
  display:grid;
  gap:8px;
}

.poc-pricebar-labels{
  display:flex;
  justify-content:space-between;
  gap:8px;
  font-size:12px;
  font-weight:900;
  color:var(--ub-muted);
}

.poc-bar-track{
  position:relative;
  width:100%;
  height:20px;
  border-radius:999px;
  overflow:hidden;
  border:1px solid var(--ub-border);
  background:var(--ub-surface-3);
}

.poc-bar-original,
.poc-bar-discount,
.poc-bar-sale{
  position:absolute;
  top:0;
  left:0;
  height:100%;
  transition:width 180ms ease;
}

.poc-bar-original{
  width:100%;
  background:linear-gradient(90deg, rgba(99,102,241,.18), rgba(99,102,241,.10));
}

.poc-bar-discount{
  width:0%;
  z-index:2;
  background:linear-gradient(90deg, rgba(249,58,19,.88), rgba(255,116,38,.88));
}

.poc-bar-sale{
  width:0%;
  z-index:3;
  background:linear-gradient(90deg, rgba(34,197,94,.82), rgba(22,163,74,.82));
  mix-blend-mode:screen;
}

html.ub-theme-light .poc-bar-sale{
  mix-blend-mode:normal;
}

.poc-visual-note{
  margin:10px 0 0;
  font-size:12px;
  color:var(--ub-muted);
}

/* Presets */
.poc-presets{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
}

.poc-presets .ub-chip{
  min-height:44px;
}

/* Divider */
.poc-divider{
  border:none;
  border-top:1px solid var(--ub-border);
  margin:14px 0;
}

/* Settings row */
.poc-settings{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.poc-settings .ub-chip{
  display:inline-flex;
  gap:8px;
  align-items:center;
  min-height:44px;
}

.poc-settings .ub-chip input[type="checkbox"]{
  width:18px;
  height:18px;
  margin:0;
}

/* Actions */
.poc-actions{
  margin-top:12px;
}

/* Alert tweak */
.poc-alert{
  margin-top:12px;
}

/* Work output */
.poc-work{
  font-family:var(--ub-mono);
  font-size:13px;
  line-height:1.6;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.poc-footnote{
  margin-top:10px;
  color:var(--ub-muted);
  font-size:12px;
}

/* FAQ */
.poc-faq-q{
  margin:12px 0 6px;
  font-size:16px;
  font-weight:900;
}

.poc-faq-a{
  margin:0 0 10px;
}

.poc-faq-a:last-child{
  margin-bottom:0;
}

/* Better field spacing if toolkit stacks input/select blocks */
#fieldOriginalWrap,
#fieldPercentWrap,
#fieldSaleWrap{
  min-width:0;
}

/* Right rail button helper */
.ub-btn--block{
  width:100%;
}

/* Focus polish */
.poc-mode-chips .ub-chip:focus,
.poc-presets .ub-chip:focus{
  outline:none;
  box-shadow:0 0 0 4px var(--ub-focus);
}

/* Dark mode tuning */
html.ub-theme-dark .poc-panel,
html.ub-theme-dark .poc-visual,
html.ub-theme-dark .poc-kpi{
  box-shadow:none;
}

html.ub-theme-dark .poc-visual{
  background:
    linear-gradient(180deg, rgba(249,58,19,.08), rgba(249,58,19,.03)),
    var(--ub-card-bg);
}

/* Small screens */
@media (max-width: 640px){
  .poc-head{
    align-items:stretch;
  }

  .poc-head .ub-btn{
    width:100%;
  }

  .poc-panel-top{
    align-items:stretch;
  }

  .poc-mode-chips{
    width:100%;
  }

  .poc-mode-chips .ub-chip{
    flex:1 1 140px;
  }

  .poc-settings{
    align-items:stretch;
  }

  .poc-settings .ub-chip,
  .poc-settings select.ub-chip{
    width:100%;
    justify-content:flex-start;
  }

  .poc-presets .ub-chip{
    flex:1 1 calc(50% - 10px);
  }
}

@media (prefers-reduced-motion: reduce){
  .poc-bar-original,
  .poc-bar-discount,
  .poc-bar-sale{
    transition:none;
  }
}