:root {
  --bg: #fcfaf7;
  --text: #2a2a2a;
  --accent: #8c5e58;
  --accent-light: #e8d6d3;
  --gold: #c0a080;
  --light-gold: #e8e0d4;
  --font-serif: 'Malgun Gothic', Arial, sans-serif;
  --font-sans: 'Montserrat', sans-serif;
  --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  padding: 0;
  overflow-x: hidden;
}

header {
  padding: 70px 20px 40px;
  text-align: center;
  position: relative;
  background-image: 
    radial-gradient(circle at 90% 80%, rgba(140, 94, 88, 0.03) 0%, transparent 25%);
}

header h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem; 
  color: var(--accent);
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 15px;
}

header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.1rem;
  color: #666;
  padding: 0 20px;
}

.divider {
  height: 1px;
  background: var(--light-gold);
  width: 80%;
  max-width: 500px;
  margin: 30px auto;
}

nav {
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(252, 250, 247, 0.95);
  backdrop-filter: blur(5px);
  border-bottom: 1px solid var(--light-gold);
}

.nav-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 15px;
}

nav a {
  color: var(--text);
  text-decoration: none;
  padding: 6px 12px;
  position: relative;
  font-weight: 400;
  letter-spacing: 0.5px;
  transition: var(--transition);
  font-size: 0.95rem;
  border-radius: 20px;
}

nav a:hover,
nav a.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* Мобильное меню */
.mobile-menu-toggle {
  display: none;
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  margin: 10px auto;
  transition: var(--transition);
  align-items: center;
  gap: 8px;
  justify-content: center;
  width: calc(100% - 30px);
  max-width: 300px;
}

.mobile-menu-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.mobile-dropdown {
  display: none;
  flex-direction: column;
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  margin: 10px 15px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  overflow-y: auto;
}

.mobile-dropdown.active {
  display: flex;
  max-height: 70vh;
}

.mobile-dropdown a {
  padding: 12px 20px;
  border-bottom: 1px solid var(--light-gold);
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  font-size: 0.95rem;
}

.mobile-dropdown a:last-child {
  border-bottom: none;
}

.mobile-dropdown a:hover,
.mobile-dropdown a.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* Адаптивность для навигации */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav-container {
    display: none !important;
  }
  
  nav {
    padding: 5px 0;
  }
}

@media (min-width: 769px) {
  .mobile-menu-toggle,
  .mobile-dropdown {
    display: none !important;
  }
  
  .nav-container {
    display: flex !important;
  }
}

section {
  padding: 20px 15px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  margin-bottom: 15px;
  position: relative;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 15px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--accent);
  font-weight: 400;
  margin-bottom: 0;
  position: relative;
  display: inline-block;
  letter-spacing: 0.5px;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  transform: none;
  width: 60px;
  height: 1px;
  background: var(--gold);
}

.view-toggle {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 15px;
}

.menu-grid {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 0 15px 15px;
  margin: 0 -15px;
  scrollbar-width: none;
  transition: all 0.3s ease;
}

.menu-grid.expanded {
  flex-wrap: wrap;
  overflow-x: visible;
  justify-content: space-between;
  padding: 0;
  margin: 0;
  scroll-snap-type: none;
}

.menu-grid.expanded .menu-item {
  flex: 0 0 calc(33.333% - 15px);
  margin-right: 0;
  margin-bottom: 30px;
  height: auto;
}

.menu-grid::-webkit-scrollbar {
  display: none;
}

.menu-item {
  flex: 0 0 calc(50% - 15px);
  scroll-snap-align: start;
  margin-right: 30px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 3px 15px rgba(0,0,0,0.03);
  position: relative;
  min-height: 100%;
}

.menu-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.menu-item-image {
  height: 200px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-gold);
}

.menu-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.menu-item-image img[src*="sakura.png"] {
  object-fit: contain;
  width: auto;
  height: auto;
  max-width: 80%;
  max-height: 80%;
  background: white;
  padding: 10px;
  display: block;
  margin: 0 auto 50px auto;
  position: relative;
  top: 50px;
}

.menu-item-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.menu-item h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 400;
}

.menu-item p {
  color: #666;
  margin-bottom: 15px;
  flex-grow: 1;
  font-size: 0.95rem;
}

.menu-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--light-gold);
  padding-top: 15px;
  margin-top: auto;
}

.price {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 500;
}

.extra {
  font-size: 0.85rem;
  color: var(--gold);
  background: var(--light-gold);
  padding: 4px 10px;
  border-radius: 20px;
}

.btn-view {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(192, 160, 128, 0.3);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.slider-nav {
  display: flex;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  gap: 5px;
}

.slider-btn {
  background: var(--bg);
  border: 1px solid var(--light-gold);
  color: var(--accent);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

/* Модальное окно */
#modal {
  display: none;
  position: fixed; 
  inset: 0;
  background: rgba(0,0,0,0.9);
  align-items: center; 
  justify-content: center;
  z-index: 100;
  padding: 15px;
}

/* Слайдер в модальном окне */
#modalSlider {
  position: relative; 
  text-align: center; 
  margin-bottom: 30px;
  border-radius: 6px;
  overflow: hidden;
  height: 500px;
  max-height: 70vh;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#modalImg {
  width: 100%; 
  height: 100%;
  object-fit: cover; 
  object-position: center;
  display: block;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  will-change: transform, opacity, filter;
}

