/* Phone Buying Guide — Nexus Design System */
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&f[]=cabinet-grotesk@700,800&display=swap');

:root {
  --pbg-bg: #f7f6f2;
  --pbg-surface: #f9f8f5;
  --pbg-surface-2: #fbfbf9;
  --pbg-surface-offset: #f3f0ec;
  --pbg-border: oklch(0.28 0.01 80 / 0.13);
  --pbg-divider: #dcd9d5;
  --pbg-text: #28251d;
  --pbg-text-muted: #7a7974;
  --pbg-text-faint: #bab9b4;
  --pbg-primary: #01696f;
  --pbg-primary-hover: #0c4e54;
  --pbg-primary-highlight: #cedcd8;
  --pbg-success: #437a22;
  --pbg-success-highlight: #d4dfcc;
  --pbg-warning: #964219;
  --pbg-warning-highlight: #ddcfc6;
  --pbg-gold: #d19900;
  --pbg-gold-highlight: #e9e0c6;
  --pbg-shadow-sm: 0 1px 3px oklch(0.2 0.01 80 / 0.07);
  --pbg-shadow-md: 0 4px 16px oklch(0.2 0.01 80 / 0.09);
  --pbg-shadow-lg: 0 12px 36px oklch(0.2 0.01 80 / 0.12);
  --pbg-radius-sm: 0.375rem;
  --pbg-radius-md: 0.5rem;
  --pbg-radius-lg: 0.75rem;
  --pbg-radius-xl: 1rem;
  --pbg-radius-2xl: 1.5rem;
  --pbg-font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --pbg-font-body: 'Satoshi', 'Inter', sans-serif;
  --pbg-transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --pbg-text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --pbg-text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --pbg-text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --pbg-text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --pbg-text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
}

.pbg-dark {
  --pbg-bg: #171614;
  --pbg-surface: #1c1b19;
  --pbg-surface-2: #201f1d;
  --pbg-surface-offset: #1d1c1a;
  --pbg-border: oklch(0.85 0.01 80 / 0.1);
  --pbg-divider: #262523;
  --pbg-text: #cdccca;
  --pbg-text-muted: #797876;
  --pbg-text-faint: #5a5957;
  --pbg-primary: #4f98a3;
  --pbg-primary-hover: #227f8b;
  --pbg-primary-highlight: #313b3b;
  --pbg-success: #6daa45;
  --pbg-success-highlight: #3a4435;
  --pbg-warning: #bb653b;
  --pbg-warning-highlight: #564942;
  --pbg-gold: #e8af34;
  --pbg-gold-highlight: #4d4332;
  --pbg-shadow-sm: 0 1px 3px oklch(0 0 0 / 0.2);
  --pbg-shadow-md: 0 4px 16px oklch(0 0 0 / 0.3);
  --pbg-shadow-lg: 0 12px 36px oklch(0 0 0 / 0.4);
}

#pbg-wrapper *, #pbg-wrapper *::before, #pbg-wrapper *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#pbg-wrapper {
  font-family: var(--pbg-font-body);
  font-size: var(--pbg-text-base);
  color: var(--pbg-text);
  background: var(--pbg-bg);
  border-radius: var(--pbg-radius-2xl);
  overflow: hidden;
  box-shadow: var(--pbg-shadow-lg);
  max-width: 860px;
  margin: 2rem auto;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Header */
