/* ============================================================
   TRADICIONAL COCINA — Premium PWA Stylesheet
   ============================================================ */

/* ── Google Fonts (fallback if offline) ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ── */
:root {
  --red:        #e31e24;
  --red-dark:   #b01618;
  --red-light:  #ff4a50;
  --green:      #28a745;
  --green-dark: #1e8035;
  --white:      #ffffff;
  --off-white:  #f8f8f6;
  --text:       #1a1a1a;
  --text-mid:   #555;
  --text-soft:  #888;
  --border:     #e8e8e8;
  --card-bg:    #ffffff;
  --nav-height: 68px;
  --header-height: 72px;
  --radius:     16px;
  --radius-sm:  10px;
  --shadow-card: 0 4px 20px rgba(0,0,0,.08);
  --shadow-float: 0 8px 32px rgba(0,0,0,.16);
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--off-white);
  color: var(--text);
  min-height: 100dvh;
  overscroll-behavior: none;
}
img { max-width: 100%; display: block; }
input, select, button { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ── Utilities ── */
.hidden { display: none !important; }

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
#splash-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(160deg, #1a0505 0%, #3d0808 50%, #1a0505 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease, transform .5s ease;
}
#splash-screen.fade-out {
  opacity: 0;
  transform: scale(.96);
  pointer-events: none;
}
.splash-inner {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center; padding: 40px 24px;
}
.splash-logo {
  width: 100px; height: 100px; border-radius: 24px;
  box-shadow: 0 12px 40px rgba(227,30,36,.45);
  animation: splashPop .6s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes splashPop {
  from { opacity: 0; transform: scale(.6); }
  to   { opacity: 1; transform: scale(1); }
}
.splash-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 700;
  color: #fff;
  animation: fadeUp .5s .2s both;
}
.splash-subtitle {
  font-size: 14px; color: rgba(255,255,255,.65);
  animation: fadeUp .5s .35s both;
}
.splash-loader {
  width: 160px; height: 3px;
  background: rgba(255,255,255,.15); border-radius: 8px;
  margin-top: 24px; overflow: hidden;
  animation: fadeUp .5s .45s both;
}
.loader-bar {
  height: 100%; width: 0; border-radius: 8px;
  background: linear-gradient(90deg, var(--red), var(--red-light));
  animation: loadBar 1.8s .5s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes loadBar { to { width: 100%; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   APP WRAPPER
   ============================================================ */
#app {
  min-height: 100dvh;
  padding-bottom: var(--nav-height);
}

/* ── Views ── */
.view { display: none; min-height: 100dvh; }
.view.active { display: block; animation: viewIn .25s ease; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-height);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  /* Safe area for iOS home indicator */
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 8px 4px;
  color: var(--text-soft);
  position: relative;
  transition: color var(--transition);
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn span { font-size: 10px; font-weight: 500; letter-spacing: .3px; }
.nav-btn.active { color: var(--red); }
.nav-btn.active::after {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--red);
}
.nav-badge {
  position: absolute; top: 6px; right: calc(50% - 18px);
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

/* ============================================================
   VIEW HEADER
   ============================================================ */
.view-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}
.view-header-inner { display: flex; align-items: center; justify-content: space-between; }
.view-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 700; color: var(--text);
}
.view-subtitle { font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.section-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-soft);
  margin-bottom: 12px;
}

/* ── Header Loyalty Badge ── */
.header-loyalty-badge {
  display: flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, #fffbea, #fff8d0);
  border: 1.5px solid #f0c030;
  color: #b8860b; border-radius: 20px;
  padding: 6px 12px; font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.header-loyalty-badge:active { transform: scale(.95); }
.header-loyalty-badge svg { width: 16px; height: 16px; fill: #f0c030; }

/* ============================================================
   LOGIN VIEW
   ============================================================ */
#login-view {
  background: var(--off-white);
  min-height: 100dvh;
  padding-bottom: 32px;
}
.login-hero {
  position: relative; height: 260px; overflow: hidden;
  background: linear-gradient(160deg, #1a0505 0%, #3d0808 100%);
}
.login-hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: url('hero-bg.png') center/cover no-repeat;
  opacity: .25;
}
.login-hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, rgba(60,8,8,.4) 0%, rgba(26,5,5,.85) 100%);
}
.login-hero-content {
  position: relative; z-index: 2;
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 16px;
  text-align: center;
}
.login-logo {
  width: 72px; height: 72px; border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  margin-bottom: 12px;
}
.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 30px; font-weight: 700; line-height: 1.1;
  color: #fff; letter-spacing: -.3px;
}
.login-title span { color: var(--red-light); }
.login-tagline { font-size: 13px; color: rgba(255,255,255,.65); margin-top: 6px; }

