/* ═══════════════════════════════════════════════════════════════════════════
   Strumica Eats — web app styles
   Warm, editorial, premium. Light + dark (system preference).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --bg: #faf7f2;
  --accent: #e8742a;
  --accent-ink: #ffffff; /* text on accent */
  --text: #211c16;
  --red: #c4302b;

  /* Derived warm surfaces & borders (light) */
  --surface: #fffdfa;
  --surface-2: #f3ede3;
  --border: #eae1d3;
  --muted: #7c7264;
  --shadow: 0 10px 30px rgba(60, 40, 15, 0.08);
  --shadow-sm: 0 4px 14px rgba(60, 40, 15, 0.07);

  --radius-tile: 22px;
  --radius-card: 24px;
  --radius-lg: 28px;
  --maxw: 720px;

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120e;
    --accent: #f4863c;
    --accent-ink: #1a1206;
    --text: #f6f1e9;
    --red: #f05a52;

    --surface: #211c15;
    --surface-2: #2a2419;
    --border: #362e22;
    --muted: #a89a86;
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

/* ── Base ───────────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
button {
  font: inherit;
  cursor: pointer;
}

.page,
.detail {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px calc(48px + env(safe-area-inset-bottom));
}
.page__body {
  display: block;
}

/* ── Icons ──────────────────────────────────────────────────────────────── */
.icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}
.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.icon--sm {
  width: 16px;
  height: 16px;
}
.icon--accent {
  color: var(--accent);
}

/* ── Header / brand ─────────────────────────────────────────────────────── */
.site-header {
  padding: 28px 0 10px;
  text-align: center;
}
.brand {
  display: inline-block;
}
.brand__logo {
  height: 52px;
  width: auto;
  margin: 0 auto;
}
.brand__tagline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

/* ── Section headers ────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 2px 14px;
}
.section-header__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ── Search entry (home) ────────────────────────────────────────────────── */
.search-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  margin-top: 6px;
}
.search-entry .icon {
  color: var(--muted);
}
.search-entry__ph {
  font-size: 15px;
}

/* ── Search view ────────────────────────────────────────────────────────── */
.search-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 14px;
  box-shadow: var(--shadow-sm);
  margin-top: 4px;
}
.search-input .icon {
  color: var(--muted);
}
.search-input__field {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 12px 0;
  outline: none;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 2px 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip--active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ── Brand tile / monogram ──────────────────────────────────────────────── */
.brand-tile {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}
.brand-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.monogram {
  width: 100%;
  height: 100%;
  border-radius: 28%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.monogram__initials {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: clamp(20px, 42%, 64px);
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* ── Restaurant row card ────────────────────────────────────────────────── */
.rlist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rcard {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.rcard:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.rcard:active {
  transform: translateY(0);
}
.rcard__tile {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-tile);
  flex: 0 0 auto;
}
.rcard__tile .monogram {
  border-radius: var(--radius-tile);
}
.rcard__meta {
  flex: 1;
  min-width: 0;
}
.rcard__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rcard__sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.rcard__cat {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.rcard__actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge--soft {
  background: var(--surface-2);
  color: var(--muted);
}
.badge--cat {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.badge--muted {
  background: var(--surface-2);
  color: var(--muted);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  padding: 15px 20px;
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  flex: 1;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 34%, transparent);
}
.btn--primary:hover {
  filter: brightness(1.04);
}
.btn--surface {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--surface .icon {
  color: var(--accent);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  flex: 0 0 auto;
  border: 0;
}
.icon-btn .icon {
  width: 20px;
  height: 20px;
}
.icon-btn--accent {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 32%, transparent);
}
.icon-btn--surface {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
}
.icon-btn--glass {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

/* ── Featured cards ─────────────────────────────────────────────────────── */
.fgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.fcard {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease;
}
.fcard:hover {
  transform: translateY(-3px);
}
.fcard__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.fcard__bg .monogram {
  border-radius: 0;
}
.fcard__bg .monogram__initials {
  font-size: clamp(48px, 20vw, 120px);
}
.fcard__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0) 34%,
    rgba(0, 0, 0, 0.62) 100%
  );
}
.fcard__top {
  display: flex;
}
.fcard__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  color: var(--accent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.fcard__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.fcard__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 6vw, 30px);
  color: #fff;
  letter-spacing: -0.015em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  line-height: 1.05;
}
.fcard__cat {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 15px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  margin-top: 2px;
}
.fcard__actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.fcard__actions .icon-btn--surface {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Detail ─────────────────────────────────────────────────────────────── */
.detail {
  padding: 0 0 calc(48px + env(safe-area-inset-bottom));
}
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  max-height: 460px;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__bg .monogram {
  border-radius: 0;
}
.hero__bg .monogram__initials {
  font-size: clamp(64px, 26vw, 160px);
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.16) 0%,
    rgba(0, 0, 0, 0) 40%,
    color-mix(in srgb, var(--bg) 0%, transparent) 60%,
    var(--bg) 100%
  );
}
.hero__back {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
}
.detail__content {
  max-width: var(--maxw);
  margin: -28px auto 0;
  position: relative;
  padding: 0 16px;
}
.detail__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 8vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 12px;
}
.detail__tags {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.detail__desc {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 22px;
}
.detail__actions {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}
.detail__floatback {
  padding: 16px;
}

/* Open / closed status */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 15px;
}
.status .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.status--open {
  color: #2f8f4e;
}
.status--open .dot {
  background: #2f8f4e;
  box-shadow: 0 0 0 4px color-mix(in srgb, #2f8f4e 20%, transparent);
}
.status--closed {
  color: var(--red);
}
.status--closed .dot {
  background: var(--red);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 20%, transparent);
}
@media (prefers-color-scheme: dark) {
  .status--open {
    color: #5fce85;
  }
  .status--open .dot {
    background: #5fce85;
  }
}

