﻿:root {
  --ink-strong: #0d1d46;
  --ink: #24365f;
  --ink-muted: #6e7c98;
  --blue: #1265f3;
  --blue-dark: #0744bb;
  --blue-soft: #eaf2ff;
  --surface: #ffffff;
  --canvas: #f6f9fd;
  --line: #e0e7f1;
  --line-strong: #cad6e5;
  --green: #159b68;
  --orange: #ff7c19;
  --purple: #7557e8;
  --shadow-soft: 0 16px 40px rgba(44, 72, 118, 0.08);
  --shadow-card: 0 7px 22px rgba(48, 82, 129, 0.09);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --focus-ring: 0 0 0 4px rgba(18, 101, 243, 0.18);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink-strong);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink-strong);
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
dialog:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.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;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid rgba(224, 231, 241, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(15px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  min-height: 60px;
  margin: 0 auto;
  padding: 0 36px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-strong);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand__mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--blue);
}

.brand__mark svg {
  width: 2rem;
  height: 2rem;
}

.brand__name {
  font-size: 1.12rem;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.icon-button,
.login-button,
.location-button,
.text-link,
.mobile-nav__item {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.icon-button {
  position: relative;
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-strong);
}

.icon-button:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.icon-button svg {
  width: 1.35rem;
  height: 1.35rem;
}

.notification-dot {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  width: 0.38rem;
  height: 0.38rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
}

.login-button {
  min-width: 4.35rem;
  padding: 0.58rem 1rem;
  border-radius: 0.72rem;
  background: var(--blue);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.login-button:hover {
  background: var(--blue-dark);
  box-shadow: 0 8px 18px rgba(18, 101, 243, 0.22);
}

.mobile-menu-button {
  display: none;
}

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.35rem 36px 3.5rem;
}

.section-kicker {
  margin: 0 0 0.35rem;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink-strong);
  letter-spacing: -0.045em;
}

h1 {
  max-width: none;
  margin-bottom: 0.2rem;
  font-size: clamp(1.7rem, 2.45vw, 2.55rem);
  line-height: 1.16;
}

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 520px;
  min-height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(47, 75, 116, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-form:focus-within {
  border-color: var(--blue);
  box-shadow: var(--focus-ring);
}

.search-form__icon {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  color: var(--ink-muted);
}

.search-form__icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.search-form input {
  min-width: 0;
  flex: 1;
  align-self: stretch;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-strong);
  font-size: 0.92rem;
}

.search-form input::placeholder {
  color: #9ba8ba;
}

.search-submit {
  display: none;
}

.merchant-search-form {
  flex: 0 0 auto;
  min-height: 2.7rem;
  margin: 0 1rem 0.7rem;
}

.merchant-search-form input {
  font-size: 0.78rem;
}

.category-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.category-list {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  gap: 0.55rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.08rem 0.1rem 0.35rem;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.category-list::-webkit-scrollbar {
  display: none;
}

.category-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.2rem;
  padding: 0.37rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.category-chip:hover {
  border-color: #9bbcf9;
  background: var(--blue-soft);
  color: var(--blue);
}

.category-chip.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 7px 14px rgba(18, 101, 243, 0.18);
}

.category-chip__icon {
  display: inline-grid;
  width: 1.1rem;
  height: 1.1rem;
  place-items: center;
  line-height: 1;
}

.category-chip__icon svg {
  width: 1rem;
  height: 1rem;
  stroke-width: 2;
}

.category-more {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
}

.category-more[hidden] {
  display: none;
}

.category-more:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.category-more svg {
  width: 1rem;
  height: 1rem;
}

.map-category-nav {
  position: absolute;
  z-index: 8;
  top: 0.65rem;
  right: 0.65rem;
  left: 0.65rem;
  margin: 0;
  pointer-events: none;
}

.map-category-nav .category-list {
  flex: 1 1 0;
  min-width: 0;
  pointer-events: auto;
}

.map-category-nav .category-chip,
.map-category-nav .category-more {
  pointer-events: auto;
  box-shadow: 0 7px 17px rgba(34, 66, 111, 0.16);
}

