:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --muted:#6b7280;
  --text:#111827;
  --line:#e5e7eb;

  --accent:#2563eb;     /* 主色：蓝 */
  --accent2:#111827;    /* 深色文字 */
  --danger:#b91c1c;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg);
  color:var(--text);
}

/* ===== 顶部栏 ===== */
.topbar{
  position:sticky; top:0; z-index:5;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  padding: 14px 14px 10px;
  backdrop-filter: blur(10px);
}

.brand{display:flex; flex-direction:column; gap:4px}
.logo{font-weight:900; letter-spacing:.18em}
.tag{color:var(--muted); font-size:13px}

.top-actions{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.toplink{
  color: var(--text);
  text-decoration:none;
  font-size:13px;
  padding:8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.toplink:hover{ filter: brightness(0.98); }

/* ===== 菜单切换 ===== */
.menu-switch{
  margin-top:10px;
  display:flex;
  background: #fff;
  border:1px solid var(--line);
  border-radius: 14px;
  overflow:hidden;
}

.tab{
  flex:1;
  padding: 12px 10px;
  font-weight:800;
  color:var(--text);
  background: transparent;
  border:0;
  cursor:pointer;
}
.tab.active{
  background: rgba(37,99,235,.10);
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.25);
  color: #1d4ed8;
}

/* ===== 页面布局（移动优先） ===== */
.wrap{
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap: 14px;
  padding-bottom: 200px; /* 给底部购物车留空间 */
}

/* ===== 卡片 ===== */
.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(17,24,39,.06);
  padding: 14px;
}

h2{margin:0 0 12px; font-size:18px}

/* ===== 表单 ===== */
.field{display:flex; flex-direction:column; gap:7px}
.field label{font-size:13px; color:var(--muted)}
.field input{
  height:44px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: #fff;
  color:var(--text);
  padding: 0 12px;
  outline:none;
}
.field input:focus{
  border-color: rgba(147,197,253,1);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.field.full{margin-bottom:12px}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width:380px){ .grid2{grid-template-columns:1fr} }

/* ===== segmented：Recogida/Entrega ===== */
.segmented{
  display:flex;
  border-radius: 14px;
  overflow:hidden;
  border:1px solid var(--line);
  background: #fff;
}
.seg{
  flex:1;
  padding: 12px 10px;
  border:0;
  background: transparent;
  color:var(--text);
  font-weight:900;
  cursor:pointer;
}
.seg.active{
  background: rgba(37,99,235,.10);
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.25);
  color:#1d4ed8;
}
.hint{margin:8px 0 0; color:var(--muted); font-size:12px}

/* ===== 菜单头 + 搜索 ===== */
.menu-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.search input{ width: 180px; }
@media (max-width:420px){
  .menu-head{flex-direction:column; align-items:stretch}
  .search input{width:100%}
}

/* ===== 分类 chips ===== */
.categories{
  display:flex; gap:8px; overflow:auto;
  padding: 6px 2px 10px;
  scrollbar-width:none;
}
.categories::-webkit-scrollbar{display:none}

.chip{
  white-space:nowrap;
  padding: 9px 12px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: #fff;
  color:var(--text);
  font-weight:800;
  font-size:13px;
  cursor:pointer;
}
.chip.active{
  background: rgba(37,99,235,.10);
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.22);
  color:#1d4ed8;
}

/* ===== 菜单列表 ===== */
.menu-list{display:flex; flex-direction:column; gap:8px}

.item{
  display:grid;
  grid-template-columns: 54px 1fr 74px 110px;
  gap:10px;
  padding: 10px;
  border-radius: 16px;
  border:1px solid var(--line);
  background: #fff;
  align-items:center;
}
.code{
  font-weight:900;
  letter-spacing:.04em;
  color: var(--accent);
  text-align:left;
}
.name{font-weight:800; line-height:1.2}
.price{color:var(--text); font-weight:900; text-align:right}

.qty{
  justify-self:end;
  display:flex;
  border:1px solid var(--line);
  border-radius: 14px;
  overflow:hidden;
  background: #fff;
}
.qty button{
  width: 38px; height:38px;
  border:0; background:transparent; color:var(--text);
  font-size:18px; font-weight:900;
  cursor:pointer;
}
.qty input{
  width: 34px;
  height:38px;
  border:0;
  text-align:center;
  background:transparent;
  color:var(--text);
  font-weight:900;
  outline:none;
}
@media (max-width:430px){
  .item{grid-template-columns: 48px 1fr 64px 104px}
  .qty button{width:36px}
}

