/* Bistro Someș — digital menu */

:root {
  --theme: #221818;
  --theme-rgb: 34, 24, 24;
  --accent: #c8a96a;
  --text: #221818;
  --secondary-text: #716f80;
  --placeholder: #a6a4b4;
  --border: #bfbdcb66;
  --active-bg: #f3f1f2;
  --shadow: #bdbacd44;
  --red: #ff5723;
  --green: #5da41a;
  --blue: #11b7f3;
  --orange: #ff7800;
  --ease: cubic-bezier(0.25, 1, 0.32, 1);
  --sticky-top: 0px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0 auto;
  max-width: 768px;
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--text);
  background: #fff;
  -webkit-tap-highlight-color: transparent;
}

body.no-scroll { overflow: hidden; }

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; }
img { display: block; }

.menu { background: #fff; min-height: 100vh; position: relative; }

.noscript { padding: 40px 20px; text-align: center; }

/* Desktop: blurred cover photo around the menu column */
.desktop-bg {
  display: none;
  position: fixed;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  filter: brightness(0.45) blur(6px);
  z-index: -1;
}
@media (min-width: 769px) {
  .desktop-bg { display: block; }
  body { box-shadow: 0 0 60px #0008; }
}

/* ---------- Cover ---------- */
.cover {
  position: relative;
  height: 210px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
  background: var(--theme);
  color: #fff;
  isolation: isolate;
}

.cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transform-origin: center top;
  will-change: transform;
}

.cover-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 150px;
  background: linear-gradient(rgba(var(--theme-rgb), 0), rgba(var(--theme-rgb), 1));
  z-index: -1;
}

.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(var(--theme-rgb), 0.25);
  z-index: -1;
}

.logo-wrapper {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid #fff;
  padding: 3px;
  background: #fffb;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-wrapper img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.cover h1 {
  margin: 6px 0 0;
  font-size: 30px;
  font-weight: 400;
  line-height: 40px;
  text-align: center;
}

.cover h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.9;
}

.status-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: #0006;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.status-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.status-tag.open .dot { background: #7bd33a; box-shadow: 0 0 0 3px #7bd33a44; }

.more-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0006;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  transition: transform 0.2s var(--ease);
}
.more-button:active { transform: scale(0.9); }

/* ---------- Sticky header: search + categories ---------- */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.search-bar {
  background: var(--theme);
  padding: 10px 14px 14px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  border-radius: 22px;
  background: #ffffff14;
  border: 1px solid #ffffff2e;
  color: #fff;
  transition: background 0.2s;
}
.search-box:focus-within { background: #ffffff24; border-color: #ffffff55; }
.search-box svg { margin: 0 10px 0 16px; flex-shrink: 0; opacity: 0.8; }
.search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 16px;
}
.search-box input::placeholder { color: #ffffffa8; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear {
  width: 44px;
  height: 44px;
  display: none;
  place-items: center;
  color: #fff;
}
.search-box.has-value .search-clear { display: grid; }