.login-form-container {
  background: var(--white);
  border-radius: 28px 28px 0 0;
  margin-top: -24px;
  padding: 28px 24px 32px;
  position: relative; z-index: 3;
  box-shadow: 0 -4px 30px rgba(0,0,0,.08);
  min-height: calc(100dvh - 236px);
}
.form-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px; font-weight: 700;
  color: var(--text); margin-bottom: 4px;
}
.form-subtitle { font-size: 14px; color: var(--text-soft); margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--text-mid); text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px;
}
.form-group label svg { width: 14px; height: 14px; flex-shrink: 0; }
.form-group .optional { color: var(--text-soft); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; }
.form-group input, .form-group select {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--off-white);
  font-size: 15px; color: var(--text);
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(227,30,36,.12);
}
.form-group select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.form-hint { font-size: 12px; color: var(--green); margin-top: 6px; }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 15px 24px; font-size: 15px; font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  box-shadow: 0 4px 18px rgba(227,30,36,.35);
}
.btn-primary:active { transform: scale(.97); filter: brightness(.95); }
.btn-primary svg { width: 18px; height: 18px; }
.btn-full { width: 100%; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--off-white);
  color: var(--text-mid); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 24px;
  font-size: 14px; font-weight: 500;
  transition: background var(--transition);
}
.btn-secondary:active { background: var(--border); }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff5f5; color: var(--red);
  border: 1.5px solid #ffcdd0; border-radius: var(--radius-sm);
  padding: 14px 24px; font-size: 14px; font-weight: 600;
  transition: background var(--transition);
}
.btn-danger:active { background: #ffe0e0; }
.btn-danger svg { width: 16px; height: 16px; }

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c5f 100%);
  box-shadow: 0 4px 18px rgba(37,211,102,.3);
}
.btn-whatsapp:active { filter: brightness(.93); }

.login-benefits {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 20px; justify-content: center;
}
.benefit-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--off-white); border: 1px solid var(--border);
  border-radius: 20px; padding: 7px 14px;
  font-size: 12px; font-weight: 500; color: var(--text-mid);
}

/* ============================================================
   MENU VIEW
   ============================================================ */
#menu-view { background: var(--off-white); }

