/* ============================================================
   Bar de la Piscina — carta digital
   Tokens: vegeu DESIGN.md (identitat DEL BAR, no de SIRO)
   ============================================================ */

:root {
  --bg: #FBF6EA;
  --surface: #FFFFFF;
  --ink: #15334F;
  --navy: #15334F;
  --navy-deep: #0E2740;
  --pool: #1B8FBF;
  --pool-deep: #14617D;   /* text petit sobre blanc — AA 4.5:1+ */
  --pool-bright: #3BB8E0;
  --sun: #F5B800;
  --citrus: #ED7A1C;
  --leaf-fill: #2E9E5B;
  --grape: #6E4D9B;
  --coral: #D8483B;
  --muted: #5A6B7B;
  --hairline: #E7DECB;
  --hairline-row: #F1EAD9;

  /* escala d'espai 8px */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --maxw: 1120px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: .5s;

  --font-display: "Baloo 2", system-ui, -apple-system, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.05; text-wrap: balance; }
p { text-wrap: pretty; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* icones SVG (Lucide) */
.ico {
  width: 1.15em; height: 1.15em;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
.ico--sm { width: 1em; height: 1em; }

.skip-link {
  position: absolute; left: var(--s-3); top: -64px;
  background: var(--navy); color: #fff; padding: 10px var(--s-4);
  border-radius: var(--r-pill); z-index: 100; transition: top .2s;
}
.skip-link:focus { top: var(--s-3); }

:focus-visible {
  outline: 3px solid var(--pool-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(16px, 4vw, 56px) var(--s-5) clamp(48px, 9vw, 104px);
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #2AA3D1 0%, var(--pool) 58%, #16789F 100%);
  overflow: hidden;
}
.hero__inner { position: relative; max-width: 40rem; margin: 0 auto; z-index: 3; }

.mascota { display: inline-block; }
.mascota svg { display: block; width: clamp(80px, 22vw, 116px); height: auto; filter: drop-shadow(0 6px 10px rgba(14,39,64,.22)); }

.hero__lloc {
  display: block;
  margin: clamp(8px, 2vw, 12px) auto 0;
  max-width: 26ch;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: clamp(.74rem, 2.6vw, .92rem);
  line-height: 1.25;
  color: #EAF7FE;
}

.hero__title { display: flex; flex-direction: column; align-items: center; }
.hero__title span { display: block; }
.hero__bar {
  font-weight: 800;
  font-size: clamp(2.8rem, 13vw, 5rem);
  color: var(--navy-deep);
  letter-spacing: .01em;
}
.hero__de {
  font-weight: 600;
  font-size: clamp(1rem, 4vw, 1.4rem);
  text-transform: uppercase;
  letter-spacing: .22em;
  margin: -.18em 0 -.12em;
  color: #EAF7FE;
}
.hero__piscina {
  font-weight: 800;
  font-size: clamp(2.8rem, 13vw, 5rem);
  color: var(--sun);
  text-shadow: 0 3px 0 rgba(14,39,64,.16);
}
.hero__slogan {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 4.6vw, 1.7rem);
  margin: clamp(10px, 3vw, 16px) 0 var(--s-1);
}
.hero__sub { margin: 0; font-weight: 600; color: #EAF7FE; }

/* ones en capes cap a la crema */
.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; display: block; z-index: 2; }
.wave--back  { height: clamp(32px, 6vw, 66px); fill: rgba(251, 246, 234, .55); }
.wave--front { height: clamp(26px, 5vw, 58px); fill: var(--bg); }

/* ============ NAV CATEGORIES (sticky) ============ */
.catnav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.catnav__list {
  display: flex; gap: var(--s-2);
  overflow-x: auto;
  padding: var(--s-3) var(--s-4);
  max-width: var(--maxw); margin: 0 auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.catnav__list::-webkit-scrollbar { display: none; }
.catnav__list a {
  display: inline-flex; align-items: center;
  white-space: nowrap;
  min-height: 40px; padding: 6px var(--s-4);
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1.5px solid var(--hairline);
  font-family: var(--font-display);
  font-weight: 600; font-size: .9rem;
  color: var(--navy);
  text-decoration: none;
  scroll-snap-align: start;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
}
.catnav__list a:hover { border-color: var(--pool); transform: translateY(-1px); }
.catnav__list a.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ============ CARTA ============ */
.carta { max-width: var(--maxw); margin: 0 auto; padding: clamp(20px, 4vw, 36px) var(--s-4) var(--s-2); }

.grid { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); align-items: start; gap: var(--s-5); }
  .card--wide { grid-column: 1 / -1; }
}
@media (min-width: 980px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .card--wide { grid-column: span 2; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-top: 4px solid var(--pool);
  border-radius: var(--r-lg);
  padding: clamp(16px, 3.5vw, 24px);
}

/* Ribbon de secció — color per accent, contrast AA */
.ribbon {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-weight: 700; font-size: 1.3rem;
  padding: 7px var(--s-4) 9px;
  border-radius: var(--r-pill);
  margin-bottom: var(--s-4);
  color: #fff;
}
.ribbon__tag {
  font-family: var(--font-body); font-weight: 700;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  background: rgba(255,255,255,.28); padding: var(--s-1) var(--s-2); border-radius: var(--r-pill);
}

/* accents foscos → text blanc */
[data-accent="pool"]  .ribbon { background: var(--pool); }
[data-accent="coral"] .ribbon { background: var(--coral); }
[data-accent="leaf"]  .ribbon { background: var(--leaf-fill); }
[data-accent="grape"] .ribbon { background: var(--grape); }
/* accents clars → text navy (contrast AA) */
[data-accent="citrus"] .ribbon { background: var(--citrus); color: var(--navy-deep); }
[data-accent="sun"]    .ribbon { background: var(--sun); color: var(--navy-deep); }
[data-accent="citrus"] .ribbon__tag { background: rgba(14,39,64,.14); }
[data-accent="sun"]    .ribbon__tag { background: rgba(14,39,64,.14); }

/* vora superior de color segons accent */
[data-accent="pool"]   { border-top-color: var(--pool); }
[data-accent="coral"]  { border-top-color: var(--coral); }
[data-accent="leaf"]   { border-top-color: var(--leaf-fill); }
[data-accent="grape"]  { border-top-color: var(--grape); }
[data-accent="citrus"] { border-top-color: var(--citrus); }
[data-accent="sun"]    { border-top-color: var(--sun); }

/* Ítems amb punts guia */
.items li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: var(--s-2);
  padding: var(--s-2) 0;
}
.items li + li { border-top: 1px solid var(--hairline-row); }
.it { font-weight: 600; }
.dots {
  align-self: center;
  border-bottom: 2px dotted #C9D3DC;
  transform: translateY(-2px);
}
.pr {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.items--compact li { padding: 6px 0; }

/* descripcions (amanides) */
.items--desc li { row-gap: var(--s-1); }
.desc {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.35;
}

/* subseccions (entrepans) */
.subgrid { display: grid; gap: var(--s-5); }
@media (min-width: 560px) { .subgrid { grid-template-columns: 1fr 1fr; gap: var(--s-6); } }
.subhead {
  font-size: 1rem; font-weight: 700; color: var(--pool-deep);
  text-transform: uppercase; letter-spacing: .06em;
  margin: var(--s-1) 0 2px;
}
.subhead--mt { margin-top: var(--s-4); }

/* callout hamburgueses — banda neta, sense caixa-dins-caixa */
.callout {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  margin: var(--s-4) 0 var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: #FFF6D8;
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-weight: 600;
  text-align: center;
  color: var(--navy-deep);
}
.callout .ico { color: var(--citrus); }

.gelats-note {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.05rem;
  text-align: center; margin: var(--s-2) 0 2px; line-height: 1.4;
}

/* ============ MINI-INFO ============ */
.info {
  position: relative;
  margin-top: clamp(32px, 6vw, 56px);
  background: var(--pool);
  color: #fff;
  padding: clamp(40px, 8vw, 64px) var(--s-4) clamp(32px, 6vw, 48px);
}
.wave--info { position: absolute; top: -1px; bottom: auto; height: clamp(28px, 5vw, 52px); transform: scaleY(-1); fill: var(--bg); z-index: 1; }
.info__inner { max-width: var(--maxw); margin: 0 auto; text-align: center; position: relative; z-index: 2; }
.info__title { font-weight: 700; font-size: clamp(1.3rem, 5vw, 2rem); margin-bottom: var(--s-6); }
.info__cards { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .info__cards { grid-template-columns: repeat(3, 1fr); } }
.info__card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-4);
  color: var(--ink);
  text-align: center;
}
.info__ic { width: 30px; height: 30px; fill: none; stroke: var(--pool-deep); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: var(--s-2); }
.info__card h3 { font-size: 1.1rem; margin-bottom: var(--s-1); color: var(--navy); }
.info__card p { margin: 0; color: var(--ink); }
.info__card em { color: var(--muted); font-style: normal; font-size: .85em; }