.pbg-header {
  background: var(--pbg-primary);
  color: #fff;
  padding: 1.75rem 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.pbg-header-left { display: flex; align-items: center; gap: 0.875rem; }
.pbg-logo svg { display: block; }
.pbg-header h1 {
  font-family: var(--pbg-font-display);
  font-size: var(--pbg-text-lg);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  border: none;
}
.pbg-header p { font-size: var(--pbg-text-sm); opacity: 0.82; margin-top: 0.2rem; }
.pbg-dark-toggle {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: var(--pbg-radius-full, 9999px);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
  transition: background var(--pbg-transition);
  flex-shrink: 0;
}
.pbg-dark-toggle:hover { background: rgba(255,255,255,0.25); }

/* Progress bar */
.pbg-progress-bar {
  background: var(--pbg-surface-offset);
  padding: 0.875rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pbg-progress-steps {
  display: flex; gap: 0.375rem; flex: 1;
}
.pbg-step-dot {
  flex: 1; height: 4px; border-radius: 99px;
  background: var(--pbg-divider);
  transition: background var(--pbg-transition);
}
.pbg-step-dot.active { background: var(--pbg-primary); }
.pbg-step-dot.done { background: var(--pbg-success); }
.pbg-progress-label {
  font-size: var(--pbg-text-xs);
  color: var(--pbg-text-muted);
  white-space: nowrap;
}

/* Content area */
.pbg-content {
  padding: 2rem;
  background: var(--pbg-surface);
  min-height: 320px;
}

/* Step */
.pbg-step { display: none; }
.pbg-step.visible { display: block; animation: pbg-fadein 0.25s ease; }
@keyframes pbg-fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pbg-step-heading {
  font-family: var(--pbg-font-display);
  font-size: var(--pbg-text-xl);
  font-weight: 800;
  color: var(--pbg-text);
  margin-bottom: 0.35rem;
  line-height: 1.2;
}
.pbg-step-sub {
  font-size: var(--pbg-text-sm);
  color: var(--pbg-text-muted);
  margin-bottom: 1.5rem;
}

/* Option cards */
.pbg-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}
.pbg-option-card {
  background: var(--pbg-surface-2);
  border: 1.5px solid var(--pbg-border);
  border-radius: var(--pbg-radius-lg);
  padding: 1.375rem 1.5rem;
  cursor: pointer;
  transition: border-color var(--pbg-transition), box-shadow var(--pbg-transition), background var(--pbg-transition), transform var(--pbg-transition);
  user-select: none;
  position: relative;
}
.pbg-option-card:hover {
  border-color: var(--pbg-primary);
  box-shadow: var(--pbg-shadow-sm);
  transform: translateY(-2px);
}
.pbg-option-card.selected {
  border-color: var(--pbg-primary);
  background: color-mix(in oklab, var(--pbg-primary) 8%, var(--pbg-surface-2));
  box-shadow: 0 0 0 3px var(--pbg-primary-highlight);
}
.pbg-option-card:active { transform: scale(0.98); }
.pbg-option-icon { font-size: 1.75rem; margin-bottom: 0.625rem; line-height: 1; }
.pbg-option-title {
  font-weight: 700;
  font-size: var(--pbg-text-base);
  color: var(--pbg-text);
  margin-bottom: 0.25rem;
}
.pbg-option-desc {
  font-size: var(--pbg-text-xs);
  color: var(--pbg-text-muted);
  line-height: 1.5;
}
.pbg-check-badge {
  position: absolute; top: 0.625rem; right: 0.625rem;
  width: 20px; height: 20px;
  background: var(--pbg-primary);
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
}
.pbg-check-badge svg { display: block; }
.pbg-option-card.selected .pbg-check-badge { display: flex; }

/* Budget slider */
.pbg-budget-section { margin-bottom: 1.5rem; }
.pbg-budget-display {
  display: flex; align-items: baseline; gap: 0.5rem;
  margin-bottom: 1rem;
}
.pbg-budget-amount {
  font-family: var(--pbg-font-display);
  font-size: var(--pbg-text-xl);
  font-weight: 800;
  color: var(--pbg-primary);
}
.pbg-budget-label { font-size: var(--pbg-text-sm); color: var(--pbg-text-muted); }
.pbg-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--pbg-primary) 0%, var(--pbg-primary) var(--pbg-range-pct, 30%), var(--pbg-divider) var(--pbg-range-pct, 30%));
  border-radius: 99px;
  cursor: pointer;
  outline: none;
}
.pbg-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--pbg-primary);
  border: 3px solid var(--pbg-surface);
  box-shadow: var(--pbg-shadow-sm);
  cursor: pointer;
  transition: transform var(--pbg-transition);
}
.pbg-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.pbg-range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--pbg-primary);
  border: 3px solid var(--pbg-surface);
  box-shadow: var(--pbg-shadow-sm);
  cursor: pointer;
}
.pbg-range-labels {
  display: flex; justify-content: space-between;
  font-size: var(--pbg-text-xs); color: var(--pbg-text-faint);
  margin-top: 0.375rem;
}
.pbg-budget-category {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--pbg-radius-md);
  font-size: var(--pbg-text-sm);
  font-weight: 600;
  display: flex; align-items: center; gap: 0.5rem;
}
.pbg-budget-category.budget-tier { background: var(--pbg-success-highlight); color: var(--pbg-success); }
.pbg-budget-category.mid-tier { background: var(--pbg-gold-highlight); color: var(--pbg-gold); }
.pbg-budget-category.premium-tier { background: var(--pbg-primary-highlight); color: var(--pbg-primary); }
.pbg-budget-category.flagship-tier { background: var(--pbg-warning-highlight); color: var(--pbg-warning); }

