/* NEXT delivery — soft rounded UI + 8px spacing */
:root {
  --brand: #ff6b00;
  --cream: #fff8f5;
  --dark: #1f2937;
  --badge-red: #e11d48;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 40px;
  --s6: 48px;
  --page-x: 16px;
  --header-h: 68px;
  /* radius scale — как на референсе NEXT */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 36px;
  --r-2xl: 40px;
  --r-pill: 999px;
}

.hidden { display: none !important; }

html, body {
  background: var(--cream);
}
.site-app {
  min-height: 100vh;
  background: var(--cream);
  font-family: Montserrat, system-ui, sans-serif;
}

.site-loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
}
.site-loader-inner { text-align: center; }
.site-loader p { margin-top: var(--s2); font-weight: 700; color: #6b7280; font-size: 14px; }
.spinner {
  width: 40px; height: 40px; margin: 0 auto;
  border: 3px solid #ffe0cc; border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.site-header {
  background: rgba(255, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #ff6b0014;
}
.site-header-inner {
  padding: var(--s2) var(--page-x);
  gap: var(--s2);
  min-height: var(--header-h);
}
.brand-mark {
  display: inline-flex; align-items: center;
  text-decoration: none; color: var(--dark);
  line-height: 0;
}
.brand-logo {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
@media (min-width: 640px) {
  .brand-logo { height: 44px; max-width: 200px; }
}

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 12px 20px 12px 16px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 20px #ff6b0033;
}
.cart-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.cart-btn .cart-label { display: none; }
@media (min-width: 480px) {
  .cart-btn .cart-label { display: inline; }
}
.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--badge-red);
  color: #fff;
  min-width: 20px;
  height: 20px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px #e11d4840;
}
.cart-btn.cart-bump {
  animation: cart-bump 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.cart-badge.badge-pop {
  animation: badge-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cart-bump {
  0% { transform: scale(1) rotate(0deg); }
  18% { transform: scale(1.12) rotate(-14deg); }
  36% { transform: scale(1.16) rotate(12deg); }
  54% { transform: scale(1.1) rotate(-8deg); }
  72% { transform: scale(1.06) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes badge-pop {
  0% { transform: scale(0.5); }
  40% { transform: scale(1.35); }
  70% { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.cart-sum { color: var(--brand); }
@media (prefers-reduced-motion: reduce) {
  .cart-btn.cart-bump,
  .cart-badge.badge-pop { animation: none; }
}

/* —— Hero as soft rounded card —— */
.hero-wrap {
  padding: var(--s2) var(--page-x) 0;
}
.hero {
  background: radial-gradient(ellipse at 30% 40%, #fb923c, var(--brand) 55%, #c2410c);
  color: #fff;
  overflow: hidden;
  border-radius: var(--r-2xl);
  box-shadow: 0 16px 40px #ff6b0028;
}
@media (min-width: 768px) {
  .hero { border-radius: 44px; }
}
.hero-inner {
  padding: var(--s4) var(--s3) var(--s5);
  gap: var(--s4);
}
@media (min-width: 768px) {
  .hero-inner {
    padding: var(--s5) var(--s5) var(--s6);
    gap: var(--s6);
  }
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hero-title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
}
.hero-title span { color: #ffedd5; }
@media (min-width: 768px) {
  .hero-title { font-size: 2.75rem; }
}
@media (min-width: 1024px) {
  .hero-title { font-size: 3.25rem; }
}
.hero-lead {
  margin: var(--s2) 0 0;
  max-width: 28rem;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
  color: #fff7ed;
  opacity: 0.95;
}
@media (min-width: 768px) {
  .hero-lead {
    margin-top: var(--s3);
    font-size: 16px;
  }
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--s4);
  padding: 14px 32px;
  background: #fff;
  color: var(--brand);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--r-pill);
  box-shadow: 0 8px 24px #00000026;
}
.hero-cta:hover { background: #fff7ed; }
@media (min-width: 768px) {
  .hero-cta { margin-top: var(--s5); padding: 16px 40px; }
}
.hero-media { margin-top: 0; }
.hero-burger {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-xl);
  border: 4px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 20px 40px #00000033;
  transform: rotate(3deg);
  transition: transform 0.45s ease;
}
.hero-burger:hover { transform: rotate(0deg); }
@media (min-width: 768px) {
  .hero-burger { border-radius: var(--r-2xl); }
}

/* —— Menu block —— */
.menu-page {
  padding: 0 var(--page-x) var(--s6);
}
.menu-head {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding-top: var(--s4);
  margin-bottom: var(--s3);
}
.menu-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--dark);
}
@media (min-width: 768px) {
  .menu-title { font-size: 1.875rem; }
  .menu-head {
    padding-top: var(--s5);
    margin-bottom: var(--s4);
    gap: var(--s3);
  }
}

.search-wrap { position: relative; max-width: 28rem; }
.search-wrap input {
  width: 100%;
  background: #fff;
  border: 1px solid #ffe0cc;
  border-radius: var(--r-pill);
  padding: 14px 20px;
  font-weight: 600;
  outline: none;
  box-shadow: 0 4px 16px #ff6b000c;
}
.search-wrap input:focus { border-color: var(--brand); }
.search-suggest {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid #ff6b0020; border-radius: var(--r-lg);
  max-height: 260px; overflow-y: auto;
  box-shadow: 0 16px 40px #1f29371a;
}
.search-suggest button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; border: none; background: none;
  padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 13px;
  border-bottom: 1px solid #ff6b0010; color: var(--dark);
}
.search-suggest button:hover { background: var(--cream); color: var(--brand); }
.search-suggest img, .search-suggest .ph {
  width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0;
  background: #fff1e8;
}
.search-suggest .meta { color: #9ca3af; font-size: 11px; font-weight: 700; }

/* Sticky category bar — soft pills + underline shelf */
.cat-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  background: rgba(255, 248, 245, 0.94);
  backdrop-filter: blur(12px);
  margin: 0 calc(var(--page-x) * -1);
  padding: var(--s2) var(--page-x) var(--s1);
  border-bottom: 1px solid #ff6b0012;
}
#category-buttons {
  gap: var(--s1);
  padding-bottom: var(--s1);
}
.cat-bar .category-btn {
  flex-shrink: 0;
  position: relative;
  padding: 10px 18px 12px;
  margin-bottom: 0;
  border: 1.5px solid #ffe0cc;
  border-radius: var(--r-pill);
  background: #fff !important;
  color: #6b7280;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 8px #ff6b0008 !important;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cat-bar .category-btn::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 3px;
  border-radius: var(--r-pill);
  background: transparent;
  transition: background 0.15s ease;
}
.cat-bar .category-btn.active-category {
  color: #fff !important;
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  font-weight: 800;
  box-shadow: 0 6px 16px #ff6b0033 !important;
}
.cat-bar .category-btn.active-category::after {
  background: #fff;
  opacity: 0.85;
}

.products-root {
  margin-top: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}
.load-sentinel {
  padding: var(--s4) 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
}

.section-head {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--dark);
  margin: 0 0 var(--s2);
}
@media (min-width: 768px) {
  .section-head { font-size: 1.35rem; margin-bottom: var(--s3); }
}

/* Soft product list cards */
.products-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  background: transparent;
  border-radius: 0;
  overflow: visible;
  border: none;
}
@media (min-width: 900px) {
  .products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s2);
  }
}

