/* ==========================================================================
   Quick — design tokens
   A coastal-campus palette: deep sea teal, cream sand, and a mango-sun
   accent, grounded in IIITV-ICD's setting on Diu island. Fraunces carries
   the display moments; Manrope carries everything you read in a hurry.
   ========================================================================== */
:root {
  --ink:        #0F2A28;
  --sea:        #145C56;
  --sea-deep:   #0B3E3A;
  --sand:       #FBF5E9;
  --sand-dim:   #F2E9D8;
  --card:       #FFFFFF;
  --mango:      #F2A73B;
  --mango-deep: #D98A1F;
  --coral:      #E8613F;
  --line:       #E4D9C2;
  --ink-soft:   #4E6663;
  --ink-faint:  #85968F;
  --shadow:     0 10px 30px -12px rgba(15, 42, 40, 0.28);
  --shadow-sm:  0 2px 10px -4px rgba(15, 42, 40, 0.18);
  --radius-lg:  22px;
  --radius-md:  16px;
  --radius-sm:  10px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--sand);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font-family: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

:focus-visible {
  outline: 2.5px solid var(--mango-deep);
  outline-offset: 2px;
}

/* ---- App shell ----------------------------------------------------------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--sand);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(15, 42, 40, 0.10);
}
.screen { display: none; flex-direction: column; flex: 1; min-height: 100vh; }
.screen.is-active { display: flex; }
.scroll-area { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 96px; }

/* ---- Wave signature -------------------------------------------------------
   A recurring horizon-line motif: the coastline this campus sits on, and a
   visual echo of a delivery "route." Used behind headers and as the
   connector in the tracking timeline. */
.wave-strip { display: block; width: 100%; height: 30px; }
.wave-strip path { fill: var(--sand); }

.hero-band {
  background: linear-gradient(165deg, var(--sea-deep), var(--sea) 65%);
  color: var(--sand);
  padding: 22px 20px 34px;
  position: relative;
}
.hero-band .eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #BFE3DC;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-band h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 27px;
  margin: 6px 0 0;
  line-height: 1.15;
}
.hero-band .sub { color: #CFE7E2; font-size: 14px; margin-top: 6px; }

/* ---- Buttons --------------------------------------------------------------*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 22px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  font-family: var(--font-body);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--mango); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--mango-deep); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost { background: rgba(255,255,255,0.14); color: var(--sand); }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-dark { background: var(--ink); color: var(--sand); }
.link-btn {
  background: none; border: none; color: var(--sea); font-weight: 700; font-size: 14px;
  cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px;
}

/* ---- Cards & layout --------------------------------------------------------*/
.px { padding-left: 20px; padding-right: 20px; }
.section-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin: 26px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card {
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--sand-dim);
  color: var(--ink-soft);
}
.pill.on-campus { background: #E4F3EA; color: #1E7A46; }

/* ---- Location / institution picker ---------------------------------------*/
.locate-screen .hero-band { padding-bottom: 46px; }
.locate-card {
  margin: -28px 16px 0;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  z-index: 2;
}
.locate-status { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--sea);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.inst-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 6px; border-bottom: 1px solid var(--line);
  cursor: pointer; background: none; border-left: none; border-right: none; border-top: none;
  width: 100%; text-align: left;
}
.inst-row:last-child { border-bottom: none; }
.inst-badge {
  width: 42px; height: 42px; border-radius: 12px; background: var(--sand-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--sea); flex-shrink: 0;
}
.inst-name { font-weight: 700; font-size: 14.5px; }
.inst-meta { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.inst-dist { margin-left: auto; text-align: right; font-size: 12px; color: var(--ink-faint); flex-shrink: 0; }

/* ---- Bottom nav ------------------------------------------------------------*/
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 480px;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
}
.nav-btn {
  flex: 1; background: none; border: none; display: flex; flex-direction: column;
  align-items: center; gap: 3px; padding: 6px 4px; color: var(--ink-faint);
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.nav-btn.is-active { color: var(--sea); }
.nav-btn svg { width: 22px; height: 22px; }
.nav-badge {
  position: absolute; margin-left: 14px; margin-top: -3px;
  background: var(--coral); color: #fff; font-size: 9.5px; font-weight: 800;
  border-radius: 999px; min-width: 15px; height: 15px; display: flex;
  align-items: center; justify-content: center; padding: 0 3px;
}

/* ---- Top bar on inner screens ----------------------------------------------*/
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 10px; background: var(--sand); position: sticky; top: 0; z-index: 5;
}
.topbar h2 { font-family: var(--font-display); font-size: 20px; margin: 0; font-weight: 600; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.icon-btn svg { width: 18px; height: 18px; }

.home-header {
  background: linear-gradient(165deg, var(--sea-deep), var(--sea) 70%);
  color: var(--sand); padding: 16px 20px 40px; position: relative;
}
.home-header .row-top { display: flex; align-items: center; justify-content: space-between; }
.campus-chip {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.12);
  padding: 7px 12px 7px 8px; border-radius: 999px; cursor: pointer; border: none; color: var(--sand);
}
.campus-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mango); flex-shrink: 0; }
.campus-chip span { font-size: 12.5px; font-weight: 700; }
.avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; background: var(--mango); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
  border: none; cursor: pointer;
}
.home-header h1 { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin: 18px 0 0; }

