/* Pantalla de botiga · només el que el sistema Eines internes no porta.
   Surt de disseny/botiga.css (direcció A). Canvis respecte del disseny:
   - sense les regles de la direcció B (descartada);
   - el color de cada botiga és una dada (--bt-color, que posa botiga.js), no dues variables fixes;
   - al final, el que el prototip feia amb estils en línia (la política de seguretat no els deixa). */

html, body { margin: 0; }

/* ── Desviació 1 · mides tàctils: la pantalla s'obre al mòbil de la botiga ── */
.bt {
  --ei-control: 48px;       /* botons i camps: 48 px (el sistema en fa 36) */
  --ei-control-sm: 44px;    /* botó petit: 44 px (el sistema en fa 32) */
  --bt-gap: 4px;
  font-size: 16px; line-height: 24px; min-height: 100vh;
}
.bt a { color: inherit; }
.bt .ds-button { font-size: 15px; padding: 0 18px; }
.bt .ds-button[data-size="sm"] { font-size: 14px; padding: 0 14px; }
.bt .ds-input, .bt .ds-textarea { font-size: 16px; line-height: 24px; padding: 11px 12px; } /* 16 px: l'iPhone no fa zoom en entrar al camp */
.bt .ds-label { font-size: 15px; line-height: 20px; }
.bt .ds-label small { font-size: 13px; }
.bt .ds-help, .bt .ds-field-error { font-size: 14px; line-height: 20px; }
.bt .ds-form { max-width: none; }
.bt .ds-alert { font-size: 15px; line-height: 22px; }
.bt .ds-dl { font-size: 15px; line-height: 22px; }

/* ── Barra superior i contenidor ─────────────────────────────────────── */
.bt-top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 8px 0 16px; background: var(--ei-card); border-bottom: 1px solid var(--ei-border); }
.bt-top img { height: 20px; display: block; }
.bt-qui { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.bt-qui > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-nom-llarg { display: none; }
.bt-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 56px; }
.bt-h1 { margin: 0 0 6px; font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -.01em; }
.bt-sub { margin: 0 0 20px; color: var(--ei-muted-foreground); max-width: 62ch; }
.bt-enrere { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -10px 0 4px -6px; padding: 0 8px 0 2px; color: var(--ei-primary-text); font-weight: 600; font-size: 15px; text-decoration: none; border-radius: var(--ei-radius-sm); }

/* ── Colors de botiga: mostra i llegenda ─────────────────────────────── */
.bt-mostra { width: 14px; height: 14px; flex: none; border-radius: 4px; display: inline-block; }
.bt-mostra[data-botiga] { background: var(--bt-color, var(--ei-data-track)); }
.bt-mostra[data-botiga="lliure"] { background: var(--ei-card); box-shadow: inset 0 0 0 1.5px var(--ei-input-border); }
.bt-llegenda { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 14px; line-height: 20px; color: var(--ei-muted-foreground); }
.bt-llegenda li { display: inline-flex; align-items: center; gap: 7px; }
.bt-llegenda .bt-ratlleta { width: 2px; height: 16px; border-radius: 1px; background: var(--ei-foreground); margin: 0 6px; }

/* ── Barra de caselles: una casella per comanda, ratlla al mínim ──────── */
.bt-barra { position: relative; padding-top: 22px; margin-bottom: 10px; }
.bt-caselles { display: grid; grid-template-columns: repeat(var(--cap), minmax(0, 1fr)); gap: var(--bt-gap); }
.bt-caselles i { height: 30px; border-radius: 4px; background: var(--ei-card); box-shadow: inset 0 0 0 1.5px var(--ei-input-border); }
.bt-caselles i[data-botiga] { background: var(--bt-color, var(--ei-data-track)); box-shadow: none; }
.bt-barra[data-tancat] .bt-caselles i:not([data-botiga]) { background: var(--ei-data-track); box-shadow: none; }  /* lloc que ja no es pot omplir */
.bt-caselles i[data-nova] { outline: 2px solid var(--ei-primary); outline-offset: 2px; }
/* La ratlla cau al mig del forat que hi ha després de la casella «mínim» */
.bt-minim { position: absolute; top: 17px; bottom: -5px; width: 2px; border-radius: 1px; background: var(--ei-foreground);
  left: calc(var(--min) / var(--cap) * 100% + var(--bt-gap) * (var(--min) / var(--cap) - .5) - 1px); }
.bt-minim span { position: absolute; bottom: 100%; right: -1px; padding-bottom: 1px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; color: var(--ei-foreground); }
.bt-recompte { margin: 0; font-size: 14px; line-height: 20px; color: var(--ei-muted-foreground); }
.bt-recompte b { color: var(--ei-foreground); font-weight: 600; }