.explore-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.85fr);
  align-items: stretch;
  gap: 0.9rem;
  height: clamp(430px, calc(100vh - 280px), 660px);
  height: clamp(430px, calc(100dvh - 280px), 660px);
}

.panel-card,
.support-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.detail-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.map-panel__header,
.support-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.merchant-list {
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.7rem;
  scrollbar-color: #c5d2e4 transparent;
  scrollbar-width: thin;
}

.merchant-list.is-empty {
  align-content: stretch;
}

.merchant-list::-webkit-scrollbar {
  width: 0.38rem;
  height: 0;
}

.merchant-list::-webkit-scrollbar-track {
  background: transparent;
}

.merchant-list::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 999px;
  background: #c5d2e4;
  background-clip: padding-box;
}

.merchant-list::-webkit-scrollbar-thumb:hover {
  background: #9fb4d0;
  background-clip: padding-box;
}

.merchant-item {
  display: grid;
  align-self: start;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.68rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  text-align: left;
}

.merchant-item:hover {
  border-color: #c9dbfa;
  background: #f7faff;
}

.merchant-item.is-selected {
  border-color: #74a4fa;
  background: #f1f6ff;
  box-shadow: inset 0 0 0 1px rgba(18, 101, 243, 0.06);
}

.merchant-avatar,
.store-avatar {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  border-radius: 0.8rem;
  background: var(--avatar-bg, #eaf2ff);
  color: var(--avatar-ink, var(--blue));
  font-weight: 900;
  letter-spacing: -0.08em;
}

.merchant-avatar {
  width: 3.2rem;
  height: 3.2rem;
  font-size: 0.7rem;
}

.merchant-avatar::before,
.store-avatar::before {
  position: absolute;
  right: -0.3rem;
  bottom: -0.75rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.5rem 0.5rem 0 0;
  background: rgba(255, 255, 255, 0.52);
  content: "";
  transform: skewY(-10deg);
}

.merchant-avatar span,
.store-avatar span {
  position: relative;
  z-index: 1;
}

.merchant-avatar__icon {
  display: grid;
  place-items: center;
}

.merchant-avatar__icon svg {
  width: 1.45rem;
  height: 1.45rem;
  stroke-width: 2.1;
}

.store-avatar .merchant-avatar__icon svg {
  width: 1.7rem;
  height: 1.7rem;
}

.merchant-item__body {
  display: block;
  min-width: 0;
  overflow: hidden;
}

.merchant-item__name {
  display: block;
  min-width: 0;
  overflow: hidden;
  margin: 0 0 0.16rem;
  color: var(--ink-strong);
  font-size: 0.84rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-item__meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.28rem;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.merchant-item__meta span:first-child {
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 800;
}

.merchant-item__meta span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-item__distance {
  min-width: 3.45rem;
  color: var(--ink-muted);
  font-size: 0.68rem;
  text-align: right;
  white-space: nowrap;
}

.panel-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: calc(100% - 2.5rem);
  margin: auto 1.25rem 1rem;
  padding: 0.78rem 0.4rem 0.2rem;
  border-top: 1px solid var(--line);
}

.panel-footer-link[hidden] {
  display: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.text-link:hover {
  color: var(--blue-dark);
  transform: translateX(2px);
}

.text-link svg {
  width: 1rem;
  height: 1rem;
}

.empty-state {
  display: grid;
  min-height: 12rem;
  place-items: center;
  padding: 1rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  text-align: center;
}

.map-panel {
  display: flex;
  height: 100%;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.map-panel__header {
  display: grid;
  gap: 0.62rem;
  flex: 0 0 auto;
  padding: 0.85rem 1.05rem 0.7rem;
}

.map-panel__heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.map-stage {
  --map-stage-radius: 1.05rem;
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  overflow: hidden;
  border-radius: var(--map-stage-radius);
  background: #e8f0ef;
  clip-path: inset(0 round var(--map-stage-radius));
  isolation: isolate;
}

.map-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  clip-path: inset(0 round var(--map-stage-radius));
}

.google-map-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: #e8f0ef;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.map-location-button {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  margin: 0.5rem;
  place-items: center;
  border: 1px solid rgba(220, 229, 236, 0.95);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.96);
  color: var(--blue);
  box-shadow: 0 7px 18px rgba(52, 81, 110, 0.18);
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.map-location-button:hover {
  background: var(--blue-soft);
  transform: translateY(-1px);
}

.map-location-button svg {
  width: 1.22rem;
  height: 1.22rem;
}

.map-place-marker {
  position: absolute;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-strong);
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -100%);
  transition: filter 160ms ease, transform 160ms ease;
  will-change: transform;
}