/* Category Filter */
.category-filter {
  display: flex; gap: 8px; padding: 14px 20px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-filter::-webkit-scrollbar { display: none; }
.category-chip {
  flex-shrink: 0; padding: 8px 18px;
  border: 1.5px solid var(--border); border-radius: 20px;
  background: #fff; font-size: 13px; font-weight: 500; color: var(--text-mid);
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.category-chip.active {
  background: var(--red); border-color: var(--red);
  color: #fff; box-shadow: 0 3px 12px rgba(227,30,36,.3);
}

/* Menu Grid */
.menu-grid { padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }
.menu-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden; cursor: pointer;
  display: flex; gap: 0;
  border: 1px solid rgba(0,0,0,.04);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: cardIn .3s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.menu-card:active { transform: scale(.98); box-shadow: var(--shadow-float); }
.menu-card-emoji {
  width: 100px; min-height: 100px; flex-shrink: 0;
  background: linear-gradient(135deg, #fff5f5, #ffe8e8);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; user-select: none;
}
.menu-card-body {
  flex: 1; padding: 14px 14px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.menu-card-cat {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .8px; color: var(--red);
}
.menu-card-name {
  font-size: 16px; font-weight: 700; color: var(--text);
  line-height: 1.25;
}
.menu-card-desc { font-size: 12px; color: var(--text-soft); line-height: 1.4; }
.menu-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
}
.menu-card-price { font-size: 18px; font-weight: 700; color: var(--red); }
.menu-card-add {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: #fff; font-size: 20px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(227,30,36,.3);
  transition: transform var(--transition);
}
.menu-card-add:active { transform: scale(.9); }
.menu-bottom-pad { height: calc(var(--nav-height) + 80px); }

/* ============================================================
   ITEM MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
  animation: overlayIn .2s ease;
  backdrop-filter: blur(4px);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%; max-width: 480px;
  background: #fff; border-radius: 28px 28px 0 0;
  padding: 28px 24px calc(32px + env(safe-area-inset-bottom, 0));
  position: relative;
  animation: modalSlide .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalSlide {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--off-white); color: var(--text-mid);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  border: none;
}
.modal-emoji { font-size: 64px; text-align: center; margin-bottom: 16px; }
.modal-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 700; color: var(--text);
  margin-bottom: 6px;
}
.modal-desc { font-size: 14px; color: var(--text-soft); line-height: 1.6; margin-bottom: 20px; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.modal-tag {
  background: var(--off-white); color: var(--text-mid);
  border-radius: 20px; padding: 5px 12px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border);
}
.modal-price-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.modal-price { font-size: 26px; font-weight: 700; color: var(--red); }
.modal-note-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-mid); margin-bottom: 8px; }
.modal-note-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--off-white); font-size: 14px; color: var(--text);
  outline: none; margin-bottom: 18px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.modal-note-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,30,36,.12); background: #fff; }
.modal-qty-row {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin-bottom: 20px;
}
.qty-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--off-white); border: 1.5px solid var(--border);
  font-size: 20px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.qty-btn:active { background: var(--border); }
.qty-value { font-size: 22px; font-weight: 700; min-width: 32px; text-align: center; }
.modal-add-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);
  color: #fff; border-radius: var(--radius-sm);
  padding: 15px; font-size: 16px; font-weight: 700;
  border: none; box-shadow: 0 4px 18px rgba(227,30,36,.3);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform var(--transition), filter var(--transition);
}
.modal-add-btn:active { transform: scale(.97); filter: brightness(.95); }

/* ============================================================
   CART VIEW
   ============================================================ */
#cart-view { background: var(--off-white); }
.clear-cart-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff5f5; border: 1px solid #ffcdd0;
  color: var(--red); display: flex; align-items: center; justify-content: center;
}
.clear-cart-btn svg { width: 16px; height: 16px; }

/* Cart empty state */
.cart-empty {
  text-align: center; padding: 60px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.cart-empty-icon { font-size: 64px; }
.cart-empty h3 { font-size: 18px; font-weight: 700; color: var(--text); }
.cart-empty p { font-size: 14px; color: var(--text-soft); }
.cart-empty .btn-primary { margin-top: 8px; }

/* Cart items */
.cart-item-card {
  background: var(--white); border-radius: var(--radius);
  margin: 0 16px 10px; padding: 14px;
  box-shadow: var(--shadow-card); border: 1px solid rgba(0,0,0,.04);
  display: flex; gap: 12px; align-items: flex-start;
}
.cart-item-emoji { font-size: 32px; line-height: 1; flex-shrink: 0; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name { font-size: 15px; font-weight: 600; color: var(--text); }
.cart-item-note { font-size: 12px; color: var(--text-soft); margin-top: 2px; font-style: italic; }
.cart-item-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.cart-item-price { font-size: 16px; font-weight: 700; color: var(--red); }
.cart-item-remove {
  width: 28px; height: 28px; border-radius: 8px;
  background: #fff5f5; display: flex; align-items: center; justify-content: center;
  color: var(--red); font-size: 13px; flex-shrink: 0;
  border: 1px solid #ffcdd0;
}

/* Delivery section */
.delivery-section { padding: 16px 16px 0; }
.delivery-section h3 { margin-bottom: 12px; }

/* Order summary */
.order-summary {
  margin: 16px 16px 0; background: var(--white);
  border-radius: var(--radius); border: 1px solid rgba(0,0,0,.04);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-row .label { font-size: 14px; color: var(--text-mid); }
.summary-row .value { font-size: 15px; font-weight: 600; color: var(--text); }
.summary-row.total .label { font-size: 16px; font-weight: 700; color: var(--text); }
.summary-row.total .value { font-size: 20px; font-weight: 800; color: var(--red); }
.summary-row.discount .value { color: var(--green); }

.cart-actions { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

/* Cart FAB */
.cart-fab {
  position: fixed; bottom: calc(var(--nav-height) + 12px); right: 16px; z-index: 150;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);
  color: #fff; border-radius: 28px;
  padding: 13px 18px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 6px 24px rgba(227,30,36,.45);
  border: none;
  animation: fabBounce .4s cubic-bezier(.34,1.56,.64,1);
  transition: transform var(--transition);
}
.cart-fab:active { transform: scale(.95); }
@keyframes fabBounce { from { transform: scale(0); } to { transform: scale(1); } }
.cart-fab svg { width: 20px; height: 20px; }
.fab-badge {
  background: #fff; color: var(--red);
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.fab-total { font-size: 15px; font-weight: 700; }

/* ============================================================
   LOYALTY VIEW
   ============================================================ */
#loyalty-view { background: var(--off-white); }
.loyalty-hero {
  padding: 32px 20px 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.loyalty-circle-container {
  position: relative; width: 160px; height: 160px;
  margin-bottom: 20px;
}
.loyalty-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #f0f0f0; stroke-width: 10; }
.ring-progress {
  fill: none; stroke: url(#ringGradient);
  stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 0 6px rgba(227,30,36,.4));
}
.loyalty-circle-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.loyalty-count { font-size: 40px; font-weight: 800; color: var(--text); line-height: 1; }
.loyalty-label { font-size: 13px; font-weight: 500; color: var(--text-soft); }
.loyalty-free-badge {
  background: linear-gradient(135deg, #28a745, #20c050);
  color: #fff; border-radius: 20px; padding: 10px 20px;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(40,167,69,.35);
  margin-bottom: 12px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(40,167,69,.35); }
  50%       { box-shadow: 0 4px 28px rgba(40,167,69,.6); }
}
.loyalty-description { font-size: 14px; color: var(--text-soft); max-width: 260px; }

/* Stamps grid */
.loyalty-stamps {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px; padding: 0 20px 24px;
}
.stamp {
  aspect-ratio: 1; border-radius: 12px;
  background: var(--white); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; box-shadow: var(--shadow-card);
  transition: transform var(--transition);
}
.stamp.filled {
  background: linear-gradient(135deg, #fff5f5, #ffe0e0);
  border-color: #ffcdd0;
}
.stamp.filled::content { animation: stampIn .3s ease; }

/* Info cards */
.loyalty-info-cards { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.info-card {
  background: var(--white); border-radius: var(--radius);
  padding: 16px; display: flex; gap: 14px; align-items: flex-start;
  box-shadow: var(--shadow-card); border: 1px solid rgba(0,0,0,.04);
}
.info-card.accent-green { border-left: 4px solid var(--green); }
.info-card-icon { font-size: 28px; flex-shrink: 0; }
.info-card h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.info-card p { font-size: 13px; color: var(--text-soft); line-height: 1.5; }
.info-card strong { color: var(--text); }

/* ============================================================
   PROFILE VIEW
   ============================================================ */
#profile-view { background: var(--off-white); }
.profile-avatar-section {
  padding: 28px 20px 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.avatar-circle {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: #fff;
  box-shadow: 0 6px 20px rgba(227,30,36,.35);
  margin-bottom: 8px;
}
#profile-name-display { font-size: 20px; font-weight: 700; color: var(--text); }
#profile-phone-display { font-size: 14px; color: var(--text-soft); }

.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 0 16px 20px;
}
.stat-card {
  background: var(--white); border-radius: var(--radius);
  padding: 14px 8px; text-align: center;
  box-shadow: var(--shadow-card); border: 1px solid rgba(0,0,0,.04);
  display: flex; flex-direction: column; gap: 4px;
}
.stat-value { font-size: 24px; font-weight: 800; color: var(--red); }
.stat-label { font-size: 11px; color: var(--text-soft); font-weight: 500; }

.profile-section {
  padding: 0 16px 20px;
}
.profile-section h3 { margin-bottom: 14px; }

.about-card {
  background: var(--white); border-radius: var(--radius);
  padding: 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-card); border: 1px solid rgba(0,0,0,.04);
}
.about-logo { width: 48px; height: 48px; border-radius: 12px; }
.about-name { font-size: 15px; font-weight: 700; color: var(--text); }
.about-version { font-size: 12px; color: var(--text-soft); margin-top: 3px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: calc(var(--nav-height) + 16px); left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #1a1a1a; color: #fff;
  padding: 12px 22px; border-radius: 24px;
  font-size: 14px; font-weight: 500;
  z-index: 600; white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
  animation: toastIn .3s ease;
  max-width: calc(100vw - 40px);
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   SVG gradient for loyalty ring
   ============================================================ */
svg defs { display: none; }

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ============================================================
   PWA OVERSCROLL / STATUS BAR
   ============================================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  .view-header { padding-top: max(16px, env(safe-area-inset-top)); }
  #login-view .login-hero { padding-top: env(safe-area-inset-top); height: calc(260px + env(safe-area-inset-top)); }
}

/* ============================================================
   RESPONSIVE — wider screens
   ============================================================ */
@media (min-width: 480px) {
  #app { max-width: 480px; margin: 0 auto; }
  #bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .cart-fab { right: max(16px, calc(50% - 240px + 16px)); }
  .toast { bottom: calc(var(--nav-height) + 24px); }
}

@media (prefers-color-scheme: dark) {
  /* Opt-out: keep the light brand feel on all devices */
}

/* ============================================================
   OFFLINE BANNER & PWA INSTALL
   ============================================================ */
.offline-banner {
  background: #323232;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 1001;
  border-bottom: 2px solid var(--red);
  animation: slideDown .3s ease;
}
.offline-banner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.install-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow-card);
  border: 1.5px solid var(--border);
}
.install-card-icon {
  font-size: 32px;
  background: var(--off-white);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.install-card-content {
  flex: 1;
}
.install-card-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.install-card-content p {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 16px;
  line-height: 1.4;
}
