/* ===== VARIABLES ===== */
:root {
  --white:     #ffffff;
  --bg:        #f4f4f4;
  --bg2:       #ebebeb;
  --border:    #e0ddd9;
  --text:      #1a1a1a;
  --text2:     #6b6560;
  --accent:    #b1805b;
  --accent-d:  #9a6b48;
  --dark:      #0c2d3f;
  --dark2:     #1a4a5c;
  --font:      'Onest', -apple-system, sans-serif;
  --font-head: 'Unbounded', sans-serif;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 8px 32px rgba(0,0,0,.12);
  --header-h:  68px;
  --tabs-h:    50px;
  --cats-h:    50px;
  --container: 1320px;
}

/* ===== RESET ===== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:var(--font);background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}
a{text-decoration:none;color:inherit}
button{cursor:pointer;border:none;background:none;font-family:inherit}
img{display:block}

/* ===== LOADER ===== */
.page-loader{position:fixed;inset:0;background:var(--white);z-index:9999;display:flex;align-items:center;justify-content:center;transition:opacity .4s,visibility .4s}
.page-loader.hidden{opacity:0;visibility:hidden}
.loader-spinner{width:36px;height:36px;border-radius:50%;border:3px solid var(--border);border-top-color:var(--accent);animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ===== HEADER ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  height: var(--header-h);
  background: rgba(12,45,63,.18);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: background .3s, box-shadow .3s, border-color .3s;
}
.site-header.scrolled {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
  border-bottom-color: rgba(0,0,0,.06);
}
/* inner wrapper aligns to container — same as menu below */
.header-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 32px; height: 100%;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.header-left  { display: flex; align-items: center; }
.header-center { display: flex; align-items: center; justify-content: center; }
.header-right { display: flex; align-items: center; justify-content: flex-end; }

/* Logo in header */
.header-logo {
  height: 44px; width: auto; max-width: 180px;
  object-fit: contain; display: block;
  filter: brightness(0) invert(1);
  transition: filter .3s;
}
.site-header.scrolled .header-logo { filter: none; }
.header-title {
  font-family: var(--font-head); font-size: 22px; font-weight: 700;
  color: #fff; transition: color .3s; white-space: nowrap;
}
.site-header.scrolled .header-title { color: var(--dark); }

/* Lang switcher */
.lang-switcher { position: relative; }
.lang-current {
  display: flex; align-items: center; gap: 7px;
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 8px 14px; border-radius: 40px;
  border: 1.5px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.08);
  transition: background .2s, border-color .2s;
  white-space: nowrap;
}
.lang-current:hover { background: rgba(255,255,255,.18); }
.lang-current svg { width: 16px; height: 16px; flex-shrink: 0; }
.lang-chevron { width: 13px !important; height: 13px !important; transition: transform .2s; opacity: .7; }
.lang-switcher.open .lang-chevron { transform: rotate(180deg); }
.site-header.scrolled .lang-current { color: var(--text); border-color: var(--border); background: transparent; }
.site-header.scrolled .lang-current:hover { background: var(--bg2); }

.lang-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 500;
  background: var(--white); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.06);
  padding: 6px; min-width: 160px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.lang-switcher.open .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-opt {
  display: block; width: 100%; text-align: left;
  padding: 9px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text2);
  transition: .15s;
}
.lang-opt:hover { background: var(--bg); color: var(--text); }
.lang-opt.active { color: var(--accent); background: rgba(177,128,91,.08); }

/* Cart button in header */
.header-cart-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--accent); color: #fff;
  padding: 12px 24px; border-radius: 40px;
  font-size: 14px; font-weight: 700; border: none;
  box-shadow: 0 4px 16px rgba(177,128,91,.4);
  transition: background .2s, transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.header-cart-btn:hover { background: var(--accent-d); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(177,128,91,.5); }
.header-cart-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.hcart-count {
  background: rgba(255,255,255,.3); border-radius: 10px;
  padding: 2px 8px; font-size: 12px; font-weight: 700;
  display: none;
}
.hcart-count.visible { display: inline-block; }
.hcart-total { font-size: 14px; font-weight: 700; }

