/* club.unistar.md — mobile first, max 728px column, light/dark aware. */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #17191c;
  --muted: #5d6470;
  --line: #e3e6eb;
  --accent: #005bd9;
  --accent-2: #fdc641;
  --accent-text: #ffffff;
  --ok: #1f7a4d;
  --bad: #b42318;
  --radius: 14px;
  --column: 728px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --card: #1b1e24;
    --text: #eef0f3;
    --muted: #a1a8b3;
    --line: #2b3038;
  }
}
* {
  box-sizing: border-box;
}
/* The hidden attribute must win over display rules below. */
[hidden] {
  display: none !important;
}
html {
  background: var(--bg);
}
html,
body {
  margin: 0;
}
body {
  max-width: var(--column);
  margin: 0 auto;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.45 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  padding-bottom: 88px;
}
a {
  color: var(--accent);
}
main {
  padding: 0 16px;
}
h1 {
  font-size: 1.5rem;
  margin: 16px 0 4px;
}
h2 {
  font-size: 1.1rem;
  margin: 0 0 6px;
}

/* Lucide icons */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-wrap {
  display: inline-flex;
  align-items: center;
}
.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Header: always white, like the logo background. */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #ffffff;
  color: #17191c;
  border-bottom: 1px solid #e3e6eb;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand img {
  height: 28px;
  width: auto;
}
.top nav {
  display: flex;
  gap: 16px;
  align-items: center;
}
.top nav a {
  color: var(--accent);
}
.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-weight: 600;
}

.hero p {
  color: var(--muted);
  margin: 0 0 12px;
}
/* 2 offers per row on phones, 3 from tablet width (the column is max 728px). */
.offers {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 600px) {
  .offers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}
.offer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.offer.highlight {
  outline: 3px solid var(--accent);
}
.offer img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}
.offer-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.desc,
.meta {
  color: var(--muted);
  margin: 0;
  font-size: 0.92rem;
}
.price {
  margin: 0;
  font-size: 1.15rem;
}
.price s {
  color: var(--muted);
  font-size: 0.95rem;
  margin-right: 6px;
}
/* Narrow cards: quantity on its own row, button full width below. */
.buy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}
.buy .qty {
  justify-content: space-between;
}
.buy .qty input {
  flex: 1;
  min-width: 0;
}
.offer h2 {
  font-size: 1rem;
  line-height: 1.3;
}
.offer .desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.offer .price {
  font-size: 1.05rem;
}
.offer .price s {
  display: block;
  font-size: 0.85rem;
}
.offer .meta {
  font-size: 0.8rem;
}
.offer .primary {
  padding: 10px 8px;
  font-size: 0.95rem;
}
.in-cart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ok);
  font-weight: 600;
}

.qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.qty button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qty input,
.qty > span {
  width: 44px;
  text-align: center;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}

button {
  font: inherit;
  cursor: pointer;
}
button.primary,
a.primary {
  background: var(--accent);
  color: var(--accent-text);
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
button.primary {
  flex: 1;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button.wide {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
}
button.link {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 6px;
  display: inline-flex;
  align-items: center;
}

/* Fixed bar, aligned with the 728px column. */
.cart-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--column);
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.line .name {
  grid-column: 1 / -1;
  font-weight: 600;
}
.line .sum {
  font-weight: 600;
}
.line.bad {
  border-color: var(--bad);
}
.line .problem {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--bad);
  font-size: 0.9rem;
}

form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
  font-size: 0.92rem;
  color: var(--muted);
}
form label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.row {
  display: flex;
  gap: 12px;
}
.row label {
  flex: 1;
  min-width: 0;
}
fieldset.choice {
  border: 0;
  padding: 0;
  margin: 14px 0;
  display: grid;
  gap: 8px;
}
.option {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin: 0 !important;
  color: var(--text) !important;
}
.option .icon {
  color: var(--accent);
}
.option.disabled {
  opacity: 0.55;
}
.suggestions {
  list-style: none;
  margin: -6px 0 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
}
.suggestions li {
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 0;
  cursor: pointer;
}
.suggestions li:first-child {
  border-top: 1px solid var(--line);
}

.totals {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 12px 0;
}
.totals .row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}
.totals .strong {
  font-weight: 700;
  font-size: 1.1rem;
}
.problems {
  color: var(--bad);
  min-height: 1em;
}
.login {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin: 12px 0;
}
.hint {
  color: var(--muted);
  font-size: 0.9rem;
}
.empty {
  color: var(--muted);
}

.order {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
}
.order .lines {
  padding-left: 18px;
}
.order .lines span {
  float: right;
}
.status {
  font-weight: 600;
}
.status-cancelled,
.status-no_show {
  color: var(--bad);
}
.status-collected,
.status-scheduled {
  color: var(--ok);
}
.legal h2 {
  margin-top: 18px;
}

footer {
  margin-top: 32px;
  padding: 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Delivery map (Leaflet). Kept below the sticky header. */
.map-block {
  display: grid;
  gap: 8px;
  margin: 6px 0 10px;
}
.map {
  height: 260px;
  border-radius: 12px;
  border: 1px solid var(--line);
  position: relative;
  z-index: 0;
  isolation: isolate;
}
.leaflet-container {
  font: inherit;
}
.pin {
  background: none;
  border: 0;
  color: var(--accent);
}
.pin .icon {
  width: 36px;
  height: 36px;
  fill: #ffffff;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}
button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--accent);
  font-weight: 600;
}