.map-place-marker:hover,
.map-place-marker.is-selected {
  z-index: 2000 !important;
  filter: drop-shadow(0 8px 11px rgba(24, 57, 102, 0.24));
  transform: translate(-50%, -100%) scale(1.08);
}

.map-place-marker__pin {
  position: relative;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--marker-color, var(--blue));
  color: #fff;
  box-shadow: 0 6px 13px rgba(24, 57, 102, 0.28);
  transform: rotate(-45deg);
}

.map-place-marker__pin::before {
  position: absolute;
  inset: -0.38rem;
  border: 2px solid var(--marker-color, var(--blue));
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: rotate(45deg);
}

.map-place-marker.is-selected .map-place-marker__pin::before {
  animation: map-marker-pulse 1.9s ease-out infinite;
}

.map-place-marker__pin svg {
  position: relative;
  z-index: 1;
  width: 1.05rem;
  height: 1.05rem;
  stroke-width: 2.4;
  transform: rotate(45deg);
}

.map-place-marker__label {
  max-width: 9.5rem;
  overflow: hidden;
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(24, 57, 102, 0.2);
  color: var(--ink-strong);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes map-marker-pulse {
  0% {
    opacity: 0.55;
    transform: rotate(45deg) scale(0.7);
  }

  70%,
  100% {
    opacity: 0;
    transform: rotate(45deg) scale(1.45);
  }
}

.detail-panel {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 1.15rem;
}

.detail-sheet-handle {
  display: none;
}

.detail-empty {
  display: grid;
  flex: 1;
  min-height: 20rem;
  place-items: center;
  padding: 2rem;
  color: var(--ink-muted);
  font-size: 0.88rem;
  text-align: center;
}

.detail-store-head {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.store-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 0.95rem;
  font-size: 0.78rem;
}

.detail-store-head__body {
  min-width: 0;
}

.detail-store-head h2 {
  overflow: hidden;
  margin-bottom: 0.24rem;
  font-size: 1.02rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-category {
  display: inline-flex;
  padding: 0.2rem 0.45rem;
  border-radius: 0.38rem;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.65rem;
  font-weight: 800;
}

.detail-close {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
}

.detail-close:hover {
  background: #f1f5fa;
  color: var(--ink-strong);
}

.detail-close svg {
  width: 1.1rem;
  height: 1.1rem;
}

.store-meta-list {
  display: grid;
  gap: 0.48rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.store-meta {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--ink-muted);
  font-size: 0.73rem;
}

.store-meta svg {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  color: var(--blue);
}

.store-meta strong {
  color: var(--ink);
}

.open-status {
  color: var(--green);
  font-weight: 800;
}

.closed-status {
  color: var(--ink-muted);
  font-weight: 800;
}

.detail-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 0 0.68rem;
}

.detail-heading-row h3 {
  margin: 0;
  font-size: 0.9rem;
}

.detail-heading-row .text-link {
  font-size: 0.7rem;
}

.detail-note {
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.offer-list {
  display: grid;
  gap: 0.52rem;
}

.offer-empty {
  padding: 0.85rem 0.7rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: #fbfcfe;
  color: var(--ink-muted);
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

.offer-item {
  display: grid;
  grid-template-columns: 2.3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.58rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfcfe;
}

.offer-logo {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--offer-bg, #15223d);
  color: var(--offer-ink, #fff);
  font-size: 0.56rem;
  font-weight: 900;
  text-align: center;
}

.offer-item__body {
  min-width: 0;
}

.offer-item__title {
  overflow: hidden;
  margin: 0 0 0.12rem;
  color: var(--ink-strong);
  font-size: 0.75rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-item__period {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.62rem;
}

.offer-badge {
  padding: 0.28rem 0.4rem;
  border-radius: 0.4rem;
  background: var(--offer-badge-bg, #eaf2ff);
  color: var(--offer-badge-ink, var(--blue));
  font-size: 0.63rem;
  font-weight: 900;
  white-space: nowrap;
}

.detail-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: auto;
  padding-top: 1rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.7rem;
  padding: 0.55rem 0.8rem;
  border-radius: 0.72rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.primary-button {
  background: var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-dark);
  box-shadow: 0 8px 16px rgba(18, 101, 243, 0.2);
}

.secondary-button {
  border: 1px solid #bdd3f7;
  background: #f8fbff;
  color: var(--blue);
}

.secondary-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.primary-button svg,
.secondary-button svg {
  width: 1rem;
  height: 1rem;
}

.supporting-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.support-card {
  padding: 1.25rem;
}

.support-card__heading {
  align-items: center;
  margin-bottom: 0.95rem;
}

.support-card__heading .text-link {
  white-space: nowrap;
}

.popular-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.popular-item {
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  min-width: 0;
  padding: 0.3rem;
  border-radius: var(--radius-md);
  color: var(--ink);
  text-align: center;
}

.popular-item:hover {
  background: #f4f8ff;
}

.popular-item .merchant-avatar {
  width: 3.25rem;
  height: 3.25rem;
}

.popular-item__name {
  width: 100%;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.67rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommended-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}

.credit-card-tile {
  position: relative;
  display: grid;
  min-height: 5.15rem;
  align-content: space-between;
  padding: 0.65rem;
  overflow: hidden;
  border-radius: 0.8rem;
  background: var(--card-bg, #25324e);
  color: #fff;
  box-shadow: 0 8px 14px rgba(32, 54, 91, 0.14);
}

.credit-card-tile::after {
  position: absolute;
  right: -1.15rem;
  bottom: -1.3rem;
  width: 4.4rem;
  height: 4.4rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  content: "";
}

.credit-card-tile__brand {
  position: relative;
  z-index: 1;
  font-size: 0.58rem;
  font-weight: 900;
}

.credit-card-tile__name {
  position: relative;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 800;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 0.9rem;
  padding: 1rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.feature-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.25rem 0.75rem;
  border-right: 1px solid var(--line);
}

.feature-item:last-child {
  border-right: 0;
}

.feature-item__icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.7rem;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 1.28rem;
  font-weight: 900;
}

.feature-item div {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.feature-item strong {
  color: var(--ink-strong);
  font-size: 0.75rem;
  white-space: nowrap;
}

.feature-item div span {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-nav {
  display: none;
}

.pwa-install-prompt[hidden] {
  display: none;
}

.pwa-install-prompt {
  position: fixed;
  z-index: 42;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink-strong);
  box-shadow: 0 16px 38px rgba(36, 68, 112, 0.2);
  backdrop-filter: blur(16px);
}

.pwa-install-prompt__icon {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border-radius: 0.8rem;
  background: var(--blue-soft);
  color: var(--blue);
}

.pwa-install-prompt__icon svg {
  width: 1.55rem;
  height: 1.55rem;
}

.pwa-install-prompt__body {
  min-width: 0;
}

.pwa-install-prompt__body strong {
  display: block;
  font-size: 0.82rem;
}

.pwa-install-prompt__body p {
  margin: 0.12rem 0 0;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.pwa-install-prompt__actions {
  display: flex;
  gap: 0.45rem;
}

.pwa-install-prompt__actions .primary-button,
.pwa-install-prompt__actions .secondary-button {
  min-height: 2.35rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.7rem;
  white-space: nowrap;
}

.ios-install-dialog {
  width: min(32rem, calc(100% - 1.2rem));
  max-height: calc(100dvh - 1.2rem);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: 0 24px 70px rgba(20, 43, 82, 0.28);
}

.ios-install-dialog::backdrop {
  background: rgba(9, 28, 62, 0.48);
  backdrop-filter: blur(4px);
}

.ios-install-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.ios-install-dialog__header h2 {
  margin: 0.18rem 0 0;
  font-size: 1.05rem;
}

.ios-install-dialog__content {
  max-height: calc(100dvh - 8rem);
  overflow: auto;
  padding: 1rem 1.2rem 1.2rem;
}

.ios-install-dialog__content img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.ios-install-dialog__content ol {
  display: grid;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  padding-left: 1.3rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.offer-dialog {
  width: min(38rem, calc(100% - 2rem));
  max-height: min(38rem, calc(100dvh - 2rem));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: 0 24px 70px rgba(20, 43, 82, 0.24);
}

.offer-dialog::backdrop {
  background: rgba(9, 28, 62, 0.42);
  backdrop-filter: blur(3px);
}

.offer-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.45rem 1rem;
  border-bottom: 1px solid var(--line);
}

.icon-button--light {
  background: #f3f6fb;
}

.offer-dialog__content {
  display: grid;
  gap: 0.7rem;
  max-height: 28rem;
  overflow: auto;
  padding: 1.1rem 1.45rem 1.45rem;
}

.dialog-store-label {
  margin: 0 0 0.2rem;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.dialog-offer-item {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.dialog-offer-item .offer-logo {
  width: 3rem;
  height: 3rem;
}

.dialog-offer-item__title {
  margin: 0 0 0.2rem;
  color: var(--ink-strong);
  font-size: 0.85rem;
  font-weight: 800;
}

.dialog-offer-item__period {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.noscript-message {
  position: fixed;
  z-index: 30;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--ink-strong);
  color: #fff;
  text-align: center;
}

@media (max-width: 1180px) {
  .page-shell {
    padding-right: 24px;
    padding-left: 24px;
  }

  .explore-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    height: auto;
  }

  .map-panel {
    grid-column: 1 / -1;
    grid-row: 1;
    height: clamp(390px, calc(100vh - 255px), 520px);
    height: clamp(390px, calc(100dvh - 255px), 520px);
  }

  .detail-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    height: auto;
    min-height: 500px;
  }

  .map-stage {
    min-height: 0;
  }

  .popular-list,
  .recommended-cards {
    gap: 0.35rem;
  }

  .feature-item {
    gap: 0.45rem;
    padding: 0.25rem 0.5rem;
  }
}

@media (max-width: 820px) {
  .topbar__inner {
    min-height: 60px;
    padding: 0 20px;
  }

  .page-shell {
    padding-top: 1.35rem;
  }

  .supporting-content {
    grid-template-columns: 1fr;
  }

  .feature-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem 0;
  }

  .feature-item:nth-child(3) {
    border-right: 0;
  }

  .feature-item:nth-child(n + 4) {
    margin-top: 0.55rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 4.6rem;
  }

  .topbar__inner {
    padding: 0 16px;
  }

  .brand__name {
    font-size: 1rem;
  }

  .topbar__actions {
    gap: 0.15rem;
  }

  .login-button {
    display: none;
  }

  .mobile-menu-button {
    display: grid;
  }

  .page-shell {
    padding: 1.05rem 14px 2.2rem;
  }

  .search-form {
    min-height: 2.75rem;
  }

  .search-form__icon {
    width: 2.6rem;
    height: 2.55rem;
  }

  .search-form input {
    font-size: 0.8rem;
  }

  .search-submit {
    display: block;
    min-width: 3.2rem;
    margin: 0.27rem;
    border-radius: 0.6rem;
    background: var(--blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
  }

  .category-nav {
    margin-right: -14px;
    margin-bottom: 0.5rem;
    margin-left: -14px;
    padding-left: 14px;
  }

  .map-category-nav {
    top: 0.45rem;
    right: 0.45rem;
    left: 0.45rem;
    margin: 0;
    padding-left: 0;
  }

  .category-list {
    gap: 0.42rem;
    padding-bottom: 0.3rem;
  }

  .category-chip {
    min-height: 2.3rem;
    padding: 0.4rem 0.72rem;
    font-size: 0.72rem;
  }

  .category-more {
    display: grid;
    width: 2rem;
    height: 2rem;
  }

  .explore-layout {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    height: auto;
  }

  .map-panel {
    order: -3;
    height: auto;
  }

  .detail-panel {
    order: -1;
    min-height: 0;
    padding: 0.95rem;
    border-radius: 1.05rem;
  }

  .map-panel__header {
    padding: 0.85rem 0.9rem 0.7rem;
  }

  .map-panel__header {
    gap: 0.5rem;
  }

  .map-panel__header h2 {
    font-size: 1rem;
  }

  .map-stage {
    --map-stage-radius: 0.92rem;
    min-height: 0;
    height: clamp(300px, 44vh, 350px);
    height: clamp(300px, 44dvh, 350px);
    flex: 0 0 auto;
    margin: 0;
  }

  .map-location-button {
    width: 2.3rem;
    height: 2.3rem;
  }

  .map-place-marker__pin {
    width: 2rem;
    height: 2rem;
  }

  .map-place-marker__label {
    max-width: 7.2rem;
    font-size: 0.58rem;
  }

  .detail-store-head {
    grid-template-columns: 3.65rem minmax(0, 1fr) auto;
  }

  .store-avatar {
    width: 3.65rem;
    height: 3.65rem;
  }

  .detail-store-head h2 {
    font-size: 0.94rem;
  }

  .detail-actions {
    grid-template-columns: 1fr 1fr;
  }

  .supporting-content,
  .feature-strip {
    display: none;
  }

  .pwa-install-prompt {
    right: 0.7rem;
    bottom: calc(4.7rem + env(safe-area-inset-bottom, 0px));
    left: 0.7rem;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .pwa-install-prompt__actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ios-install-dialog {
    max-height: calc(100dvh - 1rem);
  }

  .ios-install-dialog__header {
    padding: 0.9rem 1rem 0.75rem;
  }

  .ios-install-dialog__content {
    max-height: calc(100dvh - 6.8rem);
    padding: 0.8rem 1rem 1rem;
  }

  .mobile-nav {
    position: fixed;
    z-index: 12;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 4.25rem;
    padding: 0.42rem 0.55rem calc(0.42rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -8px 24px rgba(43, 71, 112, 0.08);
    backdrop-filter: blur(15px);
  }

  .mobile-nav__item {
    position: relative;
    display: grid;
    place-items: center;
    gap: 0.18rem;
    min-height: 3.35rem;
    padding: 0.2rem 0.1rem;
    border-radius: 0.7rem;
    background: transparent;
    color: var(--ink-muted);
    font-size: 0.62rem;
    font-weight: 700;
  }

  .mobile-nav__item.is-active,
  .mobile-nav__item:hover {
    color: var(--blue);
  }

  .mobile-nav__icon {
    display: grid;
    width: 2rem;
    height: 1.8rem;
    place-items: center;
    border-radius: 0.65rem;
    color: currentColor;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
  }

  .mobile-nav__icon svg {
    width: 1.35rem;
    height: 1.35rem;
    stroke-width: 1.9;
  }

  .mobile-nav__item.is-active .mobile-nav__icon {
    background: var(--blue-soft);
    color: var(--blue);
  }

  .mobile-nav__item:active .mobile-nav__icon {
    transform: scale(0.92);
  }

  .offer-dialog {
    width: calc(100% - 1.2rem);
    max-height: calc(100dvh - 1.2rem);
    border-radius: 1.1rem;
  }

  .offer-dialog__header {
    padding: 1.05rem 1rem 0.85rem;
  }

  .offer-dialog__content {
    max-height: calc(100dvh - 8rem);
    padding: 0.9rem 1rem 1rem;
  }

}

@media (max-width: 1024px) and (orientation: portrait), (max-width: 640px) {
  body {
    overflow: hidden;
    padding-bottom: 0;
  }

  .topbar {
    position: relative;
    z-index: 25;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .topbar__inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .login-button {
    display: none;
  }

  .mobile-menu-button {
    display: grid;
  }

  .page-shell {
    padding: 0;
  }

  .pwa-install-prompt {
    right: 0.7rem;
    bottom: calc(4.7rem + env(safe-area-inset-bottom, 0px));
    left: 0.7rem;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .pwa-install-prompt__actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .explore-layout {
    position: relative;
    display: block;
    width: 100%;
    height: calc(100vh - 60px - env(safe-area-inset-top, 0px));
    min-height: calc(100vh - 60px - env(safe-area-inset-top, 0px));
    height: calc(100dvh - 60px - env(safe-area-inset-top, 0px));
    min-height: calc(100dvh - 60px - env(safe-area-inset-top, 0px));
    overflow: hidden;
  }

  .map-panel {
    position: absolute;
    z-index: 1;
    inset: 0;
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
    display: block;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .map-panel__header {
    display: none;
  }

  .map-stage {
    --map-stage-radius: 0;
    height: 100%;
    min-height: 0;
    flex: none;
    border-radius: 0;
    clip-path: none;
  }

  .map-viewport,
  .google-map-canvas {
    border-radius: 0;
    clip-path: none;
  }

  .detail-panel {
    position: absolute;
    z-index: 20;
    right: 0;
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
    left: 0;
    display: flex;
    height: auto;
    max-height: min(70vh, 36rem);
    max-height: min(70dvh, 36rem);
    min-height: 0;
    padding: 0.72rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 1.25rem 1.25rem 0 0;
    background: var(--surface);
    box-shadow: 0 -16px 38px rgba(25, 53, 95, 0.24);
    transform: translateY(0);
    transition: transform 220ms ease, visibility 220ms ease;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
  }

  .detail-sheet-handle {
    display: block;
    width: 2.8rem;
    height: 0.28rem;
    flex: 0 0 auto;
    margin: 0 auto 0.72rem;
    border-radius: 999px;
    background: #c8d2e0;
    content: "";
    cursor: grab;
    touch-action: none;
  }

  .detail-sheet-handle:active {
    background: #9eafc4;
    cursor: grabbing;
  }

  .detail-store-head {
    touch-action: none;
  }

  .detail-panel.is-mobile-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 1.5rem));
  }

  .detail-panel.is-dragging {
    touch-action: none;
    user-select: none;
    transition: none;
  }

  .detail-empty {
    min-height: 8rem;
    flex: 0 0 auto;
    padding: 1.5rem;
  }

  .detail-store-head {
    grid-template-columns: 3.65rem minmax(0, 1fr) auto;
  }

  .store-avatar {
    width: 3.65rem;
    height: 3.65rem;
  }

  .detail-store-head h2 {
    font-size: 0.95rem;
  }

  .detail-actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 1rem;
  }

  .supporting-content,
  .feature-strip {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    z-index: 24;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 4.25rem;
    padding: 0.42rem 0.55rem calc(0.42rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 24px rgba(43, 71, 112, 0.1);
    backdrop-filter: blur(15px);
  }

  .mobile-nav__item {
    position: relative;
    display: grid;
    place-items: center;
    gap: 0.18rem;
    min-height: 3.35rem;
    padding: 0.2rem 0.1rem;
    border-radius: 0.7rem;
    background: transparent;
    color: var(--ink-muted);
    font-size: 0.62rem;
    font-weight: 700;
  }

  .mobile-nav__item.is-active,
  .mobile-nav__item:hover {
    color: var(--blue);
  }

  .mobile-nav__icon {
    display: grid;
    width: 2rem;
    height: 1.8rem;
    place-items: center;
    border-radius: 0.65rem;
    color: currentColor;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
  }

  .mobile-nav__icon svg {
    width: 1.35rem;
    height: 1.35rem;
    stroke-width: 1.9;
  }

  .mobile-nav__item.is-active .mobile-nav__icon {
    background: var(--blue-soft);
    color: var(--blue);
  }

  .mobile-nav__item:active .mobile-nav__icon {
    transform: scale(0.92);
  }
}

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