.food-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--s2);
  padding: var(--s2);
  background: #fff;
  border: 1px solid #ff6b0012;
  border-radius: var(--r-lg);
  box-shadow: 0 6px 20px #ff6b000a;
  min-height: 0;
  align-items: start;
}
@media (min-width: 640px) {
  .food-card {
    grid-template-columns: 112px 1fr;
    gap: var(--s2);
    padding: var(--s3);
    border-radius: var(--r-xl);
  }
}

.food-card .media {
  width: 88px;
  height: 88px;
  border-radius: var(--r-md);
  background: #fff1e8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  flex-shrink: 0;
  border: none;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}
@media (min-width: 640px) {
  .food-card .media {
    width: 112px;
    height: 112px;
    border-radius: var(--r-lg);
  }
}
.food-card .media img {
  width: 100%; height: 100%; object-fit: cover;
}
.food-card .media .ph {
  width: 52px; height: 52px; opacity: 0.9;
  pointer-events: none;
}
.food-card .media.no-zoom { cursor: default; }

.food-card .body {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  min-width: 0;
  padding-top: 0;
}
.food-card h3 {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.3;
  color: var(--dark);
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
@media (min-width: 640px) {
  .food-card h3 { font-size: 15px; }
}
.food-card .desc {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.food-card .footer-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s2);
  margin-top: auto;
  padding-top: var(--s1);
}
.food-card .price-wrap {
  text-align: left;
  min-width: 0;
}
.food-card .price {
  font-weight: 900;
  color: var(--brand);
  font-size: 16px;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.food-card .meta-pill {
  display: inline-block;
  margin-left: var(--s1);
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  vertical-align: middle;
}
.food-card .actions {
  flex-shrink: 0;
}
.food-card .add-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  border: none;
  background: #fff1e8;
  color: var(--brand);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.food-card .add-btn:hover { background: #ffe0cc; }
.food-card .qty {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  background: #fff8f5;
  border-radius: var(--r-pill);
  padding: 4px 8px;
}
.food-card .qty span {
  color: var(--brand);
  min-width: 1ch;
  text-align: center;
}
.food-card .qty button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s2);
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: #0f172acc;
  backdrop-filter: blur(4px);
}
.lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 560px);
  max-height: 88vh;
  background: #fff;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: 0 24px 64px #0006;
}
.lightbox-panel img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #111;
}
.lightbox-caption {
  padding: var(--s2) var(--s3);
  font-weight: 800;
  font-size: 14px;
  color: var(--dark);
}
.lightbox-close {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--r-pill);
  background: #ffffffd9;
  font-weight: 900;
  cursor: pointer;
}