/* Info / delivery card */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 6px 18px;
  box-shadow: var(--shadow-sm);
}
.info-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}
.info-card__title {
  font-weight: 700;
  font-size: 17px;
}
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.info-row__label {
  color: var(--muted);
  font-size: 15px;
}
.info-row__value {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

/* Hours */
.hours-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 6px 18px;
  box-shadow: var(--shadow-sm);
}
.hours-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}
.hours-row:first-child {
  border-top: 0;
}
.hours-row__day {
  font-size: 15px;
  color: var(--text);
}
.hours-row__value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hours-row__value--closed {
  color: var(--red);
  font-weight: 600;
}
.hours-row--today {
  margin: 0 -12px;
  padding: 13px 12px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 12px;
  border-top-color: transparent;
}
.hours-row--today + .hours-row {
  border-top-color: transparent;
}
.hours-row--today .hours-row__day {
  font-weight: 700;
  color: var(--accent);
}

/* Menu */
.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.menu-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.menu-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.menu-section__head::-webkit-details-marker {
  display: none;
}
.menu-section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--accent);
}
.menu-section__chevron {
  color: var(--muted);
  transition: transform 0.2s ease;
}
.menu-section[open] .menu-section__chevron {
  transform: rotate(180deg);
}
.menu-section__body {
  padding: 0 18px 6px;
}
.menu-item {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.menu-item__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.menu-item__main {
  flex: 1;
  min-width: 0;
}
.menu-item__name {
  font-weight: 600;
  font-size: 16px;
}
.menu-item__desc {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 5px 0 0;
}
/* Right-side pricing: single price, or one line per size (label + price). */
.menu-item__pricing {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  text-align: right;
}
.menu-item__price {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  white-space: nowrap;
}
.price-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}
.price-line__label {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}
.price-line__value {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}
.menu-empty {
  color: var(--muted);
  padding: 4px 0 14px;
}

/* Address */
.addr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.addr-card__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

/* ── States ─────────────────────────────────────────────────────────────── */
.state {
  text-align: center;
  padding: 64px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.state__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  margin: 0;
}
.state__msg {
  color: var(--muted);
  margin: 0;
  max-width: 42ch;
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (min-width: 620px) {
  .fgrid {
    grid-template-columns: 1fr 1fr;
  }
  .brand__logo {
    height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
