:root {
  color-scheme: light;
  --page: #e8edf3;
  --app: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe4ec;
  --blue: #1169a8;
  --blue-dark: #083a5c;
  --red: #c9362f;
  --yellow: #f4bd2a;
  --green: #16834a;
  --shadow: 0 22px 70px rgba(15, 23, 42, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 22% 0%, rgba(17, 105, 168, 0.14), transparent 32%),
    linear-gradient(180deg, #f6f8fb 0%, var(--page) 100%);
  color: var(--ink);
}

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

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 96px;
  overflow: hidden;
  background: var(--app);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px 12px;
  background: rgba(248, 250, 252, 0.94);
  border-bottom: 1px solid rgba(219, 228, 236, 0.76);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  overflow: hidden;
  place-items: center;
  border: 1px solid #cdd9e3;
  border-radius: 8px;
  background: var(--blue-dark);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text {
  min-width: 0;
}

.brand-text strong,
.hero-caption strong,
.section-title h2,
.item-title,
.service-panel h2,
.empty-state h2 {
  overflow-wrap: anywhere;
}

.brand-text strong {
  display: block;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.05;
}

.brand-text span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-action {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--blue-dark);
}

.app-hero {
  padding: 14px 14px 0;
}

.product-hero {
  position: relative;
  min-height: 196px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--blue-dark);
  color: #fff;
}

.hero-carousel {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-track {
  display: flex;
  width: max-content;
  gap: 10px;
  padding: 12px 12px 52px;
  animation: hero-scroll 36s linear infinite;
  will-change: transform;
}

.product-hero:hover .hero-track {
  animation-play-state: paused;
}

.hero-slide {
  position: relative;
  flex: 0 0 128px;
  height: 138px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: #dbe6ef;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.hero-slide:nth-child(2n) {
  transform: translateY(8px);
}

.hero-slide:nth-child(3n) {
  transform: translateY(-5px);
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-price,
.hero-title {
  position: absolute;
  z-index: 2;
  left: 8px;
  right: 8px;
}

.hero-price {
  top: 8px;
  right: auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
}

.hero-title {
  display: none;
}

.hero-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  max-width: none;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-top: 1px solid rgba(135, 189, 222, 0.36);
  background:
    linear-gradient(90deg, rgba(232, 246, 255, 0.72), rgba(204, 230, 247, 0.54), rgba(245, 251, 255, 0.66));
  color: var(--blue-dark);
  backdrop-filter: blur(10px);
  pointer-events: none;
  text-shadow: none;
}

.hero-caption strong {
  display: block;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.1;
}

.hero-caption span {
  display: block;
  min-width: 0;
  color: rgba(8, 58, 92, 0.78);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
}

@keyframes hero-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.content {
  padding: 16px 14px 28px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 12px;
}

.section-title > div {
  min-width: 0;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.section-title span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
}

.category-filter {
  display: inline-flex;
  min-width: 130px;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.category-filter span {
  color: var(--muted);
  font-size: 12px;
}

.category-filter select {
  max-width: 154px;
  min-height: 38px;
  padding: 0 33px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, var(--blue-dark) 50%) right 14px center / 6px 6px no-repeat,
    linear-gradient(135deg, var(--blue-dark) 50%, transparent 50%) right 9px center / 6px 6px no-repeat,
    var(--surface);
  color: var(--ink);
  font: inherit;
  appearance: none;
}

.item-rail {
  display: grid;
  grid-auto-columns: 39%;
  grid-auto-flow: column;
  gap: 12px;
  margin: 0 -14px;
  padding: 0 14px 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.item-rail::-webkit-scrollbar {
  display: none;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.item-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  scroll-snap-align: start;
}

.item-card[hidden] {
  display: none;
}

.item-media {
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(135deg, #dfe8ef, #f4f7fa);
}

.item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-rail .item-media {
  aspect-ratio: 1 / 0.78;
}

.item-body {
  padding: 10px 11px 11px;
}

.item-title {
  min-height: 38px;
  color: #172033;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.price {
  color: var(--red);
  font-size: 15px;
  font-weight: 950;
}

.filter-empty {
  margin: 14px 0 0;
  padding: 14px;
  border: 1px dashed #c8d5df;
  border-radius: 8px;
  background: #f4f8fb;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.filter-empty[hidden] {
  display: none;
}

.service-panel,
.empty-state {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.service-panel {
  display: grid;
  gap: 14px;
}

.service-panel h2,
.empty-state h2 {
  margin: 0;
  font-size: 18px;
}

.service-panel p,
.empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.offer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offer-chip {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.offer-chip.on {
  border-color: #b9dfc9;
  background: #e8f8ee;
  color: var(--green);
}

.tabbar {
  position: fixed;
  right: 50%;
  bottom: 0;
  left: 50%;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 480px);
  min-height: 72px;
  transform: translateX(-50%);
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.tab {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 4px;
  border-radius: 8px;
  color: #738094;
  font-size: 12px;
  font-weight: 850;
}

.tab svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.1;
}

.tab.active {
  background: #e9f3fb;
  color: var(--blue);
}

.message-fab {
  position: fixed;
  right: max(16px, calc((100vw - 480px) / 2 + 18px));
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 35;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 16px 34px rgba(17, 105, 168, 0.34);
}

.message-fab svg {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

@media (max-width: 420px) {
  .product-hero {
    min-height: 184px;
  }

  .hero-track {
    gap: 9px;
    padding: 11px 11px 50px;
  }

  .hero-slide {
    flex-basis: 118px;
    height: 126px;
  }

  .hero-caption {
    min-height: 42px;
    padding: 8px 12px;
  }

  .hero-caption strong {
    font-size: 13px;
  }

  .hero-caption span {
    font-size: 11px;
  }

  .section-title {
    align-items: flex-start;
  }

  .category-filter {
    min-width: 118px;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .category-filter select {
    max-width: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-track {
    animation: none;
  }
}

@media (min-width: 760px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    border: 1px solid rgba(203, 213, 225, 0.7);
    border-radius: 22px;
  }

  .topbar {
    border-radius: 22px 22px 0 0;
  }

  .tabbar {
    bottom: 24px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
  }

  .message-fab {
    bottom: 106px;
  }
}
