/* ═══════════════════════════════════════════════════════════════
   Olenka Coffee & Roastery — Storefront PWA Styles
   Design tokens matched to mobile app (theme.ts)
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Brand */
  --brand: #C8860A;
  --brand-dark: #A06A05;
  --brand-light: #E8A020;
  --brand-accent: #F0C060;
  /* Backgrounds */
  --bg: #0F0700;
  --bg-secondary: #1A0E05;
  --bg-card: #1E1108;
  --bg-card-hover: #2A1A0D;
  /* Surfaces */
  --glass: rgba(200,134,10,0.08);
  --glass-border: rgba(200,134,10,0.2);
  --glass-border-light: rgba(200,134,10,0.1);
  --overlay: rgba(0,0,0,0.7);
  /* Text */
  --text: #F5E6D0;
  --text-secondary: #B89060;
  --text-muted: #7A5C3A;
  --text-inverse: #0F0700;
  /* Status */
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  /* Spacing */
  --sp-xs: 4px; --sp-sm: 8px; --sp-md: 12px;
  --sp-lg: 16px; --sp-xl: 20px; --sp-xxl: 24px;
  --sp-xxxl: 32px; --sp-section: 40px;
  /* Radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --r-xl: 20px; --r-xxl: 24px; --r-full: 9999px;
  /* Safe area */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}

.hidden { display: none !important; }

/* ─── Splash Screen ─── */
.splash {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.splash.fade-out { opacity: 0; transform: scale(1.05); pointer-events: none; }
.splash-content { text-align: center; }
.splash-logo {
  font-size: 64px;
  animation: float 2s ease-in-out infinite;
}
.splash-brand {
  font-size: 32px; font-weight: 800;
  color: var(--brand); letter-spacing: 6px;
  margin-top: 16px;
}
.splash-sub {
  font-size: 14px; color: var(--text-secondary);
  letter-spacing: 3px; margin-top: 4px;
}
.splash-loader {
  width: 120px; height: 3px;
  background: var(--glass-border-light);
  border-radius: var(--r-full);
  margin: 24px auto 0; overflow: hidden;
}
.loader-bar {
  width: 40%; height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-accent));
  border-radius: var(--r-full);
  animation: loading 1.2s ease-in-out infinite;
}
@keyframes loading { 0%{transform:translateX(-100%)} 100%{transform:translateX(350%)} }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

/* ─── App Shell ─── */
.app-shell { min-height: 100dvh; padding-bottom: 80px; }
.status-bar-spacer { height: var(--sat); }

/* ─── Screens ─── */
.screen { display: none; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ─── Branch Select Screen ─── */
.screen-header {
  padding: var(--sp-lg) var(--sp-xl) var(--sp-md);
}
.header-title {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-sub {
  font-size: 15px; color: var(--text-secondary); margin-top: 2px;
}
.branch-list { padding: 0 var(--sp-xl); }

/* Branch Card */
.branch-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-md);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex; align-items: flex-start; gap: var(--sp-md);
}
.branch-card:hover, .branch-card:active {
  border-color: var(--brand);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200,134,10,0.12);
}
.branch-card-emoji { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.branch-card-info { flex: 1; min-width: 0; }
.branch-card-name {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 2px;
}
.branch-card-address {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.4; margin-bottom: var(--sp-xs);
}
.branch-card-hours {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}
.branch-card-hours .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); display: inline-block;
}
.branch-card-arrow {
  color: var(--brand); font-size: 18px;
  align-self: center; flex-shrink: 0;
}

/* ─── CTA Card ─── */
.cta-card {
  margin: var(--sp-xl);
  padding: var(--sp-xl);
  background: linear-gradient(135deg, rgba(200,134,10,0.12), rgba(200,134,10,0.04));
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  display: flex; align-items: center; gap: var(--sp-lg);
}
.cta-icon { font-size: 32px; flex-shrink: 0; }
.cta-text strong { font-size: 14px; color: var(--text); display: block; }
.cta-text p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.cta-btn {
  background: var(--brand); color: var(--text-inverse);
  border: none; border-radius: var(--r-md);
  padding: var(--sp-sm) var(--sp-lg);
  font-weight: 700; font-size: 13px;
  cursor: pointer; white-space: nowrap;
  transition: background 0.2s;
}
.cta-btn:hover { background: var(--brand-light); }

/* ─── Menu Screen ─── */
.menu-header {
  padding: var(--sp-lg) var(--sp-xl) var(--sp-sm);
}
.back-btn {
  background: none; border: none; color: var(--brand);
  font-size: 15px; cursor: pointer; padding: 0;
  font-family: inherit; display: flex; align-items: center; gap: 4px;
  margin-bottom: var(--sp-md);
}
.back-arrow { font-size: 18px; }
.menu-title { font-size: 28px; font-weight: 800; color: var(--text); }
.menu-branch-name { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* Search Bar */
.search-bar {
  display: flex; align-items: center; gap: var(--sp-sm);
  background: var(--bg-card);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--r-md);
  margin: 0 var(--sp-xl) var(--sp-md);
  padding: 0 var(--sp-md);
}
.search-icon { font-size: 16px; flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; padding: var(--sp-md) 0;
  font-family: inherit;
}
.search-bar input::placeholder { color: var(--text-muted); }