/* ===== 底部购物车（固定） ===== */
.cart{
  position:fixed; left:0; right:0; bottom:0;
  background: rgba(255,255,255,.96);
  border-top:1px solid var(--line);
  backdrop-filter: blur(10px);
  padding: 12px 14px 14px;
  box-shadow: 0 -10px 30px rgba(17,24,39,.08);
}

.cart-head{display:flex; align-items:center; justify-content:space-between; gap:10px}
.cart-title{font-size:16px; font-weight:900}

.cart-clear{
  border:1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  cursor:pointer;
}

.cart-items{
  margin:10px 0;
  max-height: 160px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:8px
}

.cart-row{
  display:flex; justify-content:space-between; gap:10px;
  padding: 8px 10px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: #fff;
}
.cart-row .left{display:flex; flex-direction:column; gap:2px}
.cart-row .left .t{font-weight:900}
.cart-row .left .s{color:var(--muted); font-size:12px}
.cart-row .right{font-weight:900}

.totals{
  border-top:1px dashed var(--line);
  padding-top:10px
}
.row{display:flex; justify-content:space-between; padding:4px 0; font-weight:900}

/* ===== 按钮 ===== */
.btn{
  width:100%;
  height:48px;
  border-radius: 16px;
  border:0;
  cursor:pointer;
  font-weight:900;
}
.btn.primary{
  margin-top:10px;
  background: var(--accent);
  color:#fff;
  box-shadow: 0 10px 30px rgba(37,99,235,.16);
}
.btn.primary:active{transform: translateY(1px)}

.tiny{
  margin:8px 0 0;
  color:var(--muted);
  font-size:11px;
  text-align:center
}
/* ===== Mobile: cart drawer (more space for menu) ===== */
@media (max-width: 760px){
  /* 菜单区不需要预留太多底部空间了 */
  .wrap{ padding-bottom: 92px !important; }

  .cart{
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    border-radius: 18px !important;
    border: 1px solid var(--line) !important;
    box-shadow: 0 -10px 30px rgba(17,24,39,.10) !important;
    padding: 10px 10px 12px !important;
    max-height: 72vh;          /* 展开时最大高度 */
    overflow: hidden;
    transition: max-height .2s ease;
  }

  /* 购物车默认收起：只占一条 */
  .cart.collapsed{
    max-height: 72px;
  }

  .cart-head{
    display:flex;
    align-items:center;
    gap:10px;
  }

  .cart-toggle{
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background:#fff;
    color: var(--text);
    font-weight: 900;
    cursor:pointer;
  }

  /* 收起状态：隐藏明细，只留合计+按钮 */
  .cart.collapsed .cart-items{
    display: none;
  }

  .cart-items{
    margin: 10px 0 10px !important;
    max-height: 42vh;          /* 明细滚动 */
    overflow:auto;
  }

  /* 合计区更紧凑 */
  .cart-foot{
    padding-top: 8px !important;
  }

  .totals .row{
    padding: 2px 0 !important;
    font-size: 14px;
  }

  /* “Enviar por WhatsApp”按钮更明显 */
  .cart .btn.primary{
    height: 48px;
    border-radius: 16px;
  }
}

/* ===== Mobile categories: wrap into grid (no horizontal swipe) ===== */
@media (max-width: 560px){
  .categories{
    overflow: visible !important;      /* 取消横向滚动 */
    flex-wrap: wrap !important;        /* 自动换行 */
    gap: 8px !important;
    padding: 6px 0 10px !important;
  }

  .chip{
    flex: 1 1 calc(50% - 8px);         /* 两列 */
    text-align: center;
    padding: 10px 10px;
    border-radius: 14px;
  }
}
@media (max-width: 360px){
  .chip{ flex: 1 1 100%; }
}

/* ================================
   Carta 分类区：背景更明显（电脑 + 手机）
   ================================ */

.categories{
  background: #e0ebff;              /* 比之前更深的浅蓝 */
  border: 2px solid #b6ccff;        /* 边框更明显 */
  border-radius: 18px;
  padding: 14px 14px 16px;
  margin: 16px 0 10px;
}