/* No-hero: header over white page */
body:not(.has-hero) .site-header {
  background: rgba(255,255,255,.82);
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
  border-bottom-color: rgba(0,0,0,.06);
}
body:not(.has-hero) .header-logo { filter: none; }
body:not(.has-hero) .header-title { color: var(--dark); }
body:not(.has-hero) .lang-current { color: var(--text); border-color: var(--border); background: transparent; }

/* ===== HERO ===== */
.hero-section {
  width: 100%; min-height: 580px; position: relative; overflow: hidden;
  display: flex; align-items: center;
  background-image: var(--hero-bg, none);
  background-size: cover; background-position: center;
  background-color: var(--dark);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.72) 0%, rgba(0,0,0,.48) 55%, rgba(0,0,0,.12) 100%);
}
.hero-inner {
  position: relative; z-index: 2; width: 100%;
  max-width: var(--container); margin: 0 auto; padding: 0 32px;
  padding-top: var(--header-h);
}
.hero-content {
  max-width: 560px;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 60px 0;
  color: #fff;
}
.hero-title {
  font-family: var(--font-head); font-size: clamp(22px, 3vw, 44px);
  font-weight: 800; line-height: 1.15; margin-bottom: 16px;
  text-shadow: 0 2px 16px rgba(0,0,0,.3);
  letter-spacing: -0.5px;
}
.hero-subtitle {
  font-size: 16px; color: rgba(255,255,255,.8);
  line-height: 1.6; margin-bottom: 36px;
}
.hero-menu-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--white); color: var(--dark);
  padding: 14px 28px; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  transition: .2s; box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.hero-menu-btn:hover { background: var(--bg); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.hero-menu-btn svg { width: 18px; height: 18px; }

/* ===== SECTION TABS ===== */
.section-tabs-wrap {
  position: sticky; top: var(--header-h); z-index: 200;
  background: var(--white); border-bottom: 1px solid var(--border);
}
.has-hero .section-tabs-wrap { margin-top: 0; }
body:not(.has-hero) .section-tabs-wrap { margin-top: var(--header-h); }
.section-tabs-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 32px;
}
.section-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.section-tabs::-webkit-scrollbar { display: none; }
.section-tab {
  flex-shrink: 0; padding: 14px 22px;
  font-size: 14px; font-weight: 600; color: var(--text2); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: .2s; cursor: pointer; background: none;
  border-left: none; border-right: none; border-top: none;
}
.section-tab:hover { color: var(--text); }
.section-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== CATEGORY BAR ===== */
.category-bar-wrap {
  position: sticky; top: calc(var(--header-h) + var(--tabs-h)); z-index: 199;
  background: var(--white); border-bottom: 1px solid var(--border);
}
.category-bar-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 32px;
}
.category-bar { display: flex; overflow-x: auto; scrollbar-width: none; padding: 10px 0; gap: 8px; }
.category-bar::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0; padding: 7px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--bg2); color: var(--text2);
  border: 1.5px solid transparent; cursor: pointer; transition: .2s;
}
.cat-pill:hover { background: var(--border); color: var(--text); }
.cat-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== MENU CONTAINER ===== */
.menu-container-wrap {
  max-width: var(--container); margin: 0 auto; padding: 28px 32px 60px;
}

/* ===== CATEGORY GROUP ===== */
.category-group { margin-bottom: 44px; }
.category-heading { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 20px; }

/* ===== DISH GRID ===== */
.dish-list { display: grid; grid-template-columns: repeat(5,1fr); gap: 16px; }

