/* Kompara UI Kit — consolidated visual tokens.
 * Framework-independent CSS. Intentionally opt-in: loading this file alone
 * does not restyle application elements.
 * Source alignment: production brand (emerald), Lovable DS v0.1.0,
 * and the existing Apple-inspired neutral hierarchy.
 */
:root {
  /* Brand and surfaces */
  --k-color-primary: #047857;
  --k-color-primary-hover: #065f46;
  --k-color-primary-soft: #ecfdf5;
  --k-color-primary-soft-foreground: #065f46;
  --k-color-canvas: #f8fafc;
  --k-color-surface: #ffffff;
  --k-color-surface-raised: #ffffff;
  --k-color-surface-sunken: #f1f5f9;
  --k-color-text: #0f172a;
  --k-color-muted: #475569;
  --k-color-faint: #64748b;
  --k-color-border: #e2e8f0;
  --k-color-border-strong: #cbd5e1;

  /* Semantic states — never communicate status by colour alone. */
  --k-color-success: #047857;
  --k-color-success-soft: #ecfdf5;
  --k-color-warning: #a16207;
  --k-color-warning-soft: #fefce8;
  --k-color-danger: #be123c;
  --k-color-danger-soft: #fff1f2;
  --k-color-info: #0369a1;
  --k-color-info-soft: #f0f9ff;
  --k-color-promo: #fef08a;
  --k-color-promo-text: #713f12;

  /* Price semantics */
  --k-color-price: #0f172a;
  --k-color-price-old: #64748b;
  --k-color-price-best: #047857;

  /* Typography — keep production Inter during the migration. */
  --k-font-body: Inter, ui-sans-serif, system-ui, sans-serif;
  --k-font-display: Inter, ui-sans-serif, system-ui, sans-serif;
  --k-text-display: clamp(2.5rem, 6vw, 4rem);
  --k-text-heading-xl: 2rem;
  --k-text-heading-lg: 1.5rem;
  --k-text-heading-md: 1.25rem;
  --k-text-body-lg: 1.0625rem;
  --k-text-body: 1rem;
  --k-text-body-sm: .875rem;
  --k-text-caption: .75rem;
  --k-text-price-sm: 1rem;
  --k-text-price: 1.375rem;
  --k-text-price-lg: 2rem;
  --k-weight-regular: 400;
  --k-weight-medium: 500;
  --k-weight-semibold: 600;
  --k-weight-bold: 700;
  --k-leading-tight: 1.15;
  --k-leading-body: 1.5;

  /* Four-pixel spacing scale */
  --k-space-1: 4px;
  --k-space-2: 8px;
  --k-space-3: 12px;
  --k-space-4: 16px;
  --k-space-5: 20px;
  --k-space-6: 24px;
  --k-space-8: 32px;
  --k-space-10: 40px;
  --k-space-12: 48px;
  --k-space-16: 64px;

  /* Shape, borders, elevation, interaction */
  --k-radius-xs: 6px;
  --k-radius-sm: 10px;
  --k-radius-md: 16px;
  --k-radius-lg: 24px;
  --k-radius-pill: 9999px;
  --k-border-width: 1px;
  --k-focus-ring: 0 0 0 3px rgb(4 120 87 / 24%);
  --k-shadow-none: none;
  --k-shadow-card: 0 1px 2px rgb(15 23 42 / 6%);
  --k-shadow-raised: 0 8px 24px rgb(15 23 42 / 10%);
  --k-shadow-overlay: 0 20px 56px rgb(15 23 42 / 18%);
  --k-content-max: 1200px;
  --k-touch-target: 44px;
  --k-motion-fast: 120ms;
  --k-motion-normal: 200ms;
  --k-motion-slow: 320ms;
  --k-ease-standard: cubic-bezier(.2, 0, 0, 1);

  /* Compatibility aliases for the existing HTML application. */
  --bg-app: var(--k-color-canvas);
  --bg-surface: var(--k-color-surface);
  --bg-subtle: var(--k-color-surface-sunken);
  --border-color: var(--k-color-border);
  --text-primary: var(--k-color-text);
  --text-secondary: var(--k-color-muted);
  --text-muted: var(--k-color-faint);
}

html.dark {
  --k-color-canvas: #090d16;
  --k-color-surface: #111827;
  --k-color-surface-raised: #1e293b;
  --k-color-surface-sunken: #1e293b;
  --k-color-text: #f8fafc;
  --k-color-muted: #cbd5e1;
  --k-color-faint: #94a3b8;
  --k-color-border: #1f2937;
  --k-color-border-strong: #334155;
  --k-color-primary: #34d399;
  --k-color-primary-hover: #6ee7b7;
  --k-color-primary-soft: rgb(6 78 59 / 45%);
  --k-color-primary-soft-foreground: #a7f3d0;
  --k-color-success: #34d399;
  --k-color-success-soft: rgb(6 78 59 / 35%);
  --k-color-warning: #fbbf24;
  --k-color-warning-soft: rgb(120 53 15 / 30%);
  --k-color-danger: #fb7185;
  --k-color-danger-soft: rgb(136 19 55 / 30%);
  --k-color-info: #38bdf8;
  --k-color-info-soft: rgb(7 89 133 / 30%);
  --k-color-promo: #854d0e;
  --k-color-promo-text: #fef08a;
  --k-color-price: #f8fafc;
  --k-color-price-old: #94a3b8;
  --k-color-price-best: #34d399;
  --k-focus-ring: 0 0 0 3px rgb(52 211 153 / 28%);
}

/* Product/retailer identities are separate from the Kompara brand palette. */
:root {
  --k-store-continente: #e11d48;
  --k-store-auchan: #16a34a;
  --k-store-pingo-doce: #0d9488;
  --k-store-intermarche: #dc2626;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --k-motion-fast: 1ms;
    --k-motion-normal: 1ms;
    --k-motion-slow: 1ms;
  }
}
