:root {
  --primary: #ff7700;
  --primary-light: #ffa552;
  --primary-dark: #e56a00;
  --light: #fff;
  --dark: #333;
  --gray: #f5f5f5;
  --border: #e0e0e0;
  --text: #444;
  --section-bg: #fff;
  --radius-xl: 20px;
  --radius-xxl: 80px;
  --shadow-1: 0 5px 15px rgba(0,0,0,.08);
  --shadow-2: 0 8px 20px rgba(0,0,0,.06);
}

/* Сброс + базовые настройки */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--dark);
  -webkit-text-size-adjust: 100%;
  background:
    linear-gradient(rgba(50,50,50,.4), rgba(50,50,50,.4)),
    url("https://i.postimg.cc/HjGKtG6R/brosky-2-1.png") no-repeat center/cover;
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
}

@supports (-webkit-touch-callout: none) {
  /* iOS: отключить fixed-прикрепление */
  body {
    background-attachment: initial;
  }
}

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

.container {
  width: 100%;
  max-width: 1000px;
  margin-inline: auto;
  padding-inline: clamp(12px, 3vw, 20px);
}

/* ---------- Header ---------- */
header {
  background-color: rgba(242,242,242,.72);
  padding: clamp(18px, 5vw, 28px) 0;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,.05);
  backdrop-filter: saturate(120%) blur(2px);
  padding-top: calc(env(safe-area-inset-top, 0px) + clamp(18px, 5vw, 28px));
}

.hero {
  text-align: center;
}

.logo {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: 5px;
  color: #000;
  margin: 0;
}

.logo .dot {
  color: var(--primary);
  margin-left: 3px;
}

.logo-divider {
  height: 2px;
  width: min(500px, 80%);
  margin: 12px auto 0;
  background: linear-gradient(to right, transparent, var(--primary), transparent);
  border-radius: 1px;
}

/* ---------- Categories (sticky + горизонтальная прокрутка) ---------- */
.categories {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--light);
  margin: clamp(14px, 3vw, 24px) auto;
  padding: 8px;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0,0,0,.08);
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.15) transparent;
}

.categories::-webkit-scrollbar {
  height: 8px;
}

.categories::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
  border-radius: 8px;
}

.category-btn {
  padding: 10px 14px;
  font-size: clamp(.92rem, 2.5vw, 1rem);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark);
  transition: .25s;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
  min-height: 44px;  /* удобная зона тапа */
}

.category-btn:hover {
  color: var(--primary);
  background: rgba(255,119,0,.1);
}

.category-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.categories .divider {
  width: 2px;
  height: 28px;
  background: rgba(0,0,0,.08);
  margin: 6px 4px;
  flex: 0 0 auto;
}

/* ---------- Sections & Cards ---------- */
.menu-section {
  background: var(--section-bg);
  border: 1px solid rgba(255,119,0,.1);
  border-radius: var(--radius-xl);
  padding: clamp(18px, 3.6vw, 26px);
  margin-bottom: clamp(18px, 4vw, 32px);
  box-shadow: var(--shadow-2);
  animation: fadeIn .6s ease-out forwards;
  display: none; /* скрываем — управляет JS */
  scroll-margin-top: 90px;
}

.menu-section.active {
  display: block;
}

.section-title {
  text-align: center;
  margin: 0 0 22px;
  position: relative;
  padding-bottom: 12px;
}

.section-title h2 {
  font-size: clamp(1.4rem, 5.5vw, 2.2rem);
  color: var(--primary);
  display: inline-block;
  padding: 0 16px;
  background: var(--section-bg);
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--primary), transparent);
}

.menu-grid {
  display: grid;
  gap: clamp(14px, 3vw, 22px);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

@media (max-width: 480px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }
}

.menu-card {
  background: var(--light);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-2);
  border: 1px solid rgba(255,119,0,.15);
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: fadeIn .5s ease-out both;
}

.menu-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(255,119,0,.15);
}

