:root {
  color-scheme: light;
  --red: #f22f3c;
  --ink: #17181c;
  --muted: #a5a7ae;
  --line: #ececf0;
  --page: #f2f3f7;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

html {
  background: #d9dae0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #d9dae0;
}

button, input { font: inherit; letter-spacing: 0; }
button { color: inherit; cursor: pointer; }

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--page);
  box-shadow: 0 0 45px rgba(13, 15, 20, .16);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.view {
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
}
.view[hidden] { display: none; }

.home-top {
  padding: 14px 17px 17px;
  background: var(--page);
}

.location-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 50px;
}

.location-button {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 0 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 750;
}

.location-button svg { width: 17px; }

.pickup-meta {
  margin: -18px 0 23px;
  color: var(--muted);
  font-size: 13px;
}

.pickup-meta strong { color: #e7434c; font-weight: 700; }

.profile-button {
  position: relative;
  display: grid;
  min-width: 67px;
  height: 54px;
  place-items: start center;
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-button > svg:first-child {
  width: 39px;
  height: 39px;
  padding: 6px;
  border: 1.5px solid var(--red);
  border-radius: 50%;
}

.profile-button span {
  position: absolute;
  top: 31px;
  left: 50%;
  z-index: 2;
  min-width: 69px;
  padding: 4px 17px 4px 7px;
  transform: translateX(-50%);
  border-radius: 12px;
  color: #fff;
  background: var(--red);
  font-size: 10px;
  font-weight: 800;
}

.profile-button .profile-coins {
  position: absolute;
  top: 36px;
  right: 0;
  z-index: 3;
  width: 13px;
  height: 13px;
  color: #fff;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 44px;
  padding: 2px;
  border-radius: 24px;
  background: #fff;
}

.mode-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 22px;
  color: #a2a3a8;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.mode-switch button.is-selected { color: #fff; background: var(--red); }
.mode-switch svg { width: 17px; }

.table-order {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  text-transform: uppercase;
}

.table-order strong { font-size: 15px; }

.table-order span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  border-radius: 22px;
  color: #ea4853;
  background: #fff3f4;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.table-order svg { width: 19px; }

.promos {
  padding: 16px 17px 22px;
  border-radius: 26px 26px 0 0;
  background: #fff;
}

.wine-promo {
  position: relative;
  height: 207px;
  overflow: hidden;
  border-radius: 14px;
  color: #fff;
  background: #030303;
}

.wine-promo img {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: center;
}

.wine-promo::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .2), transparent 56%);
  content: "";
}

.wine-promo-copy {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 27px 20px;
}

.wine-promo h2 {
  margin: 0;
  font-size: 39px;
  line-height: .98;
  letter-spacing: 0;
}

.mini-brand {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 850;
}

.mini-brand svg { width: 25px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  height: 29px;
  align-items: center;
}

.carousel-dots span {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: #e9e9ed;
}

.carousel-dots span.active { width: 30px; background: var(--red); }