/* ===== DISH CARD ===== */
.dish-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.dish-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dish-img-wrap { aspect-ratio: 1/1; overflow: hidden; background: var(--bg); flex-shrink: 0; }
.dish-img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.dish-card:hover .dish-img { transform: scale(1.06); }
.dish-placeholder { width:100%; height:100%; display:flex; align-items:center; justify-content:center; background:var(--bg2); }
.dish-placeholder svg { width:36px; height:36px; color:var(--border); }
.dish-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.dish-price { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.dish-name { font-size: 13px; font-weight: 500; color: var(--text2); line-height: 1.4; flex: 1; margin-bottom: 12px; }
.dish-footer { margin-top: auto; }
.add-btn {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--bg2); color: var(--text); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: .2s; border: 1.5px solid var(--border);
}
.add-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.add-btn svg { width: 14px; height: 14px; }
.dish-qty {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.qty-btn {
  flex: 1; padding: 8px 0; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2); color: var(--text); transition: .15s; line-height: 1;
}
.qty-btn:hover { background: var(--accent); color: #fff; }
.qty-val { flex: 1; text-align: center; font-size: 14px; font-weight: 700; padding: 8px 4px; }

/* ===== EMPTY STATE ===== */
.empty-state { padding: 60px 24px; text-align: center; color: var(--text2); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: .25; }
.empty-state p { font-size: 15px; }

/* ===== CART MODAL ===== */
.cart-modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.cart-modal-overlay.open { opacity: 1; visibility: visible; }

/* Desktop: centered iOS-style sheet */
.cart-modal {
  position: fixed; top: 50%; left: 50%; z-index: 410;
  width: 440px; max-width: calc(100vw - 32px);
  max-height: 82vh;
  background: var(--white); border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.06);
  display: flex; flex-direction: column;
  transform: translate(-50%, calc(-50% + 28px));
  opacity: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .25s;
}
.cart-modal.open {
  transform: translate(-50%, -50%);
  opacity: 1;
}

.cart-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  background: var(--dark); color: #fff; flex-shrink: 0;
}
.cart-modal-header h3 { font-size: 17px; font-weight: 700; }
.cart-modal-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  display: flex; align-items: center; justify-content: center; transition: .2s;
}
.cart-modal-close:hover { background: rgba(255,255,255,.25); }
.cart-modal-close svg { width: 16px; height: 16px; }
.cart-modal-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.cart-modal-footer { border-top: 1px solid var(--border); padding: 16px 20px; background: var(--bg); flex-shrink: 0; }

/* Cart items (used in modal + mobile drawer) */
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; transition: .15s; }
.cart-item:hover { background: var(--bg); }
.cart-item-img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg2); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.cart-item-price { font-size: 12px; color: var(--text2); margin-top: 3px; }
.cart-item-qty { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cqty-btn {
  width: 26px; height: 26px; border-radius: 50%; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2); color: var(--text); transition: .15s; line-height: 1;
}
.cqty-btn:hover { background: var(--accent); color: #fff; }
.cqty-val { font-size: 13px; font-weight: 700; min-width: 18px; text-align: center; }

.cart-empty {
  padding: 48px 24px; text-align: center; color: var(--text2);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.cart-empty svg { width: 36px; height: 36px; opacity: .25; }
.cart-empty p { font-size: 14px; }

.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.cart-total-val { font-size: 18px; color: var(--accent); font-weight: 800; }
.btn-order { width: 100%; padding: 13px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; transition: .2s; }
.btn-order:hover { background: var(--accent-d); }
.btn-clear { width: 100%; padding: 8px; font-size: 12px; color: var(--text2); text-align: center; margin-top: 6px; }
.btn-clear:hover { color: var(--text); }

/* ===== MOBILE FAB ===== */
.cart-fab {
  display: none; position: fixed; bottom: 20px; left: 0; right: 0; margin: 0 auto;
  width: fit-content; z-index: 150;
  background: var(--accent); color: #fff; border-radius: 40px; padding: 13px 22px;
  align-items: center; gap: 8px; box-shadow: 0 6px 24px rgba(177,128,91,.45);
  font-size: 14px; font-weight: 700; white-space: nowrap;
  transition: opacity .2s, bottom .2s;
}
.cart-fab:hover { background: var(--accent-d); }
.cart-fab.hidden { opacity: 0; pointer-events: none; bottom: 8px; }
.fab-icon svg { width: 17px; height: 17px; }
.fab-count { background: rgba(255,255,255,.3); border-radius: 10px; padding: 1px 7px; font-size: 11px; }

/* ===== MOBILE DRAWER (cart) ===== */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 400; opacity: 0; visibility: hidden; transition: .3s; }
.drawer-overlay.open { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 410;
  background: var(--white); border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.15);
  transform: translateY(100%); transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; max-height: 80vh;
}
.cart-drawer.open { transform: translateY(0); }
.drawer-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 12px auto 0; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.drawer-title { font-size: 17px; font-weight: 700; color: var(--dark); }
.drawer-close { width: 32px; height: 32px; border-radius: 50%; background: var(--bg2); display: flex; align-items: center; justify-content: center; }
.drawer-close svg { width: 14px; height: 14px; }
.drawer-body { flex: 1; overflow-y: auto; }
.drawer-footer { padding: 14px 16px; border-top: 1px solid var(--border); background: var(--bg); }

