/* TypeUber Reboot V1 - Mobile-first */
:root{--bg:#0b0b0b;--panel:#121212;--panel2:#161616;--text:#fff;--muted:rgba(255,255,255,.65);--muted2:rgba(255,255,255,.45);--line:rgba(255,255,255,.08);--btn:#fff;--btnText:#000;--danger:#ff4d4d;--ok:#3ddc84}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,system-ui,sans-serif;-webkit-font-smoothing:antialiased}
a{color:inherit}
.wrap{min-height:100vh;padding:24px 20px 28px;display:flex;align-items:flex-start}
.card{width:100%;max-width:560px;margin:0 auto;background:var(--panel);border:1px solid var(--line);border-radius:22px;padding:22px}
.h1{font-size:34px;font-weight:650;margin:0 0 8px}
.h2{font-size:26px;font-weight:650;margin:0 0 10px}
.muted{color:var(--muted)}
.small{font-size:13px;color:var(--muted2)}
.hr{height:1px;background:var(--line);margin:16px 0}
.stack{display:flex;flex-direction:column;gap:12px}
.row{display:flex;gap:12px;flex-wrap:wrap}
.col{flex:1;min-width:180px}
label{display:block;font-size:12px;font-weight:700;letter-spacing:.9px;text-transform:uppercase;color:var(--muted2);margin-bottom:6px}
input,select,textarea{width:100%;background:#1c1c1e;border:1px solid rgba(255,255,255,.06);color:#fff;padding:14px 14px;border-radius:16px;font-size:16px;outline:none}
input::placeholder,textarea::placeholder{color:rgba(255,255,255,.9);opacity:1}
input:focus,textarea:focus,select:focus{box-shadow:0 0 0 2px rgba(255,255,255,.12)}
.btn{width:100%;padding:14px 16px;border-radius:16px;border:1px solid rgba(255,255,255,.15);background:transparent;color:#fff;font-size:16px;font-weight:650;text-align:center;text-decoration:none;display:inline-block}
.btn.primary{background:var(--btn);color:var(--btnText);border:none}
.btn.danger{background:transparent;border-color:rgba(255,77,77,.55);color:#ffb3b3}
.badge{display:inline-block;padding:6px 10px;border-radius:999px;font-size:12px;border:1px solid var(--line);color:var(--muted)}
.badge.ok{border-color:rgba(61,220,132,.35);color:#b7ffd8}
.badge.warn{border-color:rgba(255,205,64,.35);color:#ffe6a6}
.badge.bad{border-color:rgba(255,77,77,.35);color:#ffb3b3}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:10px 8px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.table th{font-size:12px;color:var(--muted2);text-transform:uppercase;letter-spacing:.8px}
.thumb{width:100%;max-width:260px;border-radius:16px;border:1px solid var(--line)}
.notice{padding:12px 12px;border-radius:16px;border:1px solid var(--line);background:var(--panel2)}
.notice.ok{border-color:rgba(61,220,132,.35)}
.notice.bad{border-color:rgba(255,77,77,.35)}
.footerlinks{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.footerlinks a{opacity:.85}

/* iOS modal (slide-up) */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.6);
  display:none; align-items:flex-end; justify-content:center;
  padding:18px; z-index:9999;
}
.modal-backdrop.show{ display:flex; }
.modal-sheet{
  width:100%; max-width:420px;
  background:#1c1c1e;
  border:1px solid rgba(255,255,255,.08);
  border-radius:22px;
  padding:18px;
  transform:translateY(20px);
  opacity:0;
  transition: transform .22s ease, opacity .22s ease;
}
.modal-backdrop.show .modal-sheet{ transform:translateY(0); opacity:1; }

.drag-item{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; padding:12px; border-radius:16px;
  border:1px solid var(--line); background:var(--panel2);
}
.drag-handle{
  width:34px; height:34px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(255,255,255,.12);
  color:rgba(255,255,255,.65);
  cursor:grab;
  user-select:none;
}
.drag-item.dragging{ opacity:.6; }

/* Sticky cart */
.sticky-cart{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  background:#111;
  border-top:1px solid rgba(255,255,255,.1);
  padding:14px;
  z-index:999;
}

/* Uber-like cart */
.product-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.qty-badge{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:22px;height:22px;padding:0 6px;
  border-radius:999px;background:#fff;color:#000;
  font-size:12px;font-weight:800; margin-left:8px;
  transform:scale(1); transition:transform .15s ease;
}
.qty-badge.pop{ transform:scale(1.25); }
.soldout{ opacity:.45; filter:saturate(.4); }
.soldout .soldout-label{ color:#ffb3b3; font-weight:800; }
.soldout input[type=number]{ pointer-events:none; }

.cart-float{
  position:fixed; left:0; right:0; bottom:0;
  padding:14px 14px 18px;
  z-index:999;
}
.cart-panel{
  max-width:560px;margin:0 auto;
  background:#0f0f10;
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  padding:12px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.45);
}
.cart-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.cart-total{font-weight:900;font-size:18px}
.cart-meta{font-size:12px;color:rgba(255,255,255,.65)}
.cart-btn{margin-top:10px}
.cart-btn .btn{border-radius:16px}
.cart-items{
  margin-top:10px; display:none;
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:10px; gap:6px;
}
.cart-items.show{display:flex;flex-direction:column}
.cart-item-line{display:flex;justify-content:space-between;gap:10px;font-size:13px;color:rgba(255,255,255,.85)}
.cart-toggle{font-size:13px;text-decoration:none;opacity:.9}

.toast{
  position:fixed; left:50%; bottom:92px; transform:translateX(-50%);
  background:#1c1c1e; color:#fff;
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  padding:10px 14px;
  font-size:13px;
  opacity:0; pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  z-index:10000;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(-6px); }

/* Category cards */
.category-grid{display:flex;flex-direction:column;gap:14px}
.category-card{
  border-radius:22px;
  overflow:hidden;
  background:#141415;
  border:1px solid rgba(255,255,255,.08);
  cursor:pointer;
  transition:transform .2s ease, box-shadow .2s ease;
}
.category-card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}
.category-img{
  width:100%;
  height:140px;
  object-fit:cover;
}
.category-title{
  padding:16px;
  font-weight:800;
  font-size:18px;
}
.category-products{
  display:none;
  padding:16px;
  border-top:1px solid rgba(255,255,255,.08);
}
.category-card.open .category-products{
  display:block;
}


/* Accordion smooth animation */
.category-products{
  max-height:0;
  overflow:hidden;
  transition:max-height .35s ease;
}
.category-card.open .category-products{
  max-height:1200px;
}

/* Chevron */
.category-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.chevron{
  transition:transform .3s ease;
}
.category-card.open .chevron{
  transform:rotate(180deg);
}

/* Horizontal swipe */
.category-grid{
  display:flex;
  gap:14px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
}
.category-card{
  min-width:85%;
  scroll-snap-align:start;
}

/* Lazy image */
.category-img{
  loading:lazy;
}

/* V11 App UI */
:root{ --spring:cubic-bezier(.17,.89,.32,1.35); }

/* Spring-ish accordion */
.category-products{ transition:max-height .42s var(--spring); }

/* Sticky header inside opened card */
.category-card.open .category-header{
  position:sticky;
  top:0;
  background:#141415;
  z-index:5;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

/* Skeleton loader */
.skeleton{
  position:relative;
  background:rgba(255,255,255,.06);
  overflow:hidden;
}
.skeleton::after{
  content:"";
  position:absolute; inset:0;
  transform:translateX(-100%);
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  animation:skeleton 1.1s infinite;
}
@keyframes skeleton{
  100%{ transform:translateX(100%); }
}
.category-img.skeleton{ height:140px; }

/* category card placeholder when no image */
.category-card.noimg::before{
  content:"";
  display:block;
  height:140px;
  background:linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}

/* 2 cards per row */
.category-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

/* Bottom sheet modal */
.sheet-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  display:none;
  z-index:9999;
}

.sheet{
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  background:#111;
  border-radius:20px 20px 0 0;
  max-height:85vh;
  overflow:auto;
  transform:translateY(100%);
  transition:transform .35s cubic-bezier(.17,.89,.32,1.35);
  padding:20px;
}

.sheet.open{
  transform:translateY(0);
}

.sheet-header{
  font-weight:800;
  font-size:18px;
  margin-bottom:15px;
}

/* Drag handle */
.sheet-handle{
  width:40px;
  height:5px;
  background:#444;
  border-radius:4px;
  margin:0 auto 15px auto;
}

/* Snap elastic animation */
.sheet{
  transition: transform .45s cubic-bezier(.22,1.2,.36,1);
}

/* Product row in sheet */
.product-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 0;
  border-bottom:1px solid rgba(255,255,255,.06);
}

.product-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.qty-input{
  width:50px;
  text-align:center;
  background:#1a1a1a;
  border:1px solid #333;
  color:#fff;
  border-radius:8px;
  padding:4px;
}

/* V16: snap heights */
.sheet{ will-change: transform; touch-action: none; }
.sheet[data-snap="half"]{ max-height:50vh; }
.sheet[data-snap="full"]{ max-height:90vh; }

/* Rebound effect class */
.sheet.rebound{ transition: transform .28s cubic-bezier(.2,1.4,.35,1); }

/* Pulse micro animation */
@keyframes pulse{
  0%{ transform:scale(1); }
  40%{ transform:scale(1.08); }
  100%{ transform:scale(1); }
}
.pulse{ animation:pulse .25s ease-out; }

/* V17: iOS-like snap sheet (50% / 90%) with cart always visible */
.sheet-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.55); display:none; z-index:900; }
.sheet{
  position:fixed; left:0; right:0; bottom:0;
  height:90vh; background:#111; border-radius:24px 24px 0 0;
  box-shadow:0 -10px 40px rgba(0,0,0,.6);
  overflow:auto; z-index:1000;
  transform:translateY(100%);
  transition:transform .38s cubic-bezier(.22,1,.36,1);
  will-change:transform;
}
.sheet.closed{ transform:translateY(100%); }
.sheet.open50{ transform:translateY(40%); }
.sheet.open90{ transform:translateY(5%); }
.sheet-handle{ width:44px; height:5px; background:#555; border-radius:10px; margin:10px auto 14px auto; opacity:.9; }
body{ padding-bottom:140px; }
.cart-item-line{ display:flex; justify-content:space-between; gap:10px; padding:8px 0; border-bottom:1px solid rgba(255,255,255,.06); font-size:14px; }

/* V21 PROD (compat) */
.sheet-overlay{ position:fixed; left:0; right:0; top:0; bottom:0; background:rgba(0,0,0,.55); display:none; z-index:900; }
.sheet{ position:fixed; left:0; right:0; bottom:0; height:90vh; background:#111; border-radius:24px 24px 0 0; box-shadow:0 -10px 40px rgba(0,0,0,.6); overflow:auto; z-index:1000; transform:translateY(100%); transition:transform .28s cubic-bezier(.22,1,.36,1); will-change:transform; }
.sheet.closed{ transform:translateY(100%); }
.sheet.open90{ transform:translateY(0%); }
body.sheet-open{ overflow:hidden; }