.loyalty-promo {
  position: relative;
  display: flex;
  width: 128px;
  height: 150px;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(150deg, #95151a, #e4373c 78%, #ff777a);
  text-align: left;
}

.loyalty-promo::before {
  position: absolute;
  top: 15px;
  left: 14px;
  width: 49px;
  height: 1px;
  background: rgba(255, 255, 255, .4);
  content: "";
}

.loyalty-label {
  padding-top: 10px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.05;
}

.loyalty-promo strong { font-size: 20px; line-height: .96; }

.loyalty-promo svg {
  position: absolute;
  right: 11px;
  bottom: 10px;
  width: 15px;
  opacity: .72;
}

.menu-preview { padding: 0 17px 40px; background: #fff; }

.search-box {
  display: flex;
  height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid #dddde2;
  border-radius: 25px;
  color: #9fa1a8;
}

.search-box svg { width: 20px; }

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.search-box input::placeholder { color: #a7a8ae; }

.category-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 14px -17px 21px;
  padding: 0 17px;
  overflow: hidden;
}

.category-menu, .cart-button {
  display: grid;
  flex: 0 0 40px;
  height: 40px;
  place-items: center;
  border: 0;
  background: transparent;
}

.category-menu svg { width: 25px; }

.category {
  flex: 0 0 auto;
  height: 39px;
  padding: 0 22px;
  border: 0;
  border-radius: 21px;
  background: #f1f2f5;
  font-size: 13px;
  font-weight: 700;
}

.category.is-active { color: #fff; background: var(--red); }

.cart-button {
  position: absolute;
  right: 15px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 9px 25px rgba(28, 30, 36, .12);
}

.cart-button svg { width: 24px; }

.menu-preview > h2 { margin: 0 0 15px; font-size: 23px; }

.dish-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 13px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dish-card .dish-photo {
  grid-row: span 2;
  min-height: 90px;
  border-radius: 6px;
  background: radial-gradient(circle at 37% 42%, #f4d38a 0 7%, #17171a 8% 15%, transparent 16%), radial-gradient(circle at 64% 55%, #e5c173 0 7%, #1a1a1d 8% 16%, transparent 17%), linear-gradient(145deg, #d8d0be, #766e61);
}

.dish-card h3 { margin: 5px 0; font-size: 14px; }
.dish-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.3; }
.dish-card > strong { align-self: end; font-size: 14px; }

.profile-view {
  padding-bottom: calc(34px + env(safe-area-inset-bottom));
  background: var(--page);
}

.profile-header {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  min-height: 63px;
  padding: 4px 15px 0;
  border-radius: 18px 18px 0 0;
  background: #fff;
}

.profile-header h1 { margin: 0; font-size: 22px; }

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.icon-button svg { width: 24px; height: 24px; }

.loyalty-wrap {
  padding: 8px 17px 18px;
  border-radius: 0 0 14px 14px;
  background: #fff;
}

.loyalty-card {
  display: block;
  width: 100%;
  aspect-ratio: 1.66;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  text-align: left;
}

.loyalty-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 16px;
  will-change: transform;
}

.loyalty-card.is-flipping .loyalty-card-inner {
  animation: flip-swap .64s cubic-bezier(.4, 0, .2, 1);
}

@keyframes flip-swap {
  0% {
    transform: scaleX(1);
    transform-origin: right center;
  }

  49% {
    transform: scaleX(.02);
    transform-origin: right center;
  }

  50% {
    transform: scaleX(.02);
    transform-origin: left center;
  }

  100% {
    transform: scaleX(1);
    transform-origin: left center;
  }
}

.card-face {
  position: absolute;
  display: flex;
  width: 100%;
  height: 100%;
  inset: 0;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(110deg, #f0090a 0%, #a50000 48%, #160000 100%);
  opacity: 1;
  visibility: visible;
}

.loyalty-card.is-flipped .card-front {
  opacity: 0;
  visibility: hidden;
}

.card-face::after {
  position: absolute;
  top: 41%;
  right: -8%;
  bottom: -35%;
  left: -15%;
  transform: rotate(-11deg);
  background: rgba(255, 31, 31, .29);
  content: "";
}

.card-front {
  flex-direction: column;
  justify-content: space-between;
  padding: 21px 20px 17px;
}

.card-head, .card-bottom, .level-track { position: relative; z-index: 2; }
.card-head, .card-bottom { display: flex; justify-content: space-between; }
.card-head small { display: block; margin-bottom: 3px; font-size: 13px; }

.card-head > span:first-child b {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(22px, 7vw, 30px);
  line-height: 1;
}

.card-head > span:first-child svg, .back-balance svg { width: 23px; height: 23px; }

.brand-lockup { display: flex; align-items: center; gap: 4px; text-align: center; }
.brand-lockup svg { width: 22px; }
.brand-lockup b { font-size: 10px; line-height: 1; }

.level-track { padding: 0 14px; }

.level-title {
  position: absolute;
  top: -21px;
  left: 88px;
  font-size: 11px;
  font-weight: 800;
}

.progress-line {
  position: relative;
  display: block;
  height: 8px;
  border-radius: 8px;
  background: #fff;
}

.progress-line::before {
  position: absolute;
  top: 50%;
  left: 12%;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  border: 5px solid #fff;
  border-radius: 50%;
  background: #e51b21;
  content: "";
}

.progress-line i {
  position: absolute;
  top: 50%;
  left: 12%;
  width: 19px;
  height: 14px;
  transform: translate(-50%, -50%) rotate(25deg);
  border: 2px solid #fff;
  border-radius: 50% 50% 35% 50%;
}

.level-points, .level-names {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-left: 26%;
  text-align: center;
}

.level-points { margin-top: -13px; }

.level-points b {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  color: #a21013;
  background: #fff;
  font-size: 8px;
}

.level-names small { margin-top: 3px; font-size: 6px; opacity: .7; }
.card-bottom { align-items: flex-end; }
.card-bottom > span:first-child { display: flex; flex-direction: column; }
.card-bottom > span:first-child b { font-size: 24px; }
.card-bottom > span:first-child small { font-size: 13px; }

.barcode-link, .flip-back {
  display: flex;
  min-width: 121px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: rgba(95, 0, 0, .25);
  font-size: 13px;
  font-weight: 700;
}

.barcode-link svg { width: 25px; }

.card-back {
  display: grid;
  grid-template-columns: 1fr 52px;
  grid-template-rows: 1fr 74px;
  gap: 7px 12px;
  padding: 8px 10px 12px;
  opacity: 0;
  visibility: hidden;
}

.loyalty-card.is-flipped .card-back {
  opacity: 1;
  visibility: visible;
}

.barcode-panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: #fff;
}

.barcode-panel svg { width: 94%; height: 100%; }

.back-balance {
  position: relative;
  z-index: 2;
  display: flex;
  align-self: center;
  flex-direction: column;
  padding-left: 9px;
}

.back-balance b { display: flex; align-items: center; gap: 5px; font-size: 21px; }
.back-balance small { margin-top: 4px; font-size: 10px; line-height: 1.35; }

.flip-back {
  position: relative;
  z-index: 2;
  min-width: 52px;
  width: 52px;
  align-self: center;
}

.flip-back svg { width: 24px; }

.flip-hint {
  margin: 9px 0 -5px;
  color: #a8a9ae;
  font-size: 10px;
  text-align: center;
}

.profile-details {
  margin-top: 8px;
  padding: 20px;
  border-radius: 14px;
  background: #fff;
}

.profile-details > div {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.profile-details > div:last-child { margin-bottom: 0; }
.profile-details span { margin-bottom: 3px; color: #aaabb1; font-size: 13px; }
.profile-details strong { font-size: 16px; font-weight: 500; }

.profile-details button {
  position: absolute;
  right: 0;
  bottom: -2px;
  width: 38px;
  height: 38px;
  padding: 6px;
  border: 0;
  color: #c7c8cf;
  background: transparent;
}

.profile-details button svg { width: 22px; }
.card-number-row strong { overflow-wrap: anywhere; }

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
  padding: 11px 0;
  border-radius: 14px;
  background: #fff;
}

.quick-actions button {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  font-size: 11px;
}

.quick-actions button + button { border-left: 1px solid #e7e7eb; }
.quick-actions svg { width: 26px; height: 26px; color: var(--red); }

.profile-menu {
  margin-top: 8px;
  padding: 5px 0;
  border-radius: 14px;
  background: #fff;
}

.profile-menu button {
  display: grid;
  width: 100%;
  min-height: 55px;
  grid-template-columns: 30px minmax(0, 1fr) 22px;
  gap: 9px;
  align-items: center;
  padding: 7px 20px;
  border: 0;
  background: transparent;
  text-align: left;
}

.profile-menu button > svg:first-child, .profile-menu button > svg:last-child {
  width: 21px;
  color: #d5d6dd;
}

.profile-menu button span { font-size: 16px; line-height: 1.22; }
.menu-long button { min-height: 45px; }
.account-menu button:first-child { border-bottom: 1px solid #f2f2f4; }

.profile-view footer {
  padding: 68px 0 20px;
  color: #b3b4ba;
  font-size: 11px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(360px, calc(100vw - 36px));
  padding: 11px 15px;
  transform: translate(-50%, 20px);
  border-radius: 8px;
  color: #fff;
  background: rgba(20, 21, 24, .92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
  font-size: 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(242, 47, 60, .32);
  outline-offset: 2px;
}

@media (max-width: 365px) {
  .home-top, .promos, .menu-preview { padding-right: 12px; padding-left: 12px; }
  .wine-promo { height: 190px; }
  .wine-promo h2 { font-size: 35px; }
  .table-order { padding: 0 10px; }
  .table-order strong { font-size: 13px; }
  .table-order span { padding: 9px; font-size: 9px; }
  .category { padding: 0 17px; }
  .loyalty-wrap { padding-right: 12px; padding-left: 12px; }
  .card-front { padding: 17px 15px 13px; }
  .level-track { transform: scale(.92); }
  .profile-menu button span { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loyalty-card.is-flipping .loyalty-card-inner { animation: none; }
  .toast { transition-duration: .01ms; }
}