/* ===== ORDER SCREEN ===== */
.order-screen { position: fixed; inset: 0; z-index: 500; background: var(--white); display: none; flex-direction: column; overflow-y: auto; }
.order-screen.open { display: flex; }
.order-header { background: var(--dark); color: #fff; text-align: center; padding: 48px 24px 32px; }
.order-header h2 { font-family: var(--font-head); font-size: 24px; margin: 12px 0 8px; }
.order-header p { font-size: 14px; opacity: .7; }
.order-body { flex: 1; padding: 24px 20px; max-width: 520px; margin: 0 auto; width: 100%; }
.order-body-title { font-family: var(--font-head); color: var(--dark); font-size: 20px; margin-bottom: 16px; }
.order-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.order-item-name { font-weight: 500; }
.order-item-right { text-align: right; flex-shrink: 0; padding-left: 16px; }
.order-item-qty { font-size: 12px; color: var(--text2); }
.order-item-price { font-weight: 700; }
.order-total-block { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; font-size: 16px; font-weight: 700; }
.order-total-value { font-size: 24px; color: var(--accent); font-weight: 800; }
.order-footer { padding: 20px; text-align: center; border-top: 1px solid var(--border); }
.order-note { font-size: 14px; color: var(--text2); margin-bottom: 16px; line-height: 1.6; }
.btn-dark { padding: 14px 32px; background: var(--dark); color: #fff; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700; transition: .2s; }
.btn-dark:hover { background: var(--dark2); }

/* ===== TOAST (скрыт) ===== */
.toast { display: none; }

/* Pop-анимация при добавлении в корзину */
@keyframes cart-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.cart-pop { animation: cart-pop .4s cubic-bezier(.36,.07,.19,.97); }

/* ===== RESPONSIVE ===== */
@media (min-width: 1200px) { .dish-list { grid-template-columns: repeat(5,1fr); } }
@media (max-width: 1199px) and (min-width: 900px) { .dish-list { grid-template-columns: repeat(4,1fr); } }
@media (max-width: 899px) and (min-width: 640px) { .dish-list { grid-template-columns: repeat(3,1fr); } }

@media (max-width: 767px) {
  /* Bottom sheet on mobile */
  .cart-modal {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: 100%; max-height: 85vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%); opacity: 1;
  }
  .cart-modal.open { transform: translateY(0); opacity: 1; }
  .header-inner { padding: 0 16px; }
  .hero-inner { padding: 0 20px; }
  .hero-content { padding: 48px 0; }
  .hero-title { font-size: 26px; }
  .hero-section { min-height: 420px; }
  .section-tabs-inner, .category-bar-inner, .menu-container-wrap { padding: 0 16px; }
  .menu-container-wrap { padding: 20px 16px 48px; }
  .dish-list { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .cart-fab { display: flex; }
  .header-cart-btn { display: none; }
}
@media (max-width: 479px) {
  .dish-list { gap: 8px; }
  .dish-body { padding: 10px 10px 12px; }
  .dish-price { font-size: 14px; }
  .dish-name { font-size: 12px; }
}
@media (min-width: 768px) {
  .cart-fab { display: none !important; }
  .drawer-overlay, .cart-drawer { display: none !important; }
}
