* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, sans-serif; color: #222;
  background:
    radial-gradient(circle at 10% 15%, rgba(228,87,46,.18) 0%, transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(255,183,77,.22) 0%, transparent 36%),
    radial-gradient(circle at 85% 85%, rgba(46,125,50,.14) 0%, transparent 32%),
    radial-gradient(circle at 15% 90%, rgba(228,87,46,.14) 0%, transparent 36%),
    linear-gradient(160deg, #fff8ef 0%, #ffeccd 40%, #ffe0c2 70%, #fff3e4 100%);
  background-attachment: fixed;
  color: #222;
  min-height: 100vh;
  position: relative;
}

/* ---------- PATRÓN DE COMIDA (emoji gigante de fondo) ---------- */
body::before {
  content: "\1F32E  \1F354  \1F32F  \1F951  \1F364  \1F355  \1F35F  \1F958  \1F32E  \1F354  \1F32F  \1F951  \1F364  \1F355  \1F35F  \1F958  \1F32E  \1F354  \1F32F  \1F951  \1F364  \1F355  \1F35F  \1F958  \1F32E  \1F354  \1F32F  \1F951  \1F364  \1F355  \1F35F  \1F958";
  position: fixed;
  top: -40px; left: -40px; right: -40px; bottom: -40px;
  font-size: 100px;
  opacity: .06;
  z-index: 0;
  pointer-events: none;
  letter-spacing: 70px;
  line-height: 190px;
  word-break: break-all;
}
header.top, nav.cats, main, .wrap { position: relative; z-index: 1; }

/* ---------- HEADER ---------- */
header.top {
  background: linear-gradient(180deg, #1d2026 0%, #14161a 100%);
  color: #fff; padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 14px rgba(0,0,0,.35);
}
header.top .brand { font-weight: 800; font-size: 18px; letter-spacing: .3px; }
header.top a { color: #fff; text-decoration: none; opacity: .85; }
.cart-btn {
  margin-left: auto; background: linear-gradient(135deg, #e4572e, #ff7043);
  color: #fff; border: 0; padding: 10px 20px; border-radius: 30px;
  font-size: 15px; cursor: pointer; text-decoration: none; font-weight: 700;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 3px 12px rgba(228,87,46,.4);
  display: inline-flex; align-items: center; gap: 6px;
}
.cart-btn:hover { transform: scale(1.06); box-shadow: 0 5px 18px rgba(228,87,46,.55); }
.cart-btn.bounce { animation: cartBounce .5s; background: linear-gradient(135deg, #14713d, #1e9e55); }
@keyframes cartBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.35) rotate(-5deg); }
  60% { transform: scale(.9) rotate(3deg); }
  100% { transform: scale(1); }
}
.cart-btn .badge {
  background: #fff; color: #e4572e; border-radius: 20px;
  padding: 1px 9px; font-weight: 800; margin-left: 4px;
  display: inline-block; transition: transform .2s;
}
.cart-btn.bounce .badge { animation: badgePulse .5s; }
@keyframes badgePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.6); } }