/* ---- Category tabs ---------------------------------------------------------*/
.cat-tabs {
  display: flex; gap: 8px; padding: 0 20px; margin-top: -22px; position: relative; z-index: 2;
  overflow-x: auto; scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0; background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--ink-soft);
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 6px;
}
.cat-tab.is-active { background: var(--ink); color: var(--sand); border-color: var(--ink); }

/* ---- Product grid ----------------------------------------------------------*/
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 20px 6px; }
.product-card {
  background: var(--card); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  overflow: hidden; display: flex; flex-direction: column;
}
.product-thumb {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}
.product-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-name { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.product-meta { font-size: 11.5px; color: var(--ink-faint); }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.product-price { font-weight: 800; font-size: 14.5px; }
.veg-dot { width: 9px; height: 9px; border: 1.5px solid #2E8B4E; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center; }
.veg-dot::after { content:''; width: 5px; height: 5px; border-radius: 50%; background: #2E8B4E; }
.veg-dot.non-veg { border-color: var(--coral); }
.veg-dot.non-veg::after { background: var(--coral); }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--mango);
  color: var(--ink); font-weight: 800; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.stepper .qty { font-weight: 800; min-width: 14px; text-align: center; font-size: 13px; }
.add-btn {
  border: 1.5px solid var(--sea); color: var(--sea); background: var(--card);
  border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 12.5px; cursor: pointer;
}

/* ---- Vehicle cards ----------------------------------------------------------*/
.vehicle-list { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 6px; }
.vehicle-card { display: flex; gap: 14px; padding: 14px; align-items: center; }
.vehicle-emoji {
  width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center;
  justify-content: center; font-size: 28px; flex-shrink: 0;
}
.vehicle-name { font-weight: 800; font-size: 15px; }
.vehicle-specs { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.vehicle-rate { font-weight: 800; font-size: 15px; white-space: nowrap; }
.vehicle-rate small { font-weight: 600; color: var(--ink-faint); font-size: 11px; }

/* ---- Cart drawer -------------------------------------------------------------*/
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15,42,40,0.45); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: 100%; max-width: 480px; background: var(--card); z-index: 41;
  border-radius: 22px 22px 0 0; max-height: 86vh; display: flex; flex-direction: column;
  transition: transform 0.28s cubic-bezier(.2,.9,.3,1); box-shadow: 0 -12px 40px rgba(15,42,40,0.3);
}
.drawer.is-open { transform: translate(-50%, 0); }
.drawer-handle { width: 40px; height: 4px; background: var(--line); border-radius: 999px; margin: 10px auto 4px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 20px 12px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-family: var(--font-display); font-size: 18px; margin: 0; }
.drawer-body { overflow-y: auto; padding: 6px 20px; flex: 1; }
.drawer-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

.cart-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: none; }
.cart-line-emoji { font-size: 24px; width: 36px; text-align: center; }
.cart-line-name { font-weight: 700; font-size: 13.5px; }
.cart-line-price { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.cart-empty { text-align: center; padding: 40px 10px; color: var(--ink-faint); }
.cart-empty .big-emoji { font-size: 44px; margin-bottom: 10px; }

.summary-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; color: var(--ink-soft); }
.summary-row.total { font-weight: 800; font-size: 16px; color: var(--ink); padding-top: 10px; border-top: 1px dashed var(--line); margin-top: 6px; }