/* ============ FOOTER ============ */
.footer { background: var(--navy-deep); color: #fff; text-align: center; padding: var(--s-5) var(--s-4) var(--s-6); }
.footer__notes {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2) var(--s-5);
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  margin-bottom: var(--s-3);
}
.footer__notes li { position: relative; }
.footer__notes li + li::before { content: "·"; position: absolute; left: calc(var(--s-5) / -2 - 2px); color: #5E86A3; }
.footer__allergens { margin: 0 0 var(--s-2); color: #B9D4E5; font-size: .82rem; }
.footer__brand { margin: 0; color: #9FC4DC; font-size: .85rem; }

/* ============ TO TOP ============ */
.totop {
  position: fixed; right: var(--s-4); bottom: var(--s-4); z-index: 40;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--navy); color: #fff;
  border-radius: var(--r-pill);
  text-decoration: none;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease), background .18s var(--ease);
}
.totop .ico { width: 22px; height: 22px; transform: rotate(180deg); }
.totop.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover { background: var(--pool); }

/* ============ REVEALS (una sola signatura de moviment) ============ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .totop { transition: opacity .01s; }
  * { animation-duration: .01ms !important; }
}

/* ============ IMPRESSIÓ (per si es vol penjar/laminar) ============ */
@media print {
  .catnav, .totop, .wave { display: none !important; }
  .hero { background: none; color: var(--ink); padding: 0 0 var(--s-4); }
  .hero__bar, .hero__de, .hero__sub, .hero__eyebrow, .hero__slogan { color: var(--ink); }
  .hero__piscina { color: var(--ink); text-shadow: none; }
  .info { background: none; color: var(--ink); }
  .info__title { color: var(--ink); }
  .footer { background: none; color: var(--ink); }
  .footer__brand, .footer__allergens, .footer__notes { color: var(--ink); }
  .card { break-inside: avoid; box-shadow: none; }
  .reveal { opacity: 1; transform: none; }
  body { background: #fff; }
}