/* Checklist */
.pbg-checklist { display: flex; flex-direction: column; gap: 0.625rem; margin-bottom: 1.5rem; }
.pbg-check-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  background: var(--pbg-surface-2);
  border: 1.5px solid var(--pbg-border);
  border-radius: var(--pbg-radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color var(--pbg-transition), background var(--pbg-transition);
}
.pbg-check-item:hover { border-color: var(--pbg-primary); }
.pbg-check-item.checked {
  border-color: var(--pbg-success);
  background: color-mix(in oklab, var(--pbg-success) 6%, var(--pbg-surface-2));
}
.pbg-check-box {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid var(--pbg-divider);
  border-radius: var(--pbg-radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
  transition: border-color var(--pbg-transition), background var(--pbg-transition);
}
.pbg-check-item.checked .pbg-check-box {
  background: var(--pbg-success); border-color: var(--pbg-success);
}
.pbg-check-item-text { flex: 1; }
.pbg-check-item-title { font-weight: 600; font-size: var(--pbg-text-sm); }
.pbg-check-item-hint { font-size: var(--pbg-text-xs); color: var(--pbg-text-muted); margin-top: 0.15rem; }

/* Results */
.pbg-results-header {
  display: flex; align-items: flex-start; gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.25rem;
  background: color-mix(in oklab, var(--pbg-primary) 7%, var(--pbg-surface-2));
  border-radius: var(--pbg-radius-lg);
  border: 1.5px solid var(--pbg-primary-highlight);
}
.pbg-results-icon { font-size: 2rem; flex-shrink: 0; }
.pbg-results-title {
  font-family: var(--pbg-font-display);
  font-size: var(--pbg-text-lg);
  font-weight: 800;
  color: var(--pbg-text);
}
.pbg-results-summary { font-size: var(--pbg-text-sm); color: var(--pbg-text-muted); margin-top: 0.25rem; }

.pbg-phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.pbg-phone-card {
  background: var(--pbg-surface-2);
  border: 1.5px solid var(--pbg-border);
  border-radius: var(--pbg-radius-lg);
  overflow: hidden;
  transition: box-shadow var(--pbg-transition), transform var(--pbg-transition);
}
.pbg-phone-card:hover { box-shadow: var(--pbg-shadow-md); transform: translateY(-3px); }
.pbg-phone-card-top {
  background: var(--pbg-surface-offset);
  padding: 1.25rem;
  text-align: center;
  position: relative;
}
.pbg-phone-emoji { font-size: 2.5rem; }
.pbg-phone-badge {
  position: absolute; top: 0.5rem; right: 0.5rem;
  font-size: var(--pbg-text-xs);
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--pbg-radius-full, 9999px);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pbg-badge-top { background: var(--pbg-warning-highlight); color: var(--pbg-warning); }
.pbg-badge-best-value { background: var(--pbg-success-highlight); color: var(--pbg-success); }
.pbg-badge-premium { background: var(--pbg-primary-highlight); color: var(--pbg-primary); }
.pbg-phone-card-body { padding: 1rem 1.25rem 1.25rem; }
.pbg-phone-name {
  font-weight: 700;
  font-size: var(--pbg-text-base);
  color: var(--pbg-text);
  margin-bottom: 0.2rem;
}
.pbg-phone-price {
  font-family: var(--pbg-font-display);
  font-weight: 800;
  color: var(--pbg-primary);
  font-size: var(--pbg-text-base);
  margin-bottom: 0.75rem;
}
.pbg-phone-specs { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.875rem; }
.pbg-spec {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: var(--pbg-text-xs);
  color: var(--pbg-text-muted);
}
.pbg-spec-icon { font-size: 0.875rem; flex-shrink: 0; }
.pbg-gsmarena-link {
  display: flex; align-items: center; justify-content: center; gap: 0.375rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--pbg-primary);
  color: #fff;
  font-size: var(--pbg-text-xs);
  font-weight: 600;
  border-radius: var(--pbg-radius-sm);
  text-decoration: none;
  transition: background var(--pbg-transition);
}
.pbg-gsmarena-link:hover { background: var(--pbg-primary-hover); color: #fff; text-decoration: none; }

/* Tips section */
.pbg-tips {
  margin-top: 1.5rem;
  background: var(--pbg-surface-offset);
  border-radius: var(--pbg-radius-lg);
  padding: 1.25rem;
}
.pbg-tips h3 {
  font-family: var(--pbg-font-display);
  font-size: var(--pbg-text-base);
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--pbg-text);
}
.pbg-tips ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.pbg-tips li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: var(--pbg-text-sm); color: var(--pbg-text-muted); }
.pbg-tips li::before { content: "→"; color: var(--pbg-primary); font-weight: 700; flex-shrink: 0; margin-top: 0.05rem; }