/* ---- Address / delivery-point picker -----------------------------------------*/
.dp-group-label { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin: 18px 0 8px; }
.dp-row {
  display: flex; align-items: center; gap: 12px; padding: 13px; border: 1.5px solid var(--line);
  border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer; background: var(--card);
}
.dp-row.is-selected { border-color: var(--sea); background: #EEF6F4; }
.dp-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--sand-dim); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.dp-label { font-weight: 700; font-size: 13.5px; }
.dp-detail { font-size: 12px; color: var(--ink-faint); margin-top: 1px; }
.radio-dot { width: 19px; height: 19px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; margin-left: auto; position: relative; }
.dp-row.is-selected .radio-dot { border-color: var(--sea); }
.dp-row.is-selected .radio-dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--sea); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  font-size: 14px; font-family: inherit; background: var(--card); color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--sea); }

.pay-row { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1.5px solid var(--line); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer; }
.pay-row.is-selected { border-color: var(--sea); background: #EEF6F4; }

/* ---- Order tracking -----------------------------------------------------------*/
.track-hero { background: linear-gradient(165deg, var(--sea-deep), var(--sea) 70%); color: var(--sand); padding: 20px 20px 30px; }
.track-hero .status-big { font-family: var(--font-display); font-size: 23px; font-weight: 600; margin-top: 6px; }
.track-hero .order-id { font-size: 12.5px; color: #BFE3DC; letter-spacing: 0.04em; }

.timeline { padding: 4px 4px; }
.tl-step { display: flex; gap: 14px; position: relative; padding-bottom: 26px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-line {
  position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 5px, transparent 5px 10px);
}
.tl-step.is-done .tl-line { background: var(--sea); }
.tl-dot {
  width: 24px; height: 24px; border-radius: 50%; background: var(--sand-dim); border: 2px solid var(--line);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; z-index: 1;
}
.tl-step.is-done .tl-dot { background: var(--sea); border-color: var(--sea); }
.tl-step.is-active .tl-dot { background: var(--mango); border-color: var(--mango); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(242,167,59,0.45); } 50% { box-shadow: 0 0 0 7px rgba(242,167,59,0); } }
.tl-dot svg { width: 12px; height: 12px; }
.tl-label { font-weight: 800; font-size: 14px; padding-top: 2px; }
.tl-time { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.tl-step.is-active .tl-label { color: var(--mango-deep); }

.partner-card { display: flex; align-items: center; gap: 12px; padding: 14px; }
.partner-emoji { width: 44px; height: 44px; border-radius: 50%; background: var(--sand-dim); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.partner-name { font-weight: 800; font-size: 14px; }
.partner-meta { font-size: 12px; color: var(--ink-faint); }

.progress-track { height: 8px; border-radius: 999px; background: var(--sand-dim); overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--sea), var(--mango)); border-radius: 999px; transition: width 0.6s ease; }

/* ---- Orders list ---------------------------------------------------------------*/
.order-row { display: flex; gap: 12px; align-items: center; padding: 14px; cursor: pointer; margin-bottom: 10px; }
.order-row-emoji { width: 44px; height: 44px; border-radius: 12px; background: var(--sand-dim); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.order-row-id { font-weight: 800; font-size: 13.5px; }
.order-row-meta { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.order-status-pill { margin-left: auto; }

/* ---- Empty state ------------------------------------------------------------*/
.empty-state { text-align: center; padding: 60px 30px; color: var(--ink-faint); }
.empty-state .big-emoji { font-size: 46px; margin-bottom: 12px; }
.empty-state h3 { font-family: var(--font-display); color: var(--ink); font-size: 17px; margin: 0 0 6px; }
.empty-state p { font-size: 13.5px; margin: 0 0 16px; }

/* ---- Toast ---------------------------------------------------------------------*/
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--sand); padding: 12px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; z-index: 60; opacity: 0; pointer-events: none;
  transition: all 0.25s ease; box-shadow: var(--shadow); max-width: 90%; text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- Auth sheet ------------------------------------------------------------------*/
.auth-sheet-body { padding: 6px 20px 20px; }
.auth-sheet-body p { color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }

/* ---- Profile screen ---------------------------------------------------------------*/
.profile-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.profile-avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--mango); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; }
.profile-name { font-weight: 800; font-size: 16px; }
.profile-meta { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.menu-row { display: flex; align-items: center; gap: 12px; padding: 15px 4px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.menu-row:last-child { border-bottom: none; }
.menu-row svg { width: 19px; height: 19px; color: var(--ink-faint); }

@media (max-width: 380px) {
  .product-grid { gap: 10px; }
  .home-header h1 { font-size: 21px; }
}
