/* =========================================================
   CHIEF SPA - Menu page patch (menu.php only)
   - Scrollable menu pages inside book frame
   - Image / booking modals
========================================================= */

.menu-book-section {
  padding-top: 8px;
  padding-bottom: 48px;
}

.menu-book-section .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.menu-book {
  width: min(720px, 94vw);
  margin: 0 auto;
}

.menu-book__empty {
  padding: 24px 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.12);
}

.menu-book__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 0 28px;
  border-radius: 18px;
  background: linear-gradient(145deg, #3d2a1e 0%, #2a1c14 48%, #1f1510 100%);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.menu-book__spine {
  position: absolute;
  left: 10px;
  top: 12px;
  bottom: 58px;
  width: 14px;
  border-radius: 6px 2px 2px 6px;
  background: linear-gradient(90deg, #1a110c, #5a3e2b 35%, #2d1f15 70%, #120c08);
  box-shadow: inset -2px 0 6px rgba(0, 0, 0, 0.45);
  z-index: 4;
  pointer-events: none;
}

.menu-book__scroll {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  max-height: min(70vh, 620px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: 6px 14px 0 0;
  background: #f4f0eb;
  box-shadow:
    2px 0 0 rgba(90, 62, 43, 0.12),
    0 10px 28px rgba(0, 0, 0, 0.18);
}

.menu-book__scroll:focus-visible {
  outline: 2px solid rgba(221, 182, 106, 0.75);
  outline-offset: 2px;
}

.menu-book__scroll::-webkit-scrollbar {
  height: 8px;
}

.menu-book__scroll::-webkit-scrollbar-track {
  background: rgba(90, 62, 43, 0.08);
  border-radius: 8px;
}

.menu-book__scroll::-webkit-scrollbar-thumb {
  background: rgba(90, 62, 43, 0.35);
  border-radius: 8px;
}

.menu-book__page {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #f4f0eb;
}

.menu-book__page.is-active {
  box-shadow: inset 0 0 0 2px rgba(221, 182, 106, 0.35);
}

.menu-book__page + .menu-book__page {
  border-left: 1px solid rgba(90, 62, 43, 0.12);
}

.menu-book__page-hit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
}

.menu-book__page-hit:focus-visible {
  outline: 2px solid rgba(221, 182, 106, 0.85);
  outline-offset: 3px;
}

.menu-book__page-hit img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center top;
  pointer-events: none;
}

.menu-book__controls {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 12px 14px;
  margin-top: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 0 0 14px 6px;
}

.menu-book__nav-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 20, 14, 0.55);
  color: rgba(255, 255, 255, 0.96);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.menu-book__nav-btn span {
  display: block;
  margin-top: -2px;
}

.menu-book__nav-btn:hover:not(:disabled) {
  background: rgba(50, 34, 24, 0.78);
  border-color: rgba(221, 182, 106, 0.65);
  transform: scale(1.04);
}

.menu-book__nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.menu-book__counter {
  min-width: 100px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

.menu-book__hint {
  width: 100%;
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 520px) {
  .menu-book__stage {
    padding: 14px 10px 0 22px;
  }

  .menu-book__spine {
    left: 6px;
    width: 10px;
    bottom: 54px;
  }

  .menu-book__scroll {
    max-height: min(65vh, 520px);
  }

  .menu-book__nav-btn {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .menu-book__controls {
    gap: 10px;
    padding: 10px 8px 12px;
  }

  .menu-book__counter {
    min-width: 84px;
    font-size: 13px;
  }
}

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

@media (min-width: 769px) {
  .menu-book {
    width: min(880px, 88vw);
  }

  .menu-book__stage {
    overflow: visible;
  }

  .menu-book__scroll {
    max-height: none;
    overflow-y: visible;
    align-items: flex-start;
  }

  .menu-book__page {
    align-self: flex-start;
    height: auto;
  }

  .menu-book__page-hit img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center top;
  }
}

/* ----- Modals (menu page) ----- */
body.menu-page.is-modal-open {
  overflow: hidden;
}

.menu-page .img-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  z-index: 2000;
}

.menu-page .img-modal.is-open {
  display: flex;
}

.menu-page .img-modal__panel {
  position: relative;
  width: auto;
  max-width: min(720px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}

.menu-page .img-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.92);
  font-size: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2;
}

.menu-page .img-modal__close:hover {
  transform: scale(1.04);
}

.menu-page .img-modal__body {
  max-height: calc(100vh - 56px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-overflow-scrolling: touch;
}

.menu-page .img-modal__img {
  display: block;
  width: auto;
  max-width: min(680px, calc(100vw - 72px));
  max-height: calc(100vh - 88px);
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.menu-page .book-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  z-index: 2100;
}

.menu-page .book-modal.is-open {
  display: flex;
}

.menu-page .book-modal__panel {
  width: min(620px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 18, 18, 0.95);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.6);
  color: #fff;
}

.menu-page .book-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-page .book-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.menu-page .book-form {
  padding: 14px 16px 16px;
  display: grid;
  gap: 12px;
}

.menu-page .book-form__row {
  display: grid;
  gap: 8px;
}

.menu-page .book-form label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.menu-page .book-form input,
.menu-page .book-form select,
.menu-page .book-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.menu-page .book-form select {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
}

.menu-page .book-form select option {
  color: #1a1a1a;
  background: #ffffff;
}

.menu-page .book-form input::placeholder,
.menu-page .book-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.menu-page .book-form textarea {
  min-height: 92px;
  resize: vertical;
}

.menu-page .book-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.menu-page .btn-ghost,
.menu-page .btn-primary {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  color: #fff;
  font-size: 14px;
}

.menu-page .btn-ghost {
  background: rgba(255, 255, 255, 0.06);
}

.menu-page .btn-primary {
  background: linear-gradient(180deg, #ddb66a, #c39343);
  border-color: rgba(221, 182, 106, 0.85);
  color: #201307;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.menu-page .side-social {
  position: fixed;
  right: 10px;
  left: auto;
  top: auto;
  bottom: 124px;
  transform: none;
  z-index: 2050;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-page .side-social a {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.menu-page .side-social a:hover {
  transform: translateY(-1px) scale(1.06);
  background: rgba(0, 0, 0, 0.58);
  border-color: rgba(220, 179, 97, 0.55);
}

.menu-page .side-social img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

@media (max-width: 900px) {
  .menu-page .side-social {
    right: 6px;
    bottom: 86px;
    display: grid;
    grid-template-columns: repeat(2, 32px);
    grid-auto-rows: 32px;
    gap: 6px;
  }

  .menu-page .side-social a {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 520px) {
  .menu-page .img-modal {
    padding: 10px;
  }

  .menu-page .img-modal__panel {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .menu-page .img-modal__body {
    max-height: calc(100vh - 28px);
  }

  .menu-page .img-modal__img {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
  }

  .menu-page .img-modal__close {
    width: 42px;
    height: 42px;
  }

  .menu-page .side-social {
    right: 4px;
    bottom: 88px;
    grid-template-columns: repeat(2, 28px);
    grid-auto-rows: 28px;
    gap: 5px;
  }

  .menu-page .side-social a {
    width: 28px;
    height: 28px;
  }
}