/* Category Tabs */
.category-tabs {
  display: flex; gap: var(--sp-sm);
  padding: 0 var(--sp-xl);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; margin-bottom: var(--sp-lg);
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: var(--sp-sm) var(--sp-lg);
  border-radius: var(--r-full);
  background: var(--bg-card);
  border: 1px solid var(--glass-border-light);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all 0.2s;
}
.cat-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-inverse);
  font-weight: 700;
}

/* Menu Items */
.menu-items { padding: 0 var(--sp-xl) var(--sp-xxxl); }
.menu-item-card {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
}
.menu-item-card:hover {
  border-color: var(--glass-border);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.item-image {
  width: 90px; min-height: 90px;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; flex-shrink: 0;
}
.item-info {
  flex: 1; padding: var(--sp-md);
  display: flex; flex-direction: column;
}
.item-name {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 2px;
}
.item-desc {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.4; margin-bottom: var(--sp-sm);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.item-bottom {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: auto;
}
.item-price {
  font-size: 17px; font-weight: 700; color: var(--brand);
}
.item-badge {
  font-size: 11px; padding: 2px var(--sp-sm);
  border-radius: var(--r-full);
  font-weight: 600;
}
.item-badge.calories {
  background: rgba(200,134,10,0.1);
  color: var(--text-secondary);
}
.item-add-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); border: none;
  color: var(--text-inverse); font-size: 20px;
  font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.item-add-btn:active { transform: scale(0.9); }

/* ─── Detail Screen ─── */
.detail-header { padding: var(--sp-lg) var(--sp-xl) 0; }
.detail-hero {
  width: 100%; height: 220px;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
  margin-bottom: var(--sp-xl);
}
.detail-body { padding: 0 var(--sp-xl) var(--sp-xxxl); }
.detail-name { font-size: 24px; font-weight: 800; margin-bottom: var(--sp-xs); }
.detail-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: var(--sp-lg); }
.detail-price { font-size: 28px; font-weight: 800; color: var(--brand); margin-bottom: var(--sp-xl); }
.detail-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
}
.detail-meta-item {
  background: var(--bg-card); border-radius: var(--r-md);
  padding: var(--sp-md); text-align: center;
  border: 1px solid var(--glass-border-light);
}
.detail-meta-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-meta-value { font-size: 17px; font-weight: 700; color: var(--text); margin-top: 4px; }
.detail-modifiers { margin-bottom: var(--sp-xl); }
.detail-mod-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: var(--sp-sm);
}
.detail-mod-item {
  display: flex; justify-content: space-between;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--bg-card); border-radius: var(--r-sm);
  margin-bottom: var(--sp-xs);
  border: 1px solid var(--glass-border-light);
}
.detail-mod-name { font-size: 14px; color: var(--text); }
.detail-mod-price { font-size: 14px; color: var(--brand); font-weight: 600; }
.detail-order-btn {
  width: 100%; padding: var(--sp-lg);
  background: var(--brand); border: none;
  border-radius: var(--r-lg); color: var(--text-inverse);
  font-size: 16px; font-weight: 700; cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.detail-order-btn:hover { background: var(--brand-light); }

/* ─── Bottom Tab Bar ─── */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: var(--bg);
  border-top: 1px solid var(--glass-border-light);
  display: flex; padding: var(--sp-sm) 0;
  padding-bottom: max(var(--sp-sm), var(--sab));
  z-index: 50;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  cursor: pointer; padding: var(--sp-xs) 0;
  transition: opacity 0.2s;
}
.tab-item .tab-icon { font-size: 20px; }
.tab-item .tab-label {
  font-size: 10px; color: var(--text-muted);
  font-weight: 500;
}
.tab-item.active .tab-label { color: var(--brand); font-weight: 600; }

/* ─── Bottom CTA ─── */
.bottom-cta {
  margin: var(--sp-xl);
  padding: var(--sp-xl);
  background: linear-gradient(135deg, rgba(200,134,10,0.15), rgba(200,134,10,0.05));
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  text-align: center;
}
.bottom-cta-text {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: var(--sp-md);
}
.bottom-cta-btn {
  background: var(--brand); color: var(--text-inverse);
  border: none; border-radius: var(--r-lg);
  padding: var(--sp-md) var(--sp-xxl);
  font-weight: 700; font-size: 15px;
  cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.bottom-cta-btn:hover { background: var(--brand-light); }

/* ─── Empty State ─── */
.empty-state {
  text-align: center; padding: var(--sp-section) 0;
}
.empty-state-emoji { font-size: 48px; margin-bottom: var(--sp-md); }
.empty-state-text { font-size: 15px; color: var(--text-secondary); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 0; }

/* ─── Desktop centered frame ─── */
@media (min-width: 431px) {
  body {
    border-left: 1px solid var(--glass-border-light);
    border-right: 1px solid var(--glass-border-light);
    box-shadow: 0 0 60px rgba(200,134,10,0.05);
  }
}