/* Footer / navigation */
.pbg-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 2rem;
  background: var(--pbg-surface-offset);
  border-top: 1px solid var(--pbg-divider);
  gap: 1rem;
}
.pbg-btn {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--pbg-radius-md);
  font-size: var(--pbg-text-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--pbg-transition), color var(--pbg-transition), box-shadow var(--pbg-transition);
  font-family: var(--pbg-font-body);
}
.pbg-btn:active { transform: scale(0.97); }
.pbg-btn-primary {
  background: var(--pbg-primary);
  color: #fff;
}
.pbg-btn-primary:hover { background: var(--pbg-primary-hover); box-shadow: var(--pbg-shadow-sm); }
.pbg-btn-ghost {
  background: transparent;
  color: var(--pbg-text-muted);
  border: 1.5px solid var(--pbg-border);
}
.pbg-btn-ghost:hover { color: var(--pbg-text); border-color: var(--pbg-primary); }
.pbg-btn:disabled { opacity: 0.4; pointer-events: none; }
.pbg-btn-restart {
  background: transparent;
  color: var(--pbg-primary);
  border: none;
  font-size: var(--pbg-text-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--pbg-font-body);
  padding: 0.6rem 1rem;
  border-radius: var(--pbg-radius-sm);
  transition: background var(--pbg-transition);
}
.pbg-btn-restart:hover { background: var(--pbg-primary-highlight); }

/* Utility */
.pbg-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.pbg-hidden { display: none !important; }
.pbg-gsmarena-note {
  font-size: var(--pbg-text-xs);
  color: var(--pbg-text-faint);
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pbg-divider);
}
.pbg-gsmarena-note a { color: var(--pbg-primary); text-decoration: none; }
.pbg-gsmarena-note a:hover { text-decoration: underline; }

/* Multi-select note */
.pbg-multi-note {
  font-size: var(--pbg-text-xs);
  color: var(--pbg-text-muted);
  margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.375rem;
}

@media (max-width: 600px) {
  .pbg-header { padding: 1.25rem 1.25rem 1rem; }
  .pbg-content { padding: 1.25rem; }
  .pbg-footer { padding: 1rem 1.25rem; flex-wrap: wrap; }
  .pbg-progress-bar { padding: 0.75rem 1.25rem; }
  .pbg-header h1 { font-size: 1.1rem; }
}
