/* ===== MENU REDESIGN ===== */

.menu-page {
  overflow-x: hidden;
  background: var(--bg);
}

.menu-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(156, 175, 136, 0.18) 0%, transparent 280px),
    radial-gradient(ellipse at 100% 20%, rgba(201, 185, 154, 0.12) 0%, transparent 45%),
    var(--bg);
}

.menu-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.menu-header {
  padding: 20px 16px 0;
}

.header-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 20px 20px 16px;
  border: 1px solid rgba(156, 175, 136, 0.2);
  box-shadow:
    0 4px 24px rgba(45, 52, 54, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  animation: fadeDown 0.6s ease both;
}

.header-logo-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.menu-page .cafe-logo {
  width: 200px;
  height: auto;
  max-height: 200px;
  flex-shrink: 0;
  border-radius: 0;
  object-fit: contain;
  margin: 0;
  box-shadow: none;
  display: block;
  background: transparent;
  filter: drop-shadow(0 2px 8px rgba(45, 52, 54, 0.08));
}

.header-info {
  text-align: center;
  margin-top: 8px;
}

.brand-text {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.brand-en {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--sage-dark);
  opacity: 0.7;
  margin-bottom: 4px;
}

.menu-page .cafe-tagline {
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  margin: 0;
  line-height: 1.4;
}

.menu-page .cafe-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.menu-badge {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--sage-pale);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--sage-dark);
  text-transform: uppercase;
}

/* Category nav */
.menu-page .category-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0 10px;
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
  border: none;
  backdrop-filter: none;
}

.category-nav-inner {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-nav-inner::-webkit-scrollbar { display: none; }

.menu-page .cat-btn {
  padding: 10px 22px;
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  background: var(--bg-card);
  color: var(--text-muted);
  box-shadow: 0 2px 8px rgba(45, 52, 54, 0.05);
}

.menu-page .cat-btn:hover {
  color: var(--sage-dark);
  background: var(--sage-pale);
}

.menu-page .cat-btn.active {
  background: var(--black);
  color: white;
  box-shadow: 0 4px 14px rgba(26, 26, 26, 0.2);
}

/* Main content */
.menu-main {
  flex: 1;
  padding: 4px 16px 0;
}

.menu-page .menu-container {
  padding: 8px 0 32px;
  max-width: none;
}

/* Category section */
.menu-page .category-section {
  margin-bottom: 32px;
}

.menu-page .category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.menu-page .category-header.visible {
  opacity: 1;
  transform: translateY(0);
}

.menu-page .category-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--black);
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  display: block;
  opacity: 1;
  transform: none;
}

.menu-page .category-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sage-dark);
  background: var(--sage-pale);
  padding: 3px 10px;
  border-radius: 50px;
}

.menu-page .category-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--sage-pale), transparent);
}

/* Product grid */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Product card - vertical magazine style */
.menu-page .product-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  min-height: auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(156, 175, 136, 0.15);
  background: var(--bg-card);
  box-shadow: 0 2px 12px rgba(45, 52, 54, 0.05);
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease,
    box-shadow 0.3s ease;
}

.menu-page .product-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.menu-page .product-card:hover {
  box-shadow: 0 8px 28px rgba(45, 52, 54, 0.1);
  border-color: var(--sage-light);
}

.menu-page .product-image-wrap {
  flex: none;
  width: 100%;
  height: 160px;
  min-width: 100%;
  max-width: 100%;
  min-height: 160px;
  max-height: 160px;
  border-radius: 0;
  aspect-ratio: auto;
  position: relative;
  cursor: default;
}

.menu-page .product-card.has-image {
  cursor: pointer;
}

.menu-page .product-card.has-image .product-image-wrap {
  cursor: zoom-in;
}

.menu-page .product-card.has-image .product-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.15));
  pointer-events: none;
}

.image-zoom-hint {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--black);
  pointer-events: none;
  z-index: 1;
}

.image-zoom-hint svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.menu-page .product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.menu-page .product-image-placeholder {
  background: linear-gradient(135deg, var(--sage-pale) 0%, var(--cream-dark) 100%);
}

.menu-page .product-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-page .product-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.menu-page .product-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
  margin: 0;
  line-height: 1.35;
  flex: 1;
}

.menu-page .product-price {
  flex-shrink: 0;
  margin: 0;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  background: var(--sage);
  border-radius: 50px;
  white-space: nowrap;
}

.menu-page .product-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  -webkit-line-clamp: 3;
}

.menu-page .product-category-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--sage-dark);
  background: var(--sage-pale);
  padding: 3px 10px;
  border-radius: 50px;
  margin-top: 2px;
}

/* Empty & loading */
.menu-page .empty-state {
  padding: 80px 24px;
}

.menu-page .empty-state .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--sage-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.menu-page .loading {
  padding: 80px 0;
}

/* Footer */
.menu-page .menu-footer {
  margin-top: auto;
  padding: 8px 24px 36px;
  background: transparent;
  border: none;
}

.footer-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.footer-divider span {
  flex: 1;
  height: 1px;
  background: var(--sage-pale);
}

.footer-logo {
  width: 56px;
  height: auto;
  max-height: 52px;
  border-radius: 0;
  object-fit: contain;
  opacity: 0.92;
  background: transparent;
  filter: drop-shadow(0 1px 4px rgba(45, 52, 54, 0.06));
}

