@import url("https://fonts.googleapis.com/css2?family=Great+Vibes&family=Montserrat:wght@400;500;600;700&display=swap");


:root {
  --font-main: "Montserrat", Arial, sans-serif;
  --font-dish: "Great Vibes", var(--font-main);
  --stable-viewport-height: 100vh;
  --header-height: 74px;
  --bg: #f2f7fa;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #626a70;
  --line: #dbe5eb;
  --blue: #0037ff;
  --blue-soft: #0185d0;
  --accent: #ff8562;
  --danger: #cf2f2f;
  --shadow: 0 18px 46px rgba(15, 36, 48, 0.12);
  --radius: 8px;
}

@supports (height: 100lvh) {
  :root {
    --stable-viewport-height: 100lvh;
  }
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-main);
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 11;
  opacity: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  content: "";
  background: rgba(0, 0, 0, 0.5);
  transition: opacity 0.5s ease;
}

body.is-dish-viewer::before {
  opacity: 1;
}

p,
h1,
h2,
h3,
strong,
small,
span,
a,
label,
input,
textarea,
.collection-title,
.dish-slide-title {
  user-select: text;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: var(--header-height);
  padding: 10px 16px;
  border-bottom: 1px solid rgba(219, 229, 235, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  will-change: transform;
}

.is-opening-viewer .site-header,
.is-dish-viewer .site-header {
  opacity: 0;
  transform: translateY(-110%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  width: 52px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.1;
}

.header-link {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 30px;
  background: var(--blue-soft);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.header-link:active {
  transform: translateY(1px);
}

main {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.menu-app {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.is-opening-viewer .menu-app,
.is-dish-viewer .menu-app,
.is-closing-viewer .menu-app {
  z-index: 80;
}

.category-screen {
  position: relative;
  z-index: 2;
  width: 100vw;
  height: calc(100dvh - 74px);
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.is-opening-viewer .category-screen,
.is-dish-viewer .category-screen {
  pointer-events: none;
  transform: translate3d(-100vw, 0, 0);
}

.category-collections {
  display: flex;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
  gap: 2px;
  flex-direction: column;
}

.category-collection {
  width: 100%;
  height: 40px;
  animation: category-appear 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--category-index, 0) * 45ms);
  flex: 1;
}

.collection-button {
    aspect-ratio: 1;
    padding: 0;
    border: none;
    background: transparent;
    transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    height: 100%;
    width: 100%;
}

.collection-button:active {
  /* width: calc(100% + 10px); */
  zoom: 1;
}

.category-circle {
  position: relative;
  display: block;
  overflow: hidden;
  height: 100%;
  box-shadow: 0 18px 36px rgba(15, 36, 48, 0.18);
  transition: box-shadow 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* .category-circle::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 42%, rgba(0, 0, 0, 0.58) 100%);
} */

.category-circle img,
.category-circle-empty {
  width: 100%;
  height: 100%;
}

.category-circle img {
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.category-circle-empty {
  display: block;
  background:
    radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.75), transparent 36%),
    linear-gradient(135deg, #dfe8ed, #b9ced9);
}

.collection-title {
  font-family: var(--font-dish);
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  height: 100%;
  width: 100%;
  color: #fff;
  display: flex;
  font-size: 5vh;
  font-weight: 400;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}

/* .collection-button.is-tap-feedback .category-circle {
  animation: tap-circle-feedback 0.28s ease;
} */

@keyframes category-appear {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* @keyframes tap-circle-feedback {
  38% {
    box-shadow: 0 18px 36px rgba(1, 133, 208, 0.32);
    filter: brightness(0.92) saturate(1.12);
    width: calc(100% + 10px);
  }
} */

.dish-viewer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  overflow: hidden;
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
  background: transparent;
  opacity: 1;
  transform: translate3d(100vw, 0, 0);
  transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.is-opening-viewer .dish-viewer,
.is-dish-viewer .dish-viewer {
  transform: translate3d(0, 0, 0);
}

/* .dish-viewer::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.5s ease;
} */

.is-opening-viewer .dish-viewer::before,
.is-dish-viewer .dish-viewer::before {
  opacity: 1;
}

.dish-track {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.dish-track::-webkit-scrollbar {
  display: none;
}

.dish-slide {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  scroll-snap-align: start;
}

.dish-slide-image {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-radius: 20px;
  background: #dfe8ed;
  /* box-shadow: -20px -20px 24px rgba(15, 36, 48, 0.2); */
  transition: opacity 0.22s ease;
}

.dish-slide-image::after {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55));
}

.dish-slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-slide-title {
  position: absolute;
  bottom: 70px;
  left: 30px;
  z-index: 2;
  margin: 0;
  color: #fff;
  font-family: var(--font-dish);
  font-size: clamp(2.35rem, 10vw, 4.6rem);
  font-weight: 400;
  line-height: 0.92;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.66);
}

.viewer-nav {
  position: fixed;
  top: 50%;
  z-index: 112;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0);
  box-shadow: 0 14px 30px rgba(15, 36, 48, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  transition: transform 0.2s linear;
}

.viewer-nav img {
  width: 27px;
  height: 27px;
}

.viewer-nav-left {
  left: 0;
  transform: translate(-115%, -50%);
  border: 1px solid #00a3ff;
}

.viewer-nav-left.is-visible {
  pointer-events: auto;
  transform: translate(18px, -50%);
}

.viewer-nav-right {
  right: 0;
  transform: translate(115%, -50%);
  border: 1px solid #00a3ff;
}

.viewer-nav-right.is-visible {
  pointer-events: auto;
  transform: translate(-18px, -50%);
}

.viewer-back {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 114;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: none;
  border: 1px solid #00a3ff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.viewer-back img {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
}

.is-opening-viewer,
.is-dish-viewer,
.is-closing-viewer {
  overflow: hidden;
}

.is-tap-feedback {
  animation: tap-filter-feedback 0.26s ease;
}

.viewer-back.is-tap-feedback::after,
.viewer-nav.is-tap-feedback {
  animation: tap-surface-feedback 0.28s ease;
}

.header-link.is-tap-feedback {
  animation: tap-header-feedback 0.28s ease;
}

@keyframes tap-filter-feedback {
  40% {
    filter: brightness(0.9) saturate(1.16);
  }
}

@keyframes tap-surface-feedback {
  38% {
    background-color: rgba(1, 133, 208, 0.16);
    border-color: rgba(1, 133, 208, 0.34);
  }
}

@keyframes tap-header-feedback {
  38% {
    background-color: #0078bd;
  }
}

.admin-form input,
.category-fields input,
.item-name-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-form input:focus,
.category-fields input:focus,
.item-name-input:focus {
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(1, 133, 208, 0.14);
}

.status-message {
  padding: 26px 16px;
  color: var(--muted);
  text-align: center;
}

.admin-page {
  background: #f7fafc;
}

.admin-main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

.login-panel {
  display: grid;
  gap: 18px;
  width: min(420px, calc(100% - 32px));
  margin: 9vh auto 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-panel img {
  width: 72px;
  height: 64px;
  object-fit: contain;
}

.login-panel h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.admin-form,
.category-fields {
  display: grid;
  gap: 14px;
}

.admin-form label,
.category-fields label {
  display: grid;
  gap: 7px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-text-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 30px;
  border: 0;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.primary-button {
  background: var(--blue);
  color: #fff;
}

.primary-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
}

.ghost-button {
  background: transparent;
  color: var(--muted);
}

.icon-text-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.danger-button {
  background: rgba(207, 47, 47, 0.1);
  color: var(--danger);
}

.primary-button:not(:disabled):active,
.secondary-button:active,
.ghost-button:active,
.icon-text-button:active,
.danger-button:active,
.square-button:active {
  transform: translateY(1px);
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.admin-shell {
  min-height: 100dvh;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 76px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.admin-sidebar,
.editor-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(15, 36, 48, 0.06);
}

.admin-sidebar {
  overflow: hidden;
}

.sidebar-title,
.items-head,
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.sidebar-title {
  flex-wrap: wrap;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.sidebar-title h2,
.items-head h3,
.editor-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.1;
}

.admin-category-list {
  display: grid;
  max-height: 42vh;
  overflow: auto;
  padding: 8px;
}

.category-list-button {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.category-list-button.is-active {
  border-color: rgba(0, 55, 255, 0.18);
  background: rgba(0, 55, 255, 0.06);
}

.category-list-button img,
.category-list-button .thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--bg);
}

.category-list-button strong {
  display: block;
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-list-button small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.editor-panel {
  min-height: 420px;
  padding: 16px;
}

.empty-editor {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: var(--muted);
}

.editor-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.editor-meta {
  margin: 0 0 6px;
  color: var(--blue-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.square-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
}

.square-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.category-fields {
  grid-template-columns: 1fr;
  margin-bottom: 24px;
}

.category-field-controls {
  display: grid;
  gap: 14px;
}

.category-field-controls label {
  display: grid;
  gap: 7px;
}

.photo-field input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: auto;
  padding: 11px 12px;
}

.category-preview-card {
  display: grid;
  width: 100%;
  padding: 12px 0 4px;
}

.admin-category-circle {
  width: 100%;
  height: clamp(118px, 18vh, 170px);
}

.category-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.items-head {
  margin: 10px 0 12px;
}

.items-list {
  display: grid;
  gap: 12px;
}

.item-editor {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

.item-editor img,
.admin-image-empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--bg);
}

.admin-image-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.item-fields {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.item-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}

.item-controls .photo-field {
  flex: 1 1 100%;
  min-width: 0;
}

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.save-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.is-uploading {
  opacity: 0.55;
  pointer-events: none;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

@media (hover: hover) {
  .header-link:hover,
  .primary-button:not(:disabled):hover,
  .secondary-button:hover,
  .ghost-button:hover,
  .icon-text-button:hover,
  .danger-button:hover,
  .square-button:not(:disabled):hover {
    transform: translateY(-1px);
  }

  .collection-button:hover {
    transform: translateY(-2px);
  }

  .collection-button:hover .category-circle {
    box-shadow: 0 22px 42px rgba(15, 36, 48, 0.22);
  }

  .collection-button:hover .category-circle img {
    transform: scale(1.04);
  }

  .viewer-back:hover::after,
  .viewer-nav:hover {
    background-color: rgba(255, 255, 255, 0.98);
  }
}

@media (min-width: 720px) {
  :root {
    --header-height: 77px;
  }

  .site-header {
    padding-inline: 28px;
  }

  .brand img {
    width: 64px;
    height: 56px;
  }

  main {
    padding-inline: 28px;
  }

  .admin-layout {
    grid-template-columns: 300px 1fr;
    align-items: start;
    padding: 18px;
  }

  .admin-sidebar {
    position: sticky;
    top: 94px;
  }

  .admin-category-list {
    max-height: calc(100dvh - 260px);
  }

  .editor-panel {
    padding: 22px;
  }

  .category-field-controls {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr);
    align-items: end;
  }

  .item-editor {
    grid-template-columns: 132px 1fr;
    align-items: start;
  }

  .item-editor img,
  .admin-image-empty {
    aspect-ratio: 1 / 1;
  }
}

@media (min-width: 1040px) {
  .admin-layout {
    grid-template-columns: 340px 1fr;
  }
}

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