/* =========================================================
   PAPILZ FOODS — DESIGN TOKENS
   Palette built on the brand itself: charred-pot ink,
   kraft-paper base, ugu-leaf green, and clean white — nothing else.
   Ticket/receipt motif carries the brand through checkout.
   ========================================================= */

:root {
  /* ---- Color ----
     Brand: Papilz green + white (from logo, #0d2c26). Green carries
     trust/fresh/"go" and doubles as the action colour — every tappable
     element (buttons, highlights, focus states) uses the brand green,
     never a warm/gold accent.
     A pinch of pepper-red marks "hot/spicy" and urgency, never structure. */
  --ink: #12271f;           /* deep green-black text, ties copy to brand */
  --ink-soft: #52685d;      /* secondary text, green-grey */
  --base: #fbf7ee;          /* warm white — appetizing, not clinical */
  --base-dim: #f1ecdd;      /* deeper band for section contrast */
  --surface: #ffffff;       /* card surface */
  --line: #e2e3d6;          /* hairline border */
  --line-strong: #cfd6c4;

  --brand-green-deep: #0d2c26;  /* logo background — nav, footer, hero */
  --brand-green: #15382e;       /* secondary deep green surface */

  /* Action colour: brand green reads as "tap me" everywhere — buttons,
     focus rings, links — keeping the whole shell to green + white. */
  --primary: #147a4e;
  --primary-dark: #0f5f3c;
  --primary-tint: #e2f3e8;

  /* Accents that sit ON TOP of the deep green shell (eyebrows, badges,
     the engagement-toast dot) use plain white — keeps the palette to
     strictly green + white, nothing else. */
  --accent-light: #ffffff;

  --green: #147a4e;        /* brand green for "done/success", links, tags */
  --green-tint: #e2f3e8;

  --danger: #d1402a;       /* pepper red — remove/alert/"spicy" only */

  /* ---- Type ---- */
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* ---- Shape / elevation ---- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(36, 26, 18, 0.06), 0 8px 20px -10px rgba(36, 26, 18, 0.18);
  --shadow-pop: 0 10px 30px -8px rgba(36, 26, 18, 0.35);

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-base: 260ms;
  --dur-slow: 420ms;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

/* Guard against component classes (e.g. display:block/flex) overriding the
   native [hidden] attribute — same specificity, so source order would
   otherwise decide it. */
[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Shared skeleton shimmer for loading images ---- */
.skel {
  position: relative;
  overflow: hidden;
  background: var(--line);
}

.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* ---- Shared toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: var(--base);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-light);
  flex-shrink: 0;
}

/* ---- Ankara-inspired diamond texture, used at low opacity for warmth
   without tipping into "premium minimal" — a nod, not a costume. ---- */
.brand-pattern {
  background-image:
    linear-gradient(135deg, rgba(20,122,78,0.10) 25%, transparent 25%),
    linear-gradient(225deg, rgba(20,122,78,0.10) 25%, transparent 25%),
    linear-gradient(45deg, rgba(20,122,78,0.10) 25%, transparent 25%),
    linear-gradient(315deg, rgba(20,122,78,0.10) 25%, transparent 25%);
  background-position: 20px 0, 20px 0, 0 0, 0 0;
  background-size: 40px 40px;
  background-repeat: repeat;
}

/* ---- PWA install banner (glassy, sits over the deep green shell) ---- */
.papilz-install-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 400;
  max-width: 420px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  padding: 14px 14px 14px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(160deg, rgba(13,44,38,0.82), rgba(13,44,38,0.68));
  color: #fff;
  transform: translateY(120%);
  transition: transform var(--dur-slow) var(--ease);
}

.papilz-install-banner.show {
  transform: translateY(0);
}

.install-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}

.install-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.install-copy strong {
  font-size: 14px;
  font-weight: 700;
}

.install-copy span {
  font-size: 12.5px;
  color: rgba(255,255,255,0.75);
}

.install-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.install-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
}

.install-dismiss {
  background: rgba(255,255,255,0.14);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
}

/* ---- Engagement toast (rebrand of .toast for the time-on-site nudge) ---- */
.papilz-engagement-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  max-width: min(360px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 16px;
  z-index: 450;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
  background: linear-gradient(160deg, rgba(13,44,38,0.9), rgba(13,44,38,0.76));
  color: #fff;
}

.papilz-engagement-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.papilz-engagement-toast .et-emoji {
  font-size: 20px;
  flex-shrink: 0;
}

.papilz-engagement-toast .et-text {
  font-size: 13.5px;
  line-height: 1.4;
}

.papilz-engagement-toast .et-text b {
  color: var(--accent-light);
}

/* ---- Glassmorphism panel ---- */
.glass-panel {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 8px 32px -12px rgba(9,25,20,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
}
