:root{
  --bg:#f6f2ea;
  --surface:#fffdf8;
  --surface-2:#efe6d8;
  --ink:#171b1d;
  --muted:#667174;
  --line:#d8cdbd;
  --line-strong:#bcae9b;
  --red:#a83238;
  --red-dark:#7d2429;
  --teal:#1e6f74;
  --teal-soft:#dceeed;
  --mustard:#d2a43d;
  --green:#4f7d45;
  --shadow:0 18px 54px rgba(25,30,31,.12);
  --radius:8px;
  --max:1440px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  line-height:1.45;
}
body.delivery-page{min-height:100vh}
a{color:inherit;text-decoration:none}
button,input,textarea{font:inherit}
button{cursor:pointer}
img{display:block;max-width:100%}
[hidden]{display:none!important}

.delivery-app{
  width:min(var(--max),calc(100% - 28px));
  margin:18px auto 38px;
  display:grid;
  grid-template-columns:260px minmax(0,1fr) 360px;
  gap:14px;
  align-items:start;
}
.restaurant-panel,.cart-panel{
  position:sticky;
  top:86px;
  display:grid;
  gap:12px;
}
.restaurant-card,.mode-panel,.category-panel,.cart-card,.checkout-form,.reserve-card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:0 10px 28px rgba(25,30,31,.06);
}
.restaurant-card{padding:18px}
.restaurant-logo{
  width:152px;
  max-height:108px;
  object-fit:contain;
  margin:0 auto 18px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#f3eadc;
}
.panel-label{
  margin:0 0 8px;
  color:var(--red);
  text-transform:uppercase;
  font-size:11px;
  line-height:1.2;
  font-weight:900;
}
.restaurant-card h1,.workspace-head h2,.cart-head h2{
  margin:0;
  font-size:27px;
  line-height:1.06;
  font-weight:950;
}
.restaurant-address{margin:8px 0 16px;color:var(--muted);font-weight:700}
.network-card h1{margin:0;font-size:27px;line-height:1.06}
.restaurant-list{display:grid;gap:8px;margin-top:14px}
.restaurant-switch{
  display:grid;
  grid-template-columns:54px 1fr;
  gap:10px;
  align-items:center;
  width:100%;
  min-height:70px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:8px;
  background:#fffaf1;
  color:var(--ink);
  text-align:left;
}
.restaurant-switch img{
  width:54px;
  height:54px;
  object-fit:contain;
  border-radius:6px;
  background:#f2eadf;
  padding:7px;
}
.restaurant-switch strong{display:block;line-height:1.12}
.restaurant-switch small{display:block;margin-top:4px;color:var(--muted);font-size:12px;font-weight:850}
.restaurant-switch.is-active{border-color:var(--red);background:#fff7f2}
.restaurant-switch.is-active small{color:var(--red-dark)}
.restaurant-facts{margin:0;display:grid;gap:8px}
.restaurant-facts div{
  display:flex;
  justify-content:space-between;
  gap:14px;
  padding:10px 0;
  border-top:1px solid var(--line);
}
.restaurant-facts dt{color:var(--muted);font-size:12px;font-weight:800}
.restaurant-facts dd{margin:0;font-size:12px;font-weight:950;color:var(--ink)}
.mode-panel,.category-panel{padding:14px}

.segmented-control{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  padding:4px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#f2ecdf;
}
.segmented-control button{
  min-height:40px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--muted);
  font-weight:950;
}
.segmented-control button.is-active{
  background:var(--ink);
  color:#fff;
  box-shadow:0 8px 18px rgba(0,0,0,.12);
}
.segmented-control button:disabled{
  cursor:not-allowed;
  opacity:.46;
}
.mode-panel-wide{
  margin:0;
  border-radius:0;
  border-width:0 0 1px;
  box-shadow:none;
}
.muted-note{
  min-height:40px;
  display:grid;
  place-items:center start;
  color:var(--muted);
  font-size:13px;
  font-weight:850;
}