.cart-drawer { position: fixed; inset: 0; z-index: 60; }
.cart-backdrop { position: absolute; inset: 0; background: #1f293780; }
.cart-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(100%, 400px);
  background: #fff;
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px #00000022;
  border-radius: var(--r-xl) 0 0 var(--r-xl);
}
.cart-line { display: flex; gap: var(--s2); align-items: center; }
.cart-line img, .cart-line .ph {
  width: 52px; height: 52px; border-radius: var(--r-md); object-fit: cover; background: #fff1e8;
}
.cart-line .ph { display: flex; align-items: center; justify-content: center; }
.cart-line .ph svg { width: 28px; height: 28px; }

.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal { align-items: center; padding: var(--s2); } }
.modal-backdrop { position: absolute; inset: 0; background: #1f293780; }
.modal-panel {
  position: relative; z-index: 1; width: min(100%, 440px);
  background: #fff; border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: var(--s3); max-height: 92vh; overflow-y: auto;
}
@media (min-width: 640px) {
  .modal-panel { border-radius: var(--r-2xl); }
}
.field {
  width: 100%; padding: 14px 18px; border-radius: var(--r-md);
  border: 1px solid #ffe0cc; background: var(--cream); font-weight: 600; outline: none;
}
.field:focus { border-color: var(--brand); }
.chip {
  border: 1.5px solid #ffe0cc; background: #fff; color: var(--brand);
  border-radius: var(--r-pill); padding: 10px 18px; font-weight: 800; font-size: 12px; cursor: pointer;
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

#btn-checkout {
  border-radius: var(--r-pill) !important;
  padding-top: 16px !important;
  padding-bottom: 16px !important;
  box-shadow: 0 8px 20px #ff6b0033;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.account-menu {
  position: relative;
}
.account-menu.hidden {
  display: none !important;
}
.account-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid #ff6b0033;
  background: #fff;
  color: var(--dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.account-btn svg {
  width: 20px;
  height: 20px;
}
.account-btn[aria-expanded="true"] {
  border-color: var(--brand);
  color: var(--brand);
  background: #fff8f5;
}
.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #ff6b0018;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(28, 25, 23, 0.12);
  padding: 10px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.account-dropdown.hidden {
  display: none !important;
}
.account-dropdown-name {
  font-weight: 900;
  font-size: 14px;
  color: var(--dark);
  padding: 10px 12px 8px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu-item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 12px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  color: var(--brand);
  cursor: pointer;
}
.account-menu-item:hover,
.account-menu-item:active {
  background: #fff8f5;
}
.account-menu-item.muted {
  color: #9ca3af;
  font-weight: 700;
  font-size: 13px;
}

.sms-panel {
  text-align: center;
  padding: 22px 20px 24px !important;
}
.sms-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}
.sms-close {
  border: none;
  background: none;
  color: #9ca3af;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}
.sms-hint {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
  margin: 0 0 18px;
  line-height: 1.4;
}
.sms-otp-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
}
.sms-boxes {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 8px;
}
.sms-digit {
  width: 52px;
  height: 56px;
  border-radius: 14px;
  border: 2px solid #ffe0cc;
  background: #fff8f5;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--dark);
  outline: none;
}
.sms-digit:focus { border-color: var(--brand); }
.sms-error {
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0 0;
  min-height: 0;
}
.sms-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}
.sms-btn-primary {
  width: 100%;
  border: none;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 14px 16px;
  cursor: pointer;
}
.sms-btn-secondary {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--brand);
  font-weight: 800;
  font-size: 14px;
  padding: 10px 8px;
  cursor: pointer;
}