/* ── Direcció A · un panell per dia ──────────────────────────────────── */
.bt-dia { padding: 16px; margin-bottom: 12px; }
.bt-dia-nom { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.bt-dia-nom em { font-style: normal; font-weight: 700; }
.bt-dia-estat { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 8px 0 2px; }
.bt-dia-estat b { font-size: 15px; line-height: 20px; font-weight: 600; }
.bt-accions { display: flex; gap: 8px; margin-top: 14px; }
.bt-accions .ds-button[data-variant="primary"] { flex: 1; }
.bt-nota { margin: 12px 0 0; font-size: 14px; line-height: 20px; color: var(--ei-muted-foreground); }
.bt-recompte + .bt-nota { margin-top: 4px; }
.bt-cap-setmana { margin: 16px 0; padding: 0 4px; font-size: 14px; line-height: 20px; color: var(--ei-subtle-foreground); display: flex; align-items: center; gap: 12px; }
.bt-cap-setmana::before, .bt-cap-setmana::after { content: ""; flex: 1; height: 1px; background: var(--ei-border-strong); }
.bt-dia[data-sense] { background: transparent; border-style: dashed; border-color: var(--ei-border-strong); }

/* ── Comandes d'un dia ───────────────────────────────────────────────── */
.bt-comandes { list-style: none; margin: 0; padding: 0; }
.bt-comanda { padding: 14px 16px; border-top: 1px solid var(--ei-border); }
.bt-comanda:first-child { border-top: 0; }
.bt-comanda-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; line-height: 20px; color: var(--ei-muted-foreground); }
.bt-comanda h3 { margin: 8px 0 2px; font-size: 16px; line-height: 22px; font-weight: 600; }
.bt-comanda p { margin: 0; font-size: 15px; line-height: 22px; color: var(--ei-muted-foreground); }
.bt-comanda .bt-accions { margin-top: 12px; }
.bt-zona { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 28px 0 10px; }
.bt-zona h2 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 700; }
.bt-zona span { color: var(--ei-subtle-foreground); font-size: 14px; }
.bt .ds-panel { overflow: hidden; }
.bt-ids { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; }
.bt .ds-alert.bt-avis-fila { margin: 12px 0 0; }
.bt-recompte + .bt-recompte { margin-top: 2px; }

/* ── Formulari ───────────────────────────────────────────────────────── */
.bt-doble { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bt-mapa { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ei-primary-text); font-weight: 600; font-size: 15px; text-underline-offset: 3px; }
.bt-context { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 12px 14px; border-radius: var(--ei-radius-md); background: var(--ei-card); border: 1px solid var(--ei-border); font-size: 15px; line-height: 22px; }
.bt-form-accions { display: grid; gap: 8px; padding-top: 6px; }

/* ── Confirmació ─────────────────────────────────────────────────────── */
.bt-fet { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ei-ok-foreground); }
.bt-fet .ds-ico { width: 22px; height: 22px; }
.bt-acx { margin: 0 0 6px; font-size: 44px; line-height: 50px; font-weight: 700; letter-spacing: -.02em; }
.bt-fitxa { padding: 16px; margin: 20px 0; }
.bt-fitxa h2 { margin: 0 0 12px; font-size: 15px; line-height: 20px; font-weight: 700; }

/* ── Entrada ─────────────────────────────────────────────────────────── */
.bt-entrada { max-width: 400px; margin: 0 auto; padding: 56px 16px 40px; }
.bt-entrada img { height: 26px; display: block; margin-bottom: 28px; }
.bt-entrada .ds-form { margin-top: 24px; }

/* ── Esquelets ───────────────────────────────────────────────────────── */
.bt-sk { display: grid; gap: 14px; }
.bt-sk .ds-skeleton[data-mida="barra"] { height: 30px; border-radius: 4px; }

@media (min-width: 760px) {
  .bt-top { height: var(--ei-topbar); padding: 0 24px 0 32px; }
  .bt-top img { height: 22px; }
  .bt-nom-curt { display: none; } .bt-nom-llarg { display: inline; }
  .bt-wrap { padding: 40px 24px 72px; }
  .bt-h1 { font-size: 28px; line-height: 34px; }
  .bt-dia { padding: 20px 22px; }
  .bt-dia-cap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .bt-dia-estat { margin: 0; }
  .bt-dia-peu { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .bt-dia-peu .bt-accions { margin-top: 0; flex: none; }
  .bt-accions .ds-button[data-variant="primary"] { flex: none; }
  .bt-barra { margin: 4px 0 14px; }
  .bt-caselles i { height: 34px; }
  .bt-form-accions { display: flex; }
  .bt-acx { font-size: 56px; line-height: 62px; }
}

@media (prefers-reduced-motion: reduce) { .bt * { scroll-behavior: auto; } }

/* ── Afegit per a l'aplicació ────────────────────────────────────────── */
.bt-sk .ds-skeleton[data-mida="titol"] { width: 55%; height: 16px; }
.bt-sk .ds-skeleton[data-mida="peu"] { width: 70%; }
.bt-barra[data-atapeit] { --bt-gap: 2px; }   /* més de 24 llocs */
.bt [hidden] { display: none !important; }
.bt-surt { margin-left: 0; }
.bt-missatge { max-width: 400px; margin: 0 auto; padding: 56px 16px 40px; }