.modal-slide-btn {
  position: absolute; 
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.85); 
  color: var(--text);
  border: none; 
  border-radius: 50%;
  width: 40px;
  height: 40px; 
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(4px);
  z-index: 2;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.modal-slide-btn:hover {
  background: white;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#modalPrev { left: 20px; }
#modalNext { right: 20px; }

#modalContent {
  background: var(--bg);
  padding: 35px;
  border-radius: 8px;
  max-width: 750px;
  width: 90%;
  color: var(--text);
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  max-height: 90vh;
  overflow-y: auto;
}

#modalClose {
  position: absolute; 
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.9);
  border: none;
  font-size: 1.8rem; 
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

#modalClose:hover {
  background: white;
  color: var(--accent);
  transform: scale(1.1);
}

#modalTitle {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 15px;
  line-height: 1.3;
}

#modalDesc {
  margin-bottom: 20px;
  color: #666;
  line-height: 1.7;
  white-space: pre-line;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--light-gold);
  padding-top: 20px;
}

.modal-details {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--light-gold);
}

.modal-details h4 {
  font-family: var(--font-serif);
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 500;
}

.modal-details ul {
  padding-left: 20px;
  margin-bottom: 15px;
}

.modal-details li {
  margin-bottom: 8px;
  color: #666;
}

footer {
  text-align: center;
  padding: 50px 20px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(140, 94, 88, 0.03) 0%, transparent 25%);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .menu-item {
    height: 460px;
    display: flex;
    flex-direction: column;
    position: relative;
  }
  
  .menu-item-image {
    height: 170px !important;
    flex-shrink: 0;
  }
  
  .menu-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 15px 50px;
    min-height: 0;
    overflow: hidden;
  }
  
  .menu-item h3 {
    font-size: 1.05rem;
    line-height: 1.25;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    overflow: hidden;
    word-break: break-word;
    min-height: 1.25em;
    max-height: 5em;
    flex-shrink: 0;
  }
  
  .menu-item-content p {
    flex: 1;
    overflow: hidden;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0;
    position: relative;
    max-height: 4.2em;
  }
  
  .menu-item-content:after {
    content: '';
    position: absolute;
    bottom: 50px;
    left: 15px;
    right: 15px;
    height: 2em;
    background: linear-gradient(to bottom, 
      rgba(252, 250, 247, 0) 0%, 
      rgba(252, 250, 247, 1) 100%);
    pointer-events: none;
    z-index: 1;
  }
  
  .menu-item-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 15px;
    border-top: 1px solid var(--light-gold);
    background: white;
    z-index: 2;
  }
  
  /* Модальное окно на мобильных */
  #modalSlider {
    height: 350px;
    max-height: 50vh;
    margin-bottom: 20px;
    border-radius: 4px;
  }
  
  #modalContent {
    padding: 25px;
    max-width: 90%;
    border-radius: 6px;
  }
  
  .modal-slide-btn {
    width: 36px;
    height: 36px;
  }
  
  #modalClose {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
  }
  
  #modalTitle {
    font-size: 1.6rem;
  }
}

@media (max-width: 600px) {
  .menu-grid.expanded .menu-item {
    flex: 0 0 100%;
  }
}

@media (max-width: 480px) {
  .section-header {
    padding-right: 80px;
  }
  
  .section-header h2 {
    font-size: 1.4rem;
  }
  
  .menu-item {
    height: 350px;
  }
  
  /* Модальное окно на маленьких экранах */
  #modalSlider {
    height: 300px;
    max-height: 45vh;
    margin-bottom: 15px;
  }
  
  #modalContent {
    padding: 20px;
    max-width: 95%;
  }
  
  .modal-slide-btn {
    width: 32px;
    height: 32px;
  }
  
  #modalPrev {
    left: 10px;
  }
  
  #modalNext {
    right: 10px;
  }
  
  #modalTitle {
    font-size: 1.5rem;
  }
}

/* Стили для футера с логотипом */
footer {
  font-family: var(--font-sans);
  font-weight: 300;
  position: relative;
  text-align: center;
  padding: 70px 20px;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('Images/sakurafon.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 40%;
  opacity: 0;
  z-index: 0;
  animation: fadeInLogo 1.5s ease-out forwards;
  animation-delay: 0.3s;
  filter: grayscale(100%) brightness(1.1) opacity(0.30);
}

@keyframes fadeInLogo {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 0.30; transform: scale(1); }
}

.footer-content {
  position: relative;
  z-index: 1;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--accent);
  margin-bottom: 15px;
  letter-spacing: 2px;
}

.footer-contact {
  margin: 8px 0;
  color: #666;
}

.copyright {
  margin-top: 25px;
  color: #999;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  footer::before { background-size: 50%; }
}

@media (max-width: 480px) {
  footer { padding: 40px 15px; }
  footer::before { 
    background-size: 70%;
    filter: grayscale(100%) brightness(1.2) opacity(0.1);
  }
}