.orders-panel { max-height: 85vh; overflow-y: auto; }
.orders-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  background: #f3f4f6;
  border-radius: 999px;
}
.orders-tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #6b7280;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 12px;
  cursor: pointer;
}
.orders-tab.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.orders-empty {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #9ca3af;
  padding: 28px 12px;
  line-height: 1.5;
}
.orders-tab-link {
  margin-top: 10px;
  border: none;
  background: transparent;
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.order-card {
  border: 1px solid #ff6b0018;
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  text-align: left;
}
.order-card.is-active {
  border-color: #ff6b0044;
  background: linear-gradient(180deg, #fff8f5 0%, #fff 48%);
  box-shadow: 0 8px 24px rgba(255, 107, 0, 0.1);
}
.order-card.is-closed {
  border-color: #e5e7eb;
  background: #fafafa;
}
.order-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.order-card h4 { margin: 0; font-weight: 900; font-size: 14px; }
.order-live-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #15803d;
  background: #dcfce7;
  border-radius: 999px;
  padding: 4px 10px;
}
.order-live-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
  animation: order-live-pulse 1.4s ease infinite;
}
@keyframes order-live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.7; }
}
.order-closed-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 4px 10px;
}
.order-closed-badge.is-cancelled {
  color: #b91c1c;
  background: #fef2f2;
}
.order-history-toggle {
  margin-top: 10px;
  width: 100%;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  font-weight: 800;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.order-history-details.hidden {
  display: none !important;
}
.order-history-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}
.order-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff1e8;
  color: var(--brand);
  margin-bottom: 8px;
}
.order-status.paid { background: #dcfce7; color: #15803d; }
.order-status.closed { background: #f3f4f6; color: #6b7280; }
.order-items { font-size: 12px; color: #4b5563; font-weight: 600; line-height: 1.45; }
.order-total { margin-top: 8px; font-weight: 900; color: var(--brand); }

.order-stages {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin-top: 14px;
  padding: 4px 2px 0;
  position: relative;
}
.order-stages::before,
.order-stages::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 11px;
  height: 3px;
  border-radius: 999px;
  z-index: 0;
}
.order-stages::before {
  background: #e5e7eb;
}
.order-stages::after {
  right: auto;
  width: 0;
  max-width: 76%;
  background: #16a34a;
  transition: width 0.25s ease;
}
.order-stages[data-stage-idx="1"]::after { width: calc(76% * 1 / 3); }
.order-stages[data-stage-idx="2"]::after { width: calc(76% * 2 / 3); }
.order-stages[data-stage-idx="3"]::after { width: 76%; }
.order-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.order-stage-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #d1d5db;
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.order-stage-label {
  font-size: 10px;
  font-weight: 800;
  color: #9ca3af;
  text-align: center;
  line-height: 1.2;
}
.order-stage.is-done .order-stage-dot {
  background: #16a34a;
  border-color: #16a34a;
}
.order-stage.is-done .order-stage-label {
  color: #15803d;
}
.order-stage.is-current .order-stage-dot {
  background: #16a34a;
  border-color: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
}
.order-stage.is-current .order-stage-label {
  color: #166534;
}
.order-stages.is-cancelled::before {
  background: #fecaca;
}
.order-stages-cancelled {
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 12px;
  padding: 10px 12px;
}
.order-stage-hint {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-align: center;
}

.order-track-btn {
  margin-top: 12px;
  width: 100%;
  border: 1.5px solid #ff6b0033;
  background: #fff8f5;
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.order-finished {
  margin-top: 12px;
  width: 100%;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #6b7280;
}
.order-finished.done {
  background: #ecfdf5;
  color: #15803d;
}
.order-finished.cancelled {
  background: #fef2f2;
  color: #b91c1c;
}
.order-finished.muted {
  background: #f9fafb;
  color: #9ca3af;
}
.order-status.cancelled {
  background: #fef2f2;
  color: #b91c1c;
}
.order-track-wrap {
  margin-top: 12px;
}
.order-track-status {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  margin: 0 0 8px;
  line-height: 1.35;
}
.order-track-status.is-error {
  color: #b91c1c;
}
.order-track-map {
  width: 100%;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #ff6b0014;
}

/* —— Checkout / Dodo-style address —— */
.checkout-panel {
  width: min(100%, 480px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 96vh;
}
.checkout-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}
.checkout-footer-fields {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding-top: 8px;
}
.checkout-submit {
  border-radius: 16px !important;
  padding-top: 16px !important;
  padding-bottom: 16px !important;
  box-shadow: 0 8px 20px #ff6b0033;
}
#checkout-modal.checkout-delivery .checkout-panel,
#checkout-modal.checkout-pickup .checkout-panel {
  width: 100%;
  max-width: 100%;
  max-height: 100vh;
  border-radius: 0;
}
@media (min-width: 640px) {
  #checkout-modal.checkout-delivery,
  #checkout-modal.checkout-pickup {
    align-items: stretch;
    padding: 0;
  }
  #checkout-modal.checkout-delivery .checkout-panel,
  #checkout-modal.checkout-pickup .checkout-panel {
    width: min(100%, 520px);
    margin: 0 auto;
    border-radius: var(--r-2xl);
    max-height: 96vh;
  }
}