.category-list{display:grid;gap:6px}
.category-list button{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  min-height:42px;
  border:1px solid transparent;
  border-radius:var(--radius);
  background:#f7f1e7;
  padding:9px 10px;
  color:var(--ink);
  font-weight:900;
  text-align:left;
}
.category-list button span{
  color:var(--muted);
  font-size:12px;
  font-weight:900;
}
.category-list button.is-active{
  border-color:var(--red);
  color:var(--red-dark);
  background:#fff7f2;
}
.menu-workspace{
  min-width:0;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:rgba(255,253,248,.72);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.workspace-head{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,360px);
  gap:18px;
  align-items:end;
  padding:20px;
  background:
    linear-gradient(90deg,rgba(168,50,56,.10),transparent 44%),
    linear-gradient(135deg,#fffdf8,#f1e5d4);
  border-bottom:1px solid var(--line);
}
.workspace-head h2{
  max-width:680px;
  font-size:34px;
}
.delivery-workspace-head{align-items:center}
.restaurant-hero{
  display:grid;
  grid-template-columns:112px minmax(0,1fr);
  gap:18px;
  align-items:center;
  min-width:0;
}
.restaurant-hero-logo{
  width:112px;
  height:86px;
  object-fit:contain;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:10px;
  background:#fffaf1;
}
.restaurant-hero p:not(.panel-label){
  max-width:680px;
  margin:8px 0 0;
  color:var(--muted);
  font-weight:750;
}
.restaurant-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.restaurant-actions a{
  min-height:34px;
  display:inline-flex;
  align-items:center;
  border:1px solid var(--line-strong);
  border-radius:var(--radius);
  padding:0 10px;
  background:rgba(255,255,255,.58);
  color:var(--ink);
  font-size:13px;
  font-weight:950;
}
.restaurant-actions a:hover{border-color:var(--red);color:var(--red-dark)}
.search-box{display:grid;gap:7px;font-weight:900;color:var(--muted);font-size:12px}
.search-box input{
  width:100%;
  height:48px;
  border:1px solid var(--line-strong);
  border-radius:var(--radius);
  padding:0 14px;
  color:var(--ink);
  background:#fff;
  outline:none;
}
.search-box input:focus{border-color:var(--teal);box-shadow:0 0 0 3px rgba(30,111,116,.14)}

.menu-sections{padding:20px;display:grid;gap:28px}
.menu-section{scroll-margin-top:90px}
.menu-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.menu-section h3{margin:0;font-size:24px;line-height:1.1}
.menu-section-count{
  color:var(--muted);
  font-size:13px;
  font-weight:900;
  border:1px solid var(--line);
  border-radius:999px;
  padding:6px 10px;
  background:#fff;
}
.dish-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.dish-card{
  min-width:0;
  display:flex;
  flex-direction:column;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fff;
  overflow:hidden;
  box-shadow:0 12px 28px rgba(25,30,31,.07);
}
.dish-photo-button{
  display:block;
  width:100%;
  border:0;
  padding:0;
  background:transparent;
}
.dish-image{
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  background:linear-gradient(135deg,#eadbc5,#d9e9e8);
}
.dish-body{
  display:flex;
  flex:1;
  flex-direction:column;
  gap:10px;
  padding:12px;
}
.dish-title-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.dish-title-row h4{
  margin:0;
  min-width:0;
  font-size:16px;
  line-height:1.16;
}
.dish-price{
  flex:0 0 auto;
  color:var(--red-dark);
  font-weight:950;
}
.dish-description{
  display:-webkit-box;
  min-height:54px;
  margin:0;
  overflow:hidden;
  color:var(--muted);
  font-size:13px;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
}
.dish-meta{
  display:grid;
  grid-template-columns:1fr 42px;
  align-items:center;
  gap:10px;
  margin-top:auto;
}
.dish-sku{color:#7d8587;font-size:12px;font-weight:900}
.details-button{
  min-height:42px;
  border:1px solid var(--line-strong);
  border-radius:var(--radius);
  background:#fff;
  color:var(--ink);
  padding:0 12px;
  font-weight:950;
}
.details-button:hover{border-color:var(--red);color:var(--red-dark)}
.add-button,.checkout-button,.modal-add-button{
  min-height:42px;
  border:0;
  border-radius:var(--radius);
  background:var(--red);
  color:#fff;
  padding:0 13px;
  font-weight:950;
}
.add-button{
  width:42px;
  min-width:42px;
  padding:0;
  font-size:26px;
  line-height:1;
}
.add-button:hover,.checkout-button:hover,.modal-add-button:hover{background:var(--red-dark)}
.add-button:disabled,.modal-add-button:disabled{
  cursor:not-allowed;
  background:#b9b1a5;
}
.dish-card.is-unavailable{opacity:.62}
.dish-card.is-unavailable .dish-image{filter:saturate(.45)}

.cart-card,.checkout-form,.reserve-card{padding:16px}
.cart-head{
  display:flex;
  align-items:start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.icon-button{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fff;
  color:var(--muted);
  font-size:22px;
  line-height:1;
}
.icon-button:hover{color:var(--red);border-color:var(--red)}
.cart-items{display:grid;gap:10px}
.cart-line{
  display:grid;
  gap:8px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fffaf1;
}
.cart-line-main{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:start;
}
.cart-line strong{line-height:1.2}
.cart-line small{display:block;margin-top:4px;color:var(--muted);font-weight:700}
.cart-line-price{font-weight:950;color:var(--red-dark)}
.qty-control{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.qty-buttons{display:flex;align-items:center;gap:6px}
.qty-buttons button{
  width:30px;
  height:30px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fff;
  font-weight:950;
}
.qty-buttons span{min-width:24px;text-align:center;font-weight:950}
.remove-line{
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:900;
}
.empty-cart{
  display:grid;
  gap:4px;
  padding:18px;
  border:1px dashed var(--line-strong);
  border-radius:var(--radius);
  color:var(--muted);
  background:#fffaf1;
}
.empty-cart strong{color:var(--ink)}
.cart-total{
  display:grid;
  gap:9px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
}
.cart-total div{display:flex;justify-content:space-between;gap:14px;color:var(--muted);font-weight:800}
.cart-total strong{color:var(--ink)}
.cart-total-main{font-size:20px;color:var(--ink)!important}
.cart-total-main strong{color:var(--red-dark)}

.checkout-form{display:grid;gap:12px}
.checkout-form label{display:grid;gap:6px;color:var(--muted);font-size:12px;font-weight:900}
.checkout-form input,.checkout-form textarea,.checkout-form select{
  width:100%;
  border:1px solid var(--line-strong);
  border-radius:var(--radius);
  padding:12px;
  color:var(--ink);
  background:#fff;
  outline:none;
}
.checkout-form textarea{min-height:82px;resize:vertical}
.checkout-form input:focus,.checkout-form textarea:focus,.checkout-form select:focus{border-color:var(--teal);box-shadow:0 0 0 3px rgba(30,111,116,.14)}
.order-window-note{
  margin:-4px 0 0;
  color:var(--muted);
  font-size:12px;
  font-weight:850;
}
.delivery-address-note{
  min-height:18px;
  color:var(--muted);
  font-size:12px;
  font-weight:850;
}
.delivery-address-note.is-error{color:var(--red-dark)}
.delivery-address-note.is-ok{color:var(--teal)}
.checkout-note{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:10px 12px;
  background:#fffaf1;
  color:var(--muted);
  font-size:12px;
  font-weight:900;
}
.consent-check{
  grid-template-columns:18px 1fr!important;
  align-items:start;
  gap:9px!important;
  color:var(--muted);
  font-size:12px!important;
  line-height:1.35;
}
.consent-check input{width:16px;height:16px;margin-top:1px}
.checkout-button{width:100%}
.checkout-button:disabled{
  cursor:not-allowed;
  background:#b9b1a5;
}
.checkout-status{min-height:20px;margin:0;color:var(--teal);font-size:13px;font-weight:900}

.reserve-card h3{margin:0 0 8px;font-size:19px}
.reserve-card p{margin:0 0 12px;color:var(--muted);font-size:13px}
.reserve-card a{
  display:inline-flex;
  min-height:38px;
  align-items:center;
  border:1px solid var(--teal);
  border-radius:var(--radius);
  padding:0 12px;
  color:var(--teal);
  font-weight:950;
}

.item-modal{
  position:fixed;
  inset:0;
  z-index:80;
  display:grid;
  place-items:center;
  padding:22px;
}
.modal-backdrop{position:absolute;inset:0;background:rgba(16,18,19,.54)}
.modal-sheet{
  position:relative;
  width:min(820px,100%);
  max-height:min(760px,calc(100vh - 44px));
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:0 28px 90px rgba(0,0,0,.24);
}
.modal-close{position:absolute;right:12px;top:12px;z-index:2}
.modal-layout{
  display:grid;
  grid-template-columns:minmax(240px,300px) minmax(0,1fr);
  max-height:min(760px,calc(100vh - 44px));
  min-height:0;
}
.modal-hero{
  position:sticky;
  top:0;
  align-self:start;
  background:#f3eadc;
  border-right:1px solid var(--line);
  padding:10px;
}
.modal-hero img{
  width:100%;
  aspect-ratio:1/1;
  min-height:0;
  height:auto;
  border-radius:6px;
  object-fit:cover;
}
.modal-content{
  min-height:0;
  max-height:min(760px,calc(100vh - 44px));
  overflow:auto;
  padding:22px;
  display:grid;
  gap:18px;
}
.modal-content h2{margin:0;font-size:28px;line-height:1.06}
.modal-content p{margin:0;color:var(--muted)}
.modifier-group{display:grid;gap:9px;padding-top:14px;border-top:1px solid var(--line)}
.modifier-head{display:flex;justify-content:space-between;gap:14px;align-items:center}
.modifier-head strong{font-size:15px}
.modifier-head span{color:var(--muted);font-size:12px;font-weight:900}
.modifier-options{display:grid;gap:7px}
.modifier-option{
  display:grid;
  grid-template-columns:18px 1fr auto;
  gap:9px;
  align-items:center;
  min-height:42px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:9px;
  background:#fff;
  color:var(--ink);
  font-weight:800;
}
.modifier-option input{width:16px;height:16px}
.modifier-option span:last-child{color:var(--red-dark);font-weight:950}
.modifier-option.is-unavailable{opacity:.55}
.modifier-option.is-unavailable span:last-child{color:var(--muted)}
.modal-footer{
  position:sticky;
  bottom:0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
  background:var(--surface);
}
.modal-total strong{display:block;font-size:22px;color:var(--red-dark)}
.modal-total span{display:block;color:var(--muted);font-size:12px;font-weight:900}
.modal-add-button{padding:0 18px}

.mobile-cart-toggle,.mobile-cart-close,.mobile-cart-backdrop{display:none}

@media (max-width:1180px){
  .delivery-app{grid-template-columns:230px minmax(0,1fr)}
  .cart-panel{
    position:static;
    grid-column:1/-1;
    grid-template-columns:1fr 1fr;
  }
  .dish-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:820px){
  body.delivery-page{padding-bottom:86px}
  .delivery-app{width:min(100% - 18px,var(--max));grid-template-columns:1fr}
  .restaurant-panel{position:static;grid-template-columns:1fr}
  .restaurant-card{display:grid;grid-template-columns:112px 1fr;gap:14px;align-items:center}
  .restaurant-logo{width:112px;margin:0;grid-row:1/5}
  .restaurant-facts{grid-column:1/-1}
  .workspace-head{grid-template-columns:1fr}
  .restaurant-hero{grid-template-columns:86px 1fr}
  .restaurant-hero-logo{width:86px;height:68px}
  .workspace-head h2{font-size:28px}
  .cart-panel{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:80;
    max-height:88vh;
    grid-template-columns:1fr;
    gap:10px;
    overflow:auto;
    padding:10px;
    border-top:1px solid var(--line);
    background:var(--bg);
    box-shadow:0 -18px 50px rgba(25,30,31,.18);
    transform:translateY(calc(100% + 20px));
    transition:transform .24s ease;
  }
  body.is-mobile-cart-open .cart-panel{transform:translateY(0)}
  .mobile-cart-close{
    display:block;
    width:100%;
    min-height:42px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:#fff;
    color:var(--ink);
    font-weight:950;
  }
  .mobile-cart-toggle{
    position:fixed;
    left:10px;
    right:10px;
    bottom:10px;
    z-index:70;
    display:grid;
    grid-template-columns:1fr auto;
    align-items:center;
    gap:12px;
    min-height:62px;
    border:0;
    border-radius:var(--radius);
    padding:10px 14px;
    background:var(--ink);
    color:#fff;
    box-shadow:0 18px 46px rgba(0,0,0,.24);
    text-align:left;
  }
  .mobile-cart-toggle strong{display:block;font-size:15px}
  .mobile-cart-toggle small{display:block;margin-top:2px;color:rgba(255,255,255,.72);font-size:12px;font-weight:850}
  .mobile-cart-toggle b{font-size:18px}
  .mobile-cart-toggle.is-empty{background:#3e3b36}
  .mobile-cart-toggle.is-flashing{animation:cartPulse .45s ease}
  .mobile-cart-backdrop{
    position:fixed;
    inset:0;
    z-index:75;
    background:rgba(16,18,19,.48);
  }
  body.is-mobile-cart-open .mobile-cart-backdrop{display:block}
  body.is-mobile-cart-open .mobile-cart-toggle{display:none}
  .modal-layout{grid-template-columns:1fr}
  .modal-sheet{overflow:auto}
  .modal-layout{max-height:none}
  .modal-hero{position:static;border-right:0;border-bottom:1px solid var(--line)}
  .modal-hero img{height:auto;min-height:0;aspect-ratio:16/10}
  .modal-content{max-height:none;overflow:visible}
}

@media (max-width:560px){
  .dish-grid{grid-template-columns:1fr}
  .restaurant-card{grid-template-columns:1fr}
  .restaurant-logo{grid-row:auto;margin:0 auto}
  .restaurant-hero{grid-template-columns:1fr}
  .restaurant-hero-logo{width:124px;height:88px}
  .item-modal{padding:10px}
  .modal-sheet{max-height:calc(100vh - 20px)}
  .modal-footer{align-items:stretch;flex-direction:column}
  .modal-add-button{width:100%}
}

@keyframes cartPulse{
  0%{transform:scale(1)}
  45%{transform:scale(1.025)}
  100%{transform:scale(1)}
}