/* ---------- CATEGORÍAS ---------- */
nav.cats {
  display: flex; gap: 10px; overflow-x: auto; padding: 14px 20px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  position: sticky; top: 57px; z-index: 40;
  scrollbar-width: none;
}
nav.cats::-webkit-scrollbar { display: none; }
nav.cats a {
  white-space: nowrap; text-decoration: none; color: #555;
  background: #fff; padding: 8px 18px; border-radius: 20px;
  font-size: 14px; font-weight: 700; transition: all .2s;
  border: 2px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
nav.cats a:hover {
  background: linear-gradient(135deg, #e4572e, #ff7043);
  border-color: #e4572e; color: #fff; transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(228,87,46,.35);
}

/* ---------- MAIN ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }
h2.sec { margin: 30px 0 16px; font-size: 23px; display: inline-block; padding-bottom: 5px; position: relative; }
h2.sec::after {
  content: ""; display: block; height: 4px; margin-top: 4px;
  background: linear-gradient(90deg, #e4572e, #ffb347);
  border-radius: 4px;
}

/* ---------- CARDS ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.card {
  background: rgba(255,255,255,.97); border-radius: 18px; overflow: hidden;
  box-shadow: 0 3px 14px rgba(60,30,10,.10);
  display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  border: 1px solid rgba(255,255,255,.85);
}
.card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 16px 36px rgba(60,30,10,.20);
}
.card img {
  width: 100%; height: 200px; object-fit: cover;
  transition: transform .4s ease; display: block;
}
.card:hover img { transform: scale(1.08); }
.card .ph {
  height: 200px; display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,183,77,.3) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(228,87,46,.18) 0%, transparent 50%),
    linear-gradient(135deg, #fff3e0, #ffe0b2);
  transition: transform .4s ease;
}
.card:hover .ph { transform: scale(1.08); }
.card .imgwrap { overflow: hidden; position: relative; }

.card .body { padding: 15px 17px 17px; flex: 1; display: flex; flex-direction: column; }
.card h3 { font-size: 17.5px; margin-bottom: 5px; font-weight: 800; }
.card p { font-size: 13.5px; color: #6b6b6b; flex: 1; line-height: 1.5; }
.card .priceRow { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 10px; }
.card .price { font-weight: 900; font-size: 21px; color: #14713d; }
.card button {
  background: linear-gradient(135deg, #e4572e, #ff7043); color: #fff;
  border: 0; padding: 13px; border-radius: 12px;
  font-size: 15px; font-weight: 800; cursor: pointer;
  transition: all .2s; letter-spacing: .3px;
  box-shadow: 0 3px 12px rgba(228,87,46,.32);
}
.card button:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(228,87,46,.5); }
.card button:active { transform: scale(.96); }
.card.sold { opacity: .55; }
.card.sold button { background: #999; cursor: not-allowed; box-shadow: none; }
.card.sold:hover { transform: none; }

/* ---------- BADGES (los 7 + popular) ---------- */
.prod-badge, .popular-badge {
  position: absolute; top: 12px; left: 12px; z-index: 5;
  font-size: 11.5px; font-weight: 800; padding: 5px 13px;
  border-radius: 20px; color: #fff; letter-spacing: .5px;
  box-shadow: 0 3px 12px rgba(0,0,0,.3);
}
.badge-favorito { background: linear-gradient(135deg, #e4572e, #ff8a3d); }
.badge-chef { background: linear-gradient(135deg, #0d5c8a, #14a3e0); }
.badge-veggie { background: linear-gradient(135deg, #14713d, #2ecc71); }
.badge-spicy { background: linear-gradient(135deg, #a33, #e4572e); }
.badge-topseller { background: linear-gradient(135deg, #6a1b9a, #ab47bc); }
.badge-glutenfree { background: linear-gradient(135deg, #00695c, #26a69a); }
.badge-health { background: linear-gradient(135deg, #b71c1c, #f44336); }
.popular-badge {
  background: linear-gradient(135deg, #e4572e, #ff8a3d);
  box-shadow: 0 3px 12px rgba(228,87,46,.5);
  animation: badgeGlow 2.5s infinite;
}
@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 3px 12px rgba(228,87,46,.5); }
  50% { box-shadow: 0 3px 22px rgba(255,138,61,.85); }
}

/* ---------- MODAL ---------- */
#overlay {
  position: fixed; inset: 0; background: rgba(20,10,5,.55);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 100; backdrop-filter: blur(4px);
}
#overlay.open { display: flex; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#modal {
  background: #fff; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 22px;
  animation: slideUp .3s ease;
  box-shadow: 0 -8px 40px rgba(0,0,0,.3);
}
@keyframes slideUp {
  from { transform: translateY(70px); opacity: .5; }
  to { transform: translateY(0); opacity: 1; }
}
#modal h3 { font-size: 21px; font-weight: 900; }
fieldset { border: 0; border-top: 2px solid #f5e6da; margin-top: 16px; padding-top: 12px; }
legend { font-weight: 800; font-size: 14px; padding-right: 8px; color: #e4572e; }
.opt {
  display: flex; align-items: center; gap: 10px; padding: 10px 6px;
  font-size: 15px; border-radius: 8px; cursor: pointer; transition: background .15s;
}
.opt:hover { background: #fff5f0; }
.opt input { width: 18px; height: 18px; accent-color: #e4572e; cursor: pointer; }
.opt .delta { margin-left: auto; color: #14713d; font-weight: 700; font-size: 13.5px; }
.rowQty { display: flex; align-items: center; gap: 14px; margin: 18px 0 8px; }
.rowQty button {
  width: 42px; height: 42px; border: 2px solid #e8dcd0;
  background: #fff; border-radius: 12px; font-size: 20px;
  cursor: pointer; font-weight: 800; transition: all .15s; color: #e4572e;
}
.rowQty button:hover { border-color: #e4572e; background: #fff5f2; transform: scale(1.08); }
.rowQty input { width: 54px; text-align: center; font-size: 18px; font-weight: 800; border: 2px solid #e8dcd0; border-radius: 12px; padding: 8px; }
#modalNotes {
  width: 100%; border: 2px solid #e8dcd0; border-radius: 12px;
  padding: 10px; font-size: 14px; margin-top: 10px; font-family: inherit;
}
#modalNotes:focus { outline: none; border-color: #e4572e; }
#modalAdd {
  width: 100%; background: linear-gradient(135deg, #e4572e, #ff7043);
  color: #fff; border: 0; padding: 16px; border-radius: 14px;
  font-size: 16.5px; font-weight: 900; cursor: pointer; margin-top: 16px;
  transition: all .2s; box-shadow: 0 4px 16px rgba(228,87,46,.4);
}
#modalAdd:hover { transform: translateY(-2px); box-shadow: 0 7px 22px rgba(228,87,46,.55); }
#modalAdd:active { transform: scale(.97); }
.unitCard { border: 1.5px solid #f0e6da; border-radius: 12px; padding: 4px 12px 10px; margin-top: 12px; background: #fdfbf8; }
.unitTitle { font-weight: 800; font-size: 13.5px; color: #e4572e; margin: 8px 0 2px; }

/* ---------- TOAST ---------- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #14713d, #1e9e55); color: #fff;
  padding: 14px 28px; border-radius: 30px; display: none;
  z-index: 200; font-weight: 700;
  box-shadow: 0 6px 22px rgba(20,113,61,.45); animation: toastIn .3s;
}
@keyframes toastIn { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- CHECKOUT ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 80px; }
.item-row {
  display: flex; gap: 10px; background: rgba(255,255,255,.96); padding: 14px;
  border-radius: 14px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(60,30,10,.08); align-items: center;
}
.item-row .inf { flex: 1; }
.item-row .nm { font-weight: 700; }
.item-row .ops { font-size: 12.5px; color: #666; }
.item-row .rm {
  background: none; border: 0; color: #c33; font-size: 18px;
  cursor: pointer; padding: 6px; border-radius: 8px; transition: all .15s;
}
.item-row .rm:hover { background: #ffecec; transform: scale(1.15); }
.totals { background: rgba(255,255,255,.96); padding: 18px; border-radius: 14px; margin: 16px 0; box-shadow: 0 2px 10px rgba(60,30,10,.09); }
.totals .line { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .big { font-size: 21px; font-weight: 900; border-top: 2px solid #f0e6da; margin-top: 8px; padding-top: 12px; }
label.fl { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 4px; }
input.fi, textarea.fi { width: 100%; padding: 12px; border: 2px solid #e8dcd0; border-radius: 10px; font-size: 15px; background: rgba(255,255,255,.9); transition: border .15s; }
input.fi:focus, textarea.fi:focus { outline: none; border-color: #e4572e; }
.paybox { background: rgba(255,255,255,.96); border-radius: 14px; padding: 6px 16px; margin: 14px 0; box-shadow: 0 2px 8px rgba(60,30,10,.08); }
.paybox label.pay {
  display: flex; align-items: center; gap: 10px; padding: 13px 0;
  border-bottom: 1px solid #f5efe8; font-size: 15px; cursor: pointer;
}
.paybox label.pay:last-child { border-bottom: 0; }
.paybox label.pay input { accent-color: #e4572e; width: 18px; height: 18px; }
.paybox .sub { display: block; font-size: 12px; color: #888; }
#submitBtn {
  width: 100%; background: linear-gradient(135deg, #14713d, #1e9e55);
  color: #fff; border: 0; padding: 17px; border-radius: 14px;
  font-size: 17px; font-weight: 900; cursor: pointer; margin-top: 10px;
  transition: all .2s; box-shadow: 0 4px 16px rgba(20,113,61,.4);
}
#submitBtn:hover { transform: translateY(-2px); box-shadow: 0 7px 22px rgba(20,113,61,.55); }
#submitBtn:disabled { background: #999; }
.empty { text-align: center; padding: 60px 20px; }
.okbox { text-align: center; background: rgba(255,255,255,.96); padding: 40px 20px; border-radius: 18px; box-shadow: 0 2px 10px rgba(60,30,10,.1); }
.okbox .folio { font-size: 32px; font-weight: 900; color: #14713d; margin: 10px 0; }