.dodo-stage {
  position: relative;
  flex-shrink: 0;
}
.dodo-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.dodo-top > * {
  pointer-events: auto;
}
.dodo-close-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.dodo-mode-toggle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background: #fff;
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
  max-width: calc(100% - 108px);
}
.dodo-mode-btn {
  min-width: 0;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #1f2937;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.dodo-mode-btn.active {
  background: #ff6900;
  color: #fff;
}
.checkout-pickup .dodo-stage {
  min-height: 64px;
  background: #fff;
}
.checkout-pickup .dodo-top {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
}
.checkout-pickup .address-block,
.checkout-pickup #address-details {
  display: none !important;
}

.address-block {
  display: flex;
  flex-direction: column;
}
.address-block.hidden {
  display: none !important;
}

.dodo-map-wrap {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  background: #e5e7eb;
}
.dodo-map-wrap #yandex-map {
  width: 100%;
  height: clamp(240px, 46vh, 380px);
  touch-action: none;
}
.dodo-map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 60px;
  transform: translate(-50%, calc(-100% + 8px));
  pointer-events: none;
  z-index: 4;
}
.dodo-pin-body {
  display: block;
  position: relative;
  z-index: 1;
  transform-origin: 50% 100%;
  transition: transform 0.18s ease;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}
.dodo-pin-shadow {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 18px;
  height: 7px;
  border-radius: 50%;
  background: rgba(31, 41, 55, 0.28);
  transform: translateX(-50%);
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.dodo-map-pin.is-dragging .dodo-pin-body {
  transform: translateY(-14px);
}
.dodo-map-pin.is-dragging .dodo-pin-shadow {
  transform: translateX(-50%) scale(0.65);
  opacity: 0.45;
}
.dodo-geo-btn {
  position: absolute;
  right: 14px;
  bottom: 22px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dodo-geo-btn:active {
  background: #f9fafb;
}

.dodo-address-sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  margin-top: -18px;
  position: relative;
  z-index: 6;
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checkout-pickup .dodo-address-sheet {
  margin-top: 0;
  border-radius: 0;
}
.dodo-address-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dodo-address-title {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  color: var(--dark);
}
.dodo-address-sub {
  margin: -4px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
  line-height: 1.35;
}
.dodo-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #f3f4f6;
  border-radius: 16px;
  padding: 8px 16px 10px;
  cursor: text;
}
.dodo-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  line-height: 1.3;
}
.dodo-field input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-weight: 700;
  font-size: 15px;
  color: #1f2937;
  padding: 0;
  min-height: 22px;
}
.dodo-field input::placeholder {
  color: #d1d5db;
  font-weight: 600;
}
.dodo-phone-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dodo-phone-prefix {
  font-weight: 800;
  font-size: 15px;
  color: #1f2937;
  flex-shrink: 0;
}
.dodo-address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* —— Yandex map / address (checkout) —— */
.field-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding-left: 4px;
}
.checkout-suggest-wrap {
  position: relative;
  z-index: 40;
}
.address-search-box {
  position: relative;
}
.address-search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.address-search-row .field {
  flex: 1;
  min-width: 0;
}
.geo-me-btn {
  flex-shrink: 0;
  width: 48px;
  border: 1.5px solid #ffe0cc;
  border-radius: var(--r-md);
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.geo-me-btn:active { background: #fff1e8; }
.dodo-field:has(#order-street.geocoding) {
  background-image: linear-gradient(90deg, #f3f4f6 0%, #ffe8d6 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: geocode-pulse 1s ease infinite;
}
@keyframes geocode-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.deliv-map-hint {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  margin: 0;
  min-height: 0;
}
.deliv-map-hint.hidden:empty {
  display: none;
}
.deliv-zone-hint {
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 12px;
  min-height: 0;
  margin: 0;
}
.deliv-zone-hint.zone-free {
  color: #15803d;
  background: rgba(22, 163, 74, 0.12);
}
.deliv-zone-hint.zone-paid {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
}
.deliv-zone-hint:empty,
.deliv-eta-hint:empty {
  display: none;
}
.deliv-eta-hint {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 107, 0, 0.08);
  min-height: 0;
  margin: 0;
}

#address-suggest-list {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 200;
  max-height: min(40vh, 260px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid rgba(255, 107, 0, 0.25);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.14);
}
#address-suggest-list.open { display: block; }
.deliv-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 107, 0, 0.08);
  min-height: 48px;
}
.deliv-suggest-item:hover,
.deliv-suggest-item:focus {
  background: #fff8f5;
  color: #ff6b00;
  outline: none;
}
.deliv-suggest-item:last-child { border-bottom: none; }
.deliv-suggest-empty {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
}
.deliv-suggest-title {
  padding: 10px 16px 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

#yandex-map-wrap.dodo-map-wrap {
  border: none;
  border-radius: 0;
  overflow: hidden;
}

[class*="ymaps"][class*="suggest"],
ymaps[class*="suggest"] {
  z-index: 100000 !important;
}

.modal-panel {
  overscroll-behavior: contain;
}
