/* ============================================
   Urban Zayka PWA — Stylesheet
   File: css/style.css
   ============================================ */

/* ---- RESET & BASE ---- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ---- INSTALL BANNER ---- */
.install-banner {
  background: #FFF8E1;
  border-bottom: 1px solid #FFE082;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.install-banner p {
  flex: 1;
  font-size: 12px;
  color: #5D4037;
  line-height: 1.4;
}
.install-banner p strong {
  display: block;
  font-size: 13px;
  color: #4E342E;
  margin-bottom: 2px;
}
.install-btn {
  background: #8B1A1A;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  font-weight: 500;
}
.install-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

/* ---- iOS INSTALL TOOLTIP ---- */
.ios-tooltip {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 14px 14px 0 0;
  padding: 16px 18px 28px;
  z-index: 999;
  display: none;
}
.ios-tooltip.show { display: block; }
.ios-tooltip h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.ios-tooltip p  { font-size: 13px; color: #ccc; line-height: 1.6; }
.ios-tooltip .step { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }
.ios-tooltip .step span { font-size: 22px; }
.ios-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 20px;
  cursor: pointer;
}

/* ---- SCREENS ---- */
.screen { display: none; flex-direction: column; flex: 1; }
.screen.active { display: flex; }

/* ---- HEADER ---- */
.app-header {
  background: #8B1A1A;
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-logo {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.4);
}
.logo-inner { text-align: center; line-height: 1; }
.logo-inner .logo-icon { font-size: 18px; display: block; }
.logo-inner .logo-text { font-size: 7px; font-weight: 700; color: #8B1A1A; display: block; letter-spacing: .3px; }
.logo-inner .logo-sub  { font-size: 5.5px; color: #666; display: block; letter-spacing: .5px; }
.header-center { flex: 1; padding: 0 10px; }
.header-center h1    { font-size: 17px; font-weight: 600; color: #fff; }
.header-center small { font-size: 11px; opacity: .8; display: block; margin-top: 1px; }
.hcart-btn {
  background: rgba(255,255,255,.2);
  border: none; color: #fff;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 13px;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

/* ---- CATEGORY TABS ---- */
.tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  background: #fff;
  position: sticky;
  top: 66px;
  z-index: 99;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap;
  border: 1px solid #ddd;
  background: #f8f8f8;
  color: #666;
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: all .2s;
}
.tab.active { background: #8B1A1A; color: #fff; border-color: #8B1A1A; }

/* ---- MENU LIST ---- */
.menu-list { padding: 6px 12px 100px; flex: 1; }
.sec-title {
  font-size: 11px;
  font-weight: 600;
  color: #8B1A1A;
  margin: 14px 0 7px;
  text-transform: uppercase;
  letter-spacing: .6px;
  border-left: 3px solid #8B1A1A;
  padding-left: 8px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f0f0;
}
.item-emoji {
  width: 50px; height: 50px;
  border-radius: 10px;
  background: #fdf3f3;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.item-info { flex: 1; min-width: 0; }
.item-name  { font-size: 14px; font-weight: 500; color: #1a1a1a; }
.item-sub   { font-size: 11px; color: #999; margin-top: 2px; }
.item-price { font-size: 13px; font-weight: 600; color: #8B1A1A; margin-top: 3px; }
.add-btn {
  background: #8B1A1A; color: #fff;
  border: none; border-radius: 50%;
  width: 30px; height: 30px;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: inherit;
}
.qty-ctrl { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty-ctrl button {
  background: #8B1A1A; color: #fff;
  border: none; border-radius: 50%;
  width: 26px; height: 26px;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.qty-ctrl span { font-size: 14px; font-weight: 600; min-width: 16px; text-align: center; }

/* ---- FLOATING CART BAR ---- */
.float-bar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  background: #8B1A1A; color: #fff;
  border-radius: 14px;
  padding: 13px 18px;
  display: none;
  align-items: center;
  justify-content: space-between;
  cursor: pointer; border: none;
  font-family: inherit;
  margin-bottom: 10px;
  box-shadow: 0 4px 20px rgba(139,26,26,.35);
}
.float-bar.vis { display: flex; }
.float-bar span { font-size: 14px; font-weight: 500; }

/* ---- CART SCREEN ---- */
.cart-header {
  background: #8B1A1A; color: #fff;
  padding: 13px 14px;
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 100;
}
.back-btn {
  background: none; border: none; color: #fff;
  cursor: pointer; font-size: 22px;
  display: flex; align-items: center;
  padding: 0; font-family: inherit;
}
.cart-header h2 { font-size: 16px; font-weight: 600; color: #fff; }
.cart-list { padding: 10px 12px; }
.cart-item {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.ci-name  { font-size: 14px; font-weight: 500; }
.ci-price { font-size: 12px; color: #888; margin-top: 2px; }

/* ---- CART FORM SECTIONS ---- */
.section-block { padding: 12px; }
.sec-label {
  font-size: 11px; font-weight: 600;
  color: #888; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: .5px;
}
.otype-btns { display: flex; gap: 8px; }
.otype-btn {
  flex: 1; padding: 10px 8px;
  border: 1.5px solid #ddd;
  background: #f8f8f8; border-radius: 10px;
  font-size: 13px; cursor: pointer; color: #333;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  font-family: inherit; transition: all .2s;
}
.otype-btn .icon { font-size: 22px; }
.otype-btn.sel { border-color: #8B1A1A; background: #fff5f5; color: #8B1A1A; }
.name-input {
  width: 100%;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border .2s;
}
.name-input:focus { border-color: #8B1A1A; }

/* ---- LOCATION PICKER ---- */
.loc-btn {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #8B1A1A;
  background: #fff5f5;
  border-radius: 10px;
  font-size: 13px; cursor: pointer;
  color: #8B1A1A; font-family: inherit;
  font-weight: 500;
  display: flex; align-items: center;
  justify-content: center; gap: 8px;
  margin-bottom: 10px;
  transition: all .2s;
}
.loc-btn:active { background: #ffe8e8; }
.loc-result {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
  display: none;
}
.loc-result.ok   { background: #e8f5e9; color: #2E7D32; border: 1px solid #A5D6A7; }
.loc-result.warn { background: #FFF8E1; color: #F57F17; border: 1px solid #FFE082; }
.loc-result.err  { background: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }
.dist-note { font-size: 11px; color: #888; text-align: center; margin-top: 4px; }

/* ---- BILL ---- */
.bill-box {
  margin: 0 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
}
.bill-row {
  display: flex; justify-content: space-between;
  padding: 9px 12px;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
  color: #666;
}
.bill-row:last-child { border-bottom: none; font-weight: 600; color: #1a1a1a; font-size: 14px; }

/* ---- CHECKOUT BAR ---- */
.checkout-bar {
  position: sticky; bottom: 0;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #eee;
}
.checkout-btn {
  width: 100%;
  background: #8B1A1A; color: #fff;
  border: none; border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center;
  justify-content: space-between;
  font-family: inherit;
}

/* ---- SUCCESS SCREEN ---- */
.success-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1; gap: 12px;
  padding: 30px 24px; text-align: center;
}
.suc-icon {
  font-size: 64px;
  animation: pop .4s ease;
}
@keyframes pop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.success-wrap h2 { font-size: 22px; font-weight: 600; color: #1a1a1a; }
.success-wrap p  { font-size: 14px; color: #666; line-height: 1.7; }
.wa-open-btn {
  background: #25D366; color: #fff;
  border: none; border-radius: 14px;
  padding: 13px 28px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  margin-top: 8px;
}
.new-order-btn {
  background: #fff;
  border: 1.5px solid #ddd;
  color: #333; border-radius: 14px;
  padding: 11px 24px;
  font-size: 14px; cursor: pointer;
  font-family: inherit;
}
.order-ref { font-size: 12px; color: #aaa; margin-top: 4px; }