.menu-card .card-header {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.item-price {
  background: #fff;
  color: var(--primary);
  padding: 8px 14px;
  border-radius: 30px;
  font-weight: 700;
  font-size: .98rem;
  white-space: nowrap;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(0,0,0,.1);
}

.card-body {
  padding: 18px;
}

.item-description {
  color: #555;
  font-size: .95rem;
  display: flex;
  align-items: flex-start;
}

.item-details {
  display: flex;
  justify-content: space-between;
  color: #777;
  font-size: .9rem;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  margin-top: 12px;
}

/* ---------- Meals (Блюда) ---------- */
.meals-grid {
  display: grid;
  gap: clamp(16px, 3vw, 24px);
  grid-template-columns: 1fr;
}

.meal-category {
  background: var(--light);
  border-radius: 15px;
  padding: clamp(18px, 3.5vw, 24px);
  box-shadow: var(--shadow-1);
  border: 1px solid rgba(255,119,0,.15);
  scroll-margin-top: 90px;
}

.meal-category-title {
  font-size: clamp(1.05rem, 3.8vw, 1.35rem);
  color: var(--primary);
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-light);
}

.meal-items {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-top: 6px;
}

@media (max-width: 480px) {
  .meal-items {
    grid-template-columns: 1fr;
  }
}

.meal-item {
  background: #fff;
  border: 1px solid rgba(255,119,0,.12);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow-1);
  transition: .25s;
}

.meal-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(255,119,0,.12);
  background: rgba(255,119,0,.03);
}

.meal-name {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--dark);
  border-bottom: 1px dashed rgba(255,119,0,.22);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.meal-price {
  margin-left: auto;
  white-space: nowrap;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.12rem;
}

.meal-description {
  color: var(--text);
  font-size: .95rem;
  line-height: 1.55;
}

.meal-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255,119,0,.2);
  font-size: .9rem;
  color: #666;
}

/* ---------- Search ---------- */
.search-container {
  max-width: min(600px, 100%);
  margin: 18px auto 10px;
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
  overflow: hidden;
}

.search-container input {
  flex: 1;
  padding: 12px 16px;
  border: 0;
  outline: 0;
  font-size: 1rem;
  background: transparent;
  min-height: 44px;
}

.search-container i {
  color: var(--primary);
  font-size: 1.1rem;
  margin-inline: 14px;
}

/* ---------- ToTop ---------- */
#toTop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  z-index: 2147483647;
  transition: opacity .25s, transform .25s, background .2s;
}

#toTop:hover {
  background: var(--primary-dark);
}

#toTop i {
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 768px) {
  #toTop {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
  }
}

/* ---------- Footer ---------- */
footer {
  width: 100%;
  margin-inline: 0;
  color: #fff;
  background: linear-gradient(90deg, #222, #333);
  padding: 60px clamp(14px, 3vw, 20px) 40px;
  border-top-left-radius: var(--radius-xxl);
  border-top-right-radius: var(--radius-xxl);
  overflow: hidden;
}

@supports (width: 100dvw) {
  footer {
    width: 100dvw;
    margin-left: calc(50% - 50dvw);
    margin-right: calc(50% - 50dvw);
  }
}

@media (max-width: 768px) {
  footer {
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
  }
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  z-index: 2;
}

.footer-section {
  flex: 1 1 300px;
  padding: 0 8px;
  min-width: 260px;
}

.footer-section h3 {
  color: var(--primary);
  margin-bottom: 14px;
  font-size: 1.2rem;
  position: relative;
  padding-bottom: 8px;
}

.footer-section h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background: var(--primary);
}

.social-icons {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.social-icons a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255,255,255,.25);
  color: #fff;
  transition: background .25s, border-color .25s, transform .25s;
  text-decoration: none;
}

.social-icons a:hover,
.social-icons a:focus,
.social-icons a:active,
.social-icons a:visited {
  text-decoration: none;
}

.social-icons a:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px);
}

.social-icons a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.social-icons i {
  font-size: 18px;
  line-height: 1;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 16px;
  color: #aaa;
  font-size: .92rem;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