/* 分类按钮保持白色卡片 */
.categories .chip{
  background: #ffffff;
  border: 1px solid #c9d9ff;
  font-weight: 800;
}

/* 当前选中分类：更强品牌感 */
.categories .chip.active{
  background: #2563eb;
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(37,99,235,.35);
}
/* ================================
   Carta 分类区标题条
   ================================ */
.category-title{
  font-size: 14px;
  font-weight: 900;
  color: #1e3a8a;                  /* 深一点的蓝，明显但不刺眼 */
  margin: 6px 0 6px;
  padding-left: 4px;
  letter-spacing: .02em;
}
/* 强制所有 hidden 元素不显示（防止被其他 CSS 覆盖） */
[hidden]{
  display:none !important;
}

/* ==================================
   Footer (Light system for pedido / carta)
   ================================== */

.site-foot{
  margin: 40px auto 30px;
  max-width: 980px;
  padding: 22px 16px;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;

  color: #374151;
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-radius: 18px;
}

.site-foot .foot-nap{
  margin-top: 10px;
  color:#4b5563;
}

.site-foot .foot-links{
  margin-top: 16px;
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:14px;
}

.site-foot a{
  color:#111827;
  font-weight:600;
  text-decoration:none;
  transition:all .2s ease;
}

.site-foot a:hover{
  color:var(--accent);
}

.site-foot .foot-links a,
.site-foot .foot-tel{
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#f9fafb;
}


/* =========================
   Menu switch (Chino / Sushi) — polished
   ========================= */
.menu-switch{
  position: sticky;
  top: 64px;
  z-index: 50;

  display: flex;
  gap: 6px;
  padding: 6px;
  margin: 12px;
  border-radius: 999px;

  background: rgba(255,255,255,.70);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.menu-switch .tab{
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 10px 0;

  font-weight: 900;
  font-size: 14px;
  cursor: pointer;

  color: #374151;
  background: transparent;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
}

.menu-switch .tab.active{
  background: #0f3d2e;
  color: #fff;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.25);
  transform: translateY(1px);
}

.menu-switch .tab[data-menu="sushi"].active{
  background: linear-gradient(135deg, #0f3d2e, #145a44);
}

.menu-switch .tab:active{ transform: scale(.97); }

/* =========================
   Sticky Cart Bar + Drawer (McD style)
   ========================= */
.cartBar{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 999;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 12px;
  border-radius: 18px;
  background: #0f3d2e;
  color:#fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.32);
}

.cartBar__left{display:flex; flex-direction:column; gap:2px}
.cartBar__total{font-size:18px; font-weight:900; line-height:1}
.cartBar__meta{font-size:12px; opacity:.9}

.cartBar__btn{
  border:0;
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 900;
  background:#fff;
  color:#0f3d2e;
}

.hidden{display:none !important;}

.overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 998;
}

.drawer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;

  background: #fff;
  border-radius: 18px 18px 0 0;
  max-height: 78vh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.drawer__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer__title{font-size:16px; font-weight:900}
.drawer__actions{display:flex; gap:8px; align-items:center}

.drawer__clear{
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 800;
}

.drawer__close{
  border: 1px solid var(--line);
  background: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-weight: 900;
  cursor:pointer;
}

.drawer__list{
  padding: 10px 12px;
  overflow:auto;
}

.dItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:#fff;
  margin-bottom: 10px;
}

.dItem__left{min-width:0; flex:1; display:flex; flex-direction:column; gap:2px}
.dItem__t{font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.dItem__s{color:var(--muted); font-size:12px}

.dItem__right{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}

.dItem__price{font-weight:900; white-space:nowrap}

.dQty{
  display:flex;
  align-items:center;
  gap:8px;
  border-radius: 999px;
  padding: 6px 8px;
  background: #f3f4f6;
}
.dQty button{
  width: 32px; height: 32px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor:pointer;
}
.dQty span{
  min-width: 18px;
  text-align:center;
  font-weight: 900;
}

.drawer__footer{
  border-top: 1px solid var(--line);
  padding: 12px;
  background:#fff;
}

/* Leave room for the floating cart bar */
.wrap{ padding-bottom: 120px !important; }