.section-toggle-wrapper { padding: 14px 14px 0; background: #fff; }
.section-toggle {
  position: relative;
  display: flex;
  height: 38px;
  padding: 1px;
  border-radius: 19px;
  background: var(--active-bg);
  font-size: 15px;
  font-weight: 500;
}
.section-toggle .indicator {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 1px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 2px 8px #bdbacd88;
  transition: transform 0.35s var(--ease);
}
.section-toggle button {
  position: relative;
  flex: 1;
  z-index: 1;
  border-radius: 18px;
  color: var(--secondary-text);
  transition: color 0.2s;
  white-space: nowrap;
}
.section-toggle button.active { color: var(--text); font-weight: 600; }
.section-toggle .short { display: none; }
@media (max-width: 480px) {
  .section-toggle .full { display: none; }
  .section-toggle .short { display: inline; }
}

.categories-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: #fffffff2;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow 0.2s;
}
.sticky-header.stuck .categories-bar { box-shadow: 0 6px 12px -8px #0003; }

.categories {
  display: flex;
  flex: 1;
  gap: 8px;
  padding: 14px 8px 14px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.categories::-webkit-scrollbar { display: none; }
.categories::after { content: ""; flex: 0 0 4px; }

.category-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px var(--shadow);
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.category-chip .thumb {
  width: 36px;
  height: 38px;
  margin: 0 8px 0 -12px;
  object-fit: cover;
}
.category-chip.active { background: var(--theme); border-color: var(--theme); color: #fff; }

.see-all {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  margin-right: 14px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--active-bg);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
}
.see-all::before {
  content: "";
  position: absolute;
  right: 100%;
  top: -14px;
  bottom: -14px;
  width: 28px;
  background: linear-gradient(90deg, #fff0, #fff);
  pointer-events: none;
}
@media (max-width: 420px) { .see-all .label { display: none; } }

/* ---------- Products ---------- */
.products { padding: 0 8px 24px; min-height: 60vh; }

.custom-message {
  margin: 10px 6px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--active-bg);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  color: var(--secondary-text);
}

.category { padding-top: 4px; scroll-margin-top: calc(var(--sticky-top) + 4px); }
.category-name {
  margin: 24px 13px 10px;
  font-size: 22px;
  font-weight: 600;
}
.category-name .count { font-size: 14px; font-weight: 500; color: var(--placeholder); margin-left: 4px; }
.section-heading {
  margin: 28px 13px 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary-text);
}

.product {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  scroll-margin-top: calc(var(--sticky-top) + 12px);
  transition: box-shadow 0.25s var(--ease), transform 0.2s var(--ease);
}
.product:active { transform: scale(0.99); }
.product.has-photo { min-height: 122px; }
.product.expanded { box-shadow: 0 8px 24px #bdbacd66; cursor: default; }
.product.unavailable { color: var(--placeholder); }
.product.unavailable .photo { opacity: 0.4; }
.product.highlight { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px #0000; } }

.product .photo {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 55%;
  width: 45%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: opacity 0.3s;
}
.product .gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #fff, #fff 56%, #fff0 70%);
  z-index: 1;
  pointer-events: none;
}
.product .content { position: relative; z-index: 2; }
.product.has-photo:not(.expanded) .content { padding-right: 38%; }

.product .big-photo {
  display: none;
  width: calc(100% + 24px);
  margin: -11px -12px 12px;
  aspect-ratio: 4 / 3;
  max-height: 420px;
  object-fit: cover;
}
.product.expanded .big-photo { display: block; animation: grow 0.35s var(--ease); }
.product.expanded .photo, .product.expanded .gradient { display: none; }
@keyframes grow { from { opacity: 0; transform: scale(1.04); } }

.name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.product .name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}
.product mark { background: #8bc34a44; color: inherit; border-radius: 3px; }

.tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}
.tag.spicy { background: #ff572322; color: #d8431a; }
.tag.vegetarian { background: #5da41a22; color: #4a8a12; }
.tag.vegan { background: #5da41a33; color: #3c7a0c; }
.tag.new { background: #11b7f322; color: #0a8fc0; }
.tag.chef { background: #c8a96a33; color: #8a6a2a; }

.product .description {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--secondary-text);
}
.product.has-photo:not(.expanded) .description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product .meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--secondary-text);
}

.product .nutrition {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--secondary-text);
}
body.show-nutrition .product .nutrition,
.product.expanded .nutrition { display: block; }

.product .bottom-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.allergens {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.allergen-pill {
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--secondary-text);
  background: #fff;
}
.allergen-pill:hover { border-color: var(--secondary-text); }

.price {
  margin-left: auto;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.price .currency { font-size: 12px; font-weight: 600; margin-left: 2px; }

.product .actions { display: none; margin-top: 12px; gap: 8px; }
.product.expanded .actions { display: flex; }
.product .actions button {
  flex: 1;
  height: 38px;
  border-radius: 8px;
  background: var(--active-bg);
  font-size: 14px;
  font-weight: 600;
}

.no-results {
  padding: 60px 20px;
  text-align: center;
  color: var(--secondary-text);
}
.no-results strong { display: block; font-size: 18px; color: var(--text); margin-bottom: 6px; }

/* ---------- Footer ---------- */
.footer {
  padding: 28px 20px 40px;
  background: var(--theme);
  color: #fffc;
  font-size: 14px;
  text-align: center;
  line-height: 1.7;
}
.footer .footer-name { font-size: 20px; color: #fff; margin-bottom: 6px; }
.footer a { color: #fff; text-decoration: none; }
.footer .socials { display: flex; justify-content: center; gap: 12px; margin: 12px 0; }
.footer .socials a {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: #ffffff1a;
}
.footer small { display: block; margin-top: 12px; color: #fff8; }

/* ---------- Go to top ---------- */
.go-top {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  right: max(20px, calc(50% - 384px + 20px));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--theme);
  color: #fff;
  box-shadow: 0 4px 16px #0004;
  z-index: 150;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: all 0.3s var(--ease);
}
.go-top.visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Modals (bottom sheets on mobile) ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0c0c09bb;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.backdrop.visible { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 1001;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #fff;
  transform: translate(-50%, 105%);
  transition: transform 0.4s var(--ease);
  visibility: hidden;
}
.modal.visible { transform: translate(-50%, 0); visibility: visible; }
@media (min-width: 560px) {
  .modal {
    top: 50%;
    bottom: auto;
    border-radius: 18px;
    transform: translate(-50%, -45%) scale(0.96);
    opacity: 0;
    transition: transform 0.35s var(--ease), opacity 0.25s;
  }
  .modal.visible { transform: translate(-50%, -50%); opacity: 1; }
}

.modal h3 { margin: 0 44px 16px 0; font-size: 20px; font-weight: 600; }
.modal .close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--active-bg);
}

.big-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  margin-bottom: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  text-align: left;
  transition: background 0.2s;
}
.big-button:hover { background: var(--active-bg); }
.big-button .icon { width: 22px; height: 22px; flex-shrink: 0; color: var(--theme); }
.big-button.primary { background: var(--theme); color: #fff; border-color: var(--theme); }
.big-button.primary .icon { color: #fff; }
.big-button.active { border-color: var(--theme); box-shadow: inset 0 0 0 1px var(--theme); }

.schedule { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.day-pill {
  display: flex;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--theme);
  font-size: 13px;
  font-weight: 600;
}
.day-pill .days { padding: 6px 10px; background: var(--theme); color: #fff; }
.day-pill .hours { padding: 6px 10px; }
.day-pill.today { box-shadow: 0 0 0 2px var(--accent); }

.modal-subtitle { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--secondary-text); margin: 16px 0 8px; }

.allergen-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; font-size: 14px; line-height: 1.4; }
.allergen-item + .allergen-item { border-top: 1px solid var(--border); }
.allergen-letter {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--theme);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.allergen-item.dim { opacity: 0.35; }
.allergen-note { font-size: 12px; color: var(--secondary-text); margin-top: 12px; line-height: 1.4; }

.recommended {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  aspect-ratio: 4 / 3;
  background: var(--active-bg);
}
.recommended img { width: 100%; height: 100%; object-fit: cover; }
.recommended .title {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 40px 16px 14px;
  background: linear-gradient(#0000, #000c);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}
.modal-buttons { display: flex; gap: 8px; }
.modal-buttons .big-button { justify-content: center; margin: 0; }

/* ---------- Categories picker ---------- */
.picker {
  position: fixed;
  inset: 0;
  z-index: 900;
  overflow-y: auto;
  padding: 20px 14px calc(90px + env(safe-area-inset-bottom));
  background: rgba(var(--theme-rgb), 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.picker.visible { opacity: 1; visibility: visible; }
.picker-inner { max-width: 740px; margin: 0 auto; }
.picker h3 { color: #fff; font-weight: 600; font-size: 22px; margin: 10px 4px 16px; }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.category-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff18;
  color: #fff;
  text-align: left;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.35s;
  transition-delay: var(--delay, 0ms);
}
.picker.visible .category-card { transform: none; opacity: 1; }
.category-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(#0000 35%, #000b);
}
.category-card .card-name {
  position: absolute;
  left: 12px; right: 12px; bottom: 10px;
  z-index: 1;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
}
.category-card .card-count {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 1;
  min-width: 26px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #0007;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.category-card.no-photo { background: linear-gradient(135deg, #ffffff26, #ffffff0d); border: 1px solid #ffffff22; }
.category-card.no-photo::after { display: none; }
.category-card .initial {
  position: absolute; top: 12px; left: 14px;
  font-size: 44px; font-weight: 300; color: var(--accent);
}

.picker-back {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 23px;
  background: #fff;
  color: var(--theme);
  font-weight: 600;
  box-shadow: 0 6px 20px #0006;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

.category-description { margin: -4px 13px 14px; font-size: 13px; color: var(--secondary-text); }

/* Photo cards: price sits in a white tab on the bottom-right corner, over the photo */
.product.has-photo:not(.expanded) .content { min-height: 98px; }
.product.has-photo:not(.expanded) .bottom-row { padding-right: 0; }
.product.has-photo:not(.expanded) .price {
  position: absolute;
  right: -12px;
  bottom: -11px;
  padding: 5px 12px 6px 14px;
  border-top-left-radius: 12px;
  background: #fff;
  box-shadow: -2px -2px 8px #0000000d;
}
