/* Xocolates Granollers · tokens i base compartida (web pública i panell).
   Tots els colors viuen aquí: als altres CSS només es fan servir aquests tokens. */
:root {
  /* Marca */
  --cacau: #2b1710;        /* fons fosc, text principal */
  --cacau-2: #3a2016;
  --cacau-3: #24120c;      /* rajola del portada */
  --cobertura: #5a3324;
  --paper: #f8efec;        /* fons clar */
  --paper-2: #f1e3de;
  --paper-3: #ead8d1;
  --avellana: #c99c74;     /* accent càlid sobre fosc */
  --gra: #61442c;          /* marró del gra de cacau del logo */
  --gra-clar: #ecd6c4;     /* logo sobre fosc */
  --gra-fosc: #4a3220;
  --or: #b08a52;           /* daurat de la lletra del logo (només sobre fosc o en mida gran) */
  --or-clar: #d9b98a;
  --maduixa: #c8344f;      /* accions principals */
  --maduixa-fosc: #a5263f;
  --ink: #2b1710;
  --text: #2b1710;
  --muted: #6e5246;
  --muted-dark: #cdb3a6;   /* text secundari sobre fosc */
  --white: #ffffff;
  --field: #fffaf8;        /* fons de camps i targetes */
  --line: #e2cec7;
  --line-2: #d6bfb6;
  --line-dark: #4f3024;
  --line-dark-2: #6b4535;

  /* Estats */
  --ok: #2f7a45;   --ok-bg: #e2f3d8;
  --warn: #9a5b00; --warn-bg: #fff1c9;
  --bad: #a5263f;  --bad-bg: #f8dee2;
  --info-bg: #dff1ee;
  --wa: #25d366;   --wa-ink: #08361a;

  /* Rajola (motiu de marca) */
  --piece-1: #4b2a1d; --piece-2: #351c13; --piece-3: #2a150e; --piece-text: #7a4a35; --piece-text-2: #3e2218;
  --hi: rgba(255, 225, 200, .10); --hi-2: rgba(255, 225, 200, .18); --shade: rgba(0, 0, 0, .38); --shade-2: rgba(0, 0, 0, .25);
  --overlay: rgba(43, 23, 16, .55); --glass: rgba(248, 239, 236, .92); --hover-tint: rgba(127, 80, 60, .1); --focus-ring: rgba(200, 52, 79, .2);
  --shadow: 0 1px 2px rgba(43, 23, 16, .06), 0 8px 24px rgba(43, 23, 16, .08);
  --shadow-big: 0 30px 60px -20px rgba(43, 23, 16, .55);
  --shadow-modal: 0 30px 80px rgba(43, 23, 16, .35);
  --side-on: rgba(201, 156, 116, .18);

  /* Tipografia i mides */
  --display: "Alegreya", Georgia, serif;          /* cal·ligràfica, com la lletra del logo */
  --body: "Alegreya Sans", system-ui, sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --s1: .5rem; --s2: .75rem; --s3: 1rem; --s4: 1.5rem; --s5: 2.25rem; --s6: 3.5rem; --s7: 5.5rem;
  --wrap: 1240px;
  --r-piece: 10px; --radius: 14px; --radius-sm: 10px;
  --r-card: 18px;

  /* Moviment (Emil Kowalski): corbes fortes, mai ease-in, UI sota 300 ms */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --t-press: 160ms; --t-fast: 200ms; --t-ui: 250ms;
  --rise: 10px;            /* desplaçament de les entrades; 0 amb moviment reduït */
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* La peça de rajola */
.piece {
  position: relative; border-radius: var(--r-piece);
  background: linear-gradient(150deg, var(--piece-1) 0%, var(--piece-2) 60%, var(--piece-3) 100%);
  box-shadow: inset 2px 2px 0 var(--hi), inset -3px -3px 0 var(--shade), 0 1px 0 var(--shade-2);
}
.piece::before { content: ""; position: absolute; inset: 11%; border-radius: 6px; box-shadow: inset 2px 2px 0 var(--shade), inset -2px -2px 0 var(--hi); pointer-events: none; }

/* Botons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--body); font-weight: 700; font-size: 1.05rem; letter-spacing: .01em;
  padding: .8rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; min-height: 48px; -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--gra); color: var(--white); }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--gra-fosc); }
  .btn-ghost:hover { background: var(--hover-tint); }
}

/* Logo (fitxer propi de la botiga, tret de la web antiga) */
.logo { display: block; height: auto; }

/* Moviment reduït: menys i més suau, no zero. Es manté l'opacitat, fora desplaçaments. */
@media (prefers-reduced-motion: reduce) {
  :root { --rise: 0px; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-property: opacity, background-color, color, border-color !important; }
}