.menu-page .instagram-link {
  background: var(--black);
  padding: 12px 28px;
  font-size: 0.88rem;
  letter-spacing: 0.3px;
}

.menu-page .footer-copy {
  margin-top: 4px;
  font-size: 0.74rem;
  opacity: 0.7;
}

/* Responsive */
@media (min-width: 420px) {
  .products-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .menu-page .product-image-wrap {
    height: 130px;
    min-height: 130px;
    max-height: 130px;
  }

  .menu-page .product-name {
    font-size: 0.9rem;
  }

  .menu-page .product-price {
    font-size: 0.72rem;
    padding: 3px 10px;
  }
}

@media (max-width: 360px) {
  .menu-page .cafe-logo {
    width: 168px;
    max-height: 168px;
  }
}

[data-theme="dark"] .menu-page .cafe-logo,
[data-theme="dark"] .footer-logo {
  filter:
    brightness(1.12)
    contrast(1.08)
    saturate(1.05)
    drop-shadow(0 2px 10px rgba(61, 56, 48, 0.18))
    drop-shadow(0 0 1px rgba(61, 56, 48, 0.12));
  opacity: 1;
}

/* Image lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-lightbox.hidden {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s ease;
}

.lightbox-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: lightboxIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--black);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.08);
}

#lightboxImage {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: var(--cream-dark);
  display: block;
}

.lightbox-info {
  padding: 16px 20px 20px;
  text-align: center;
}

.lightbox-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 6px;
}

.lightbox-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

#lightboxPrice {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 14px;
  background: var(--sage);
  color: white;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.88rem;
}

#lightboxPrice.hidden,
#lightboxDesc.hidden {
  display: none;
}

@keyframes lightboxIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== DARK THEME — subtle warm beige + light sage ===== */
[data-theme="dark"] {
  --bg: #E5DFD4;
  --bg-card: #F5F0E8;
  --bg-card-hover: #F0EBE2;
  --cream: #F5F0E8;
  --cream-dark: #E5DFD4;
  --black: #3D3830;
  --text-primary: #3D3830;
  --text-muted: #6B6559;
  --sage: #9CAF88;
  --sage-dark: #7A9068;
  --sage-light: #B5C9A5;
  --sage-pale: #D4DFC8;
  --wood: #D4C4A8;
  --wood-light: #C9B99A;
  --shadow: 0 2px 16px rgba(61, 56, 48, 0.08);
  --shadow-hover: 0 8px 32px rgba(61, 56, 48, 0.12);
}

[data-theme="dark"] .menu-bg {
  background:
    linear-gradient(180deg, rgba(168, 191, 150, 0.22) 0%, transparent 280px),
    radial-gradient(ellipse at 100% 20%, rgba(212, 196, 168, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse at 0% 80%, rgba(181, 201, 165, 0.12) 0%, transparent 40%),
    var(--bg);
}

[data-theme="dark"] .header-card {
  border-color: rgba(156, 175, 136, 0.28);
  box-shadow:
    0 4px 24px rgba(61, 56, 48, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

[data-theme="dark"] .menu-page .category-nav {
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
}

[data-theme="dark"] .menu-page .cat-btn {
  background: var(--bg-card);
  color: var(--text-muted);
  box-shadow: 0 2px 8px rgba(61, 56, 48, 0.06);
  border: 1px solid rgba(212, 196, 168, 0.35);
}

[data-theme="dark"] .menu-page .cat-btn:hover {
  background: var(--sage-pale);
  color: var(--sage-dark);
  border-color: rgba(156, 175, 136, 0.35);
}

[data-theme="dark"] .menu-page .cat-btn.active {
  background: var(--sage);
  color: #F5F0E8;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(122, 144, 104, 0.28);
}

[data-theme="dark"] .menu-page .product-card {
  border-color: rgba(156, 175, 136, 0.2);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .menu-page .product-card:hover {
  border-color: rgba(168, 191, 150, 0.45);
  box-shadow: var(--shadow-hover);
}

[data-theme="dark"] .menu-page .product-image-placeholder {
  background: linear-gradient(135deg, var(--sage-pale) 0%, var(--cream-dark) 100%);
}

[data-theme="dark"] .image-zoom-hint {
  background: rgba(245, 240, 232, 0.94);
  color: var(--black);
}

[data-theme="dark"] .menu-page .instagram-link {
  background: var(--sage-dark);
  color: #F5F0E8;
}

[data-theme="dark"] .menu-page .instagram-link:hover {
  background: var(--sage);
  color: #F5F0E8;
}

[data-theme="dark"] .lightbox-backdrop {
  background: rgba(61, 56, 48, 0.55);
}

[data-theme="dark"] .lightbox-content {
  background: var(--bg-card);
  box-shadow: 0 20px 60px rgba(61, 56, 48, 0.18);
}

[data-theme="dark"] .lightbox-close {
  background: var(--bg-card);
  color: var(--black);
}

[data-theme="dark"] #lightboxImage {
  background: var(--cream-dark);
}

[data-theme="dark"] .lightbox-info h3 {
  color: var(--black);
}

[data-theme="dark"] .lightbox-info p {
  color: var(--text-muted);
}

[data-theme="dark"] .footer-divider span {
  background: var(--sage-pale);
}
