:root {
  color-scheme: light;
  --app-bg: #f3f5f7;
  --surface: #ffffff;
  --text: #161a1f;
  --muted: #8b929c;
  --line: #edf0f3;
  --blue: #0877c9;
  --blue-deep: #00549c;
  --navy: #061d3a;
  --gold: #d7a54f;
  --red: #e2263d;
  --shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--app-bg);
  color: var(--text);
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  background: var(--app-bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 12px 16px;
  background: #fffaf3;
}

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

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.logo-mark {
  overflow: hidden;
  border: 1px solid rgba(8, 119, 201, 0.14);
  background: #fff;
}

.logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark.large {
  width: 70px;
  height: 70px;
  margin: 0 auto 14px;
  border-radius: 22px;
  font-size: 24px;
}

.brand h1,
.page-title h2,
.about-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  overflow: hidden;
  color: #111827;
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.lang-toggle {
  min-width: 54px;
  min-height: 42px;
  border: 2px solid #111827;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  cursor: pointer;
  font-weight: 900;
}

.page-stack {
  min-height: calc(100vh - 152px);
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.banner-card {
  position: relative;
  margin: 0 14px 10px;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.banner-card img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
}

.banner-copy {
  display: none;
}

.banner-copy span {
  font-size: 13px;
  font-weight: 900;
}

.banner-copy strong {
  font-size: 25px;
  line-height: 1.05;
}

.home-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 10px;
  margin: 0 14px 18px;
  padding: 18px 12px 20px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.05);
}

.home-category {
  display: grid;
  gap: 9px;
  justify-items: center;
  min-width: 0;
  min-height: 120px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.home-category-image {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #f5f8fb;
  box-shadow: inset 0 0 0 1px rgba(8, 119, 201, 0.08);
}

.home-category img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-category span:last-child {
  width: 100%;
  overflow: hidden;
  min-height: 34px;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
}

.home-tiles {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 14px 18px;
}

.feature-tile {
  display: grid;
  gap: 10px;
  min-height: 142px;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
  color: #111827;
  cursor: pointer;
  font-size: 19px;
  font-weight: 900;
  text-align: left;
}

.feature-tile img {
  width: 100%;
  height: 82px;
  object-fit: contain;
}

.search-wrap {
  position: sticky;
  top: 72px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
}

.home-search-wrap {
  position: relative;
  top: auto;
  z-index: 1;
  margin: 0 14px 12px;
  padding: 0;
  border-radius: 12px;
  background: transparent;
}

.home-search-wrap input {
  background: #fff;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.search-wrap input {
  width: 100%;
  height: 48px;
  border: 2px solid var(--blue);
  border-radius: 9px;
  outline: 0;
  padding: 0 14px 0 44px;
  color: var(--text);
  font-size: 18px;
}

.search-icon {
  position: absolute;
  left: 28px;
  color: #a3abb4;
  font-size: 33px;
  line-height: 1;
}

.category-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 10px 14px 12px;
  background: #fff;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar,
.subcat-rail::-webkit-scrollbar,
.product-list::-webkit-scrollbar {
  display: none;
}

.category-tab {
  display: grid;
  flex: 0 0 78px;
  min-height: 72px;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: #eef7ff;
  color: #5b6570;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  padding: 8px;
  text-align: center;
}

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

.catalog-layout {
  display: grid;
  grid-template-columns: 106px 1fr;
  min-height: calc(100vh - 230px);
  background: #fff;
}

.subcat-rail {
  position: sticky;
  top: 214px;
  align-self: start;
  height: calc(100vh - 294px);
  overflow-y: auto;
  background: #eef1f4;
}

.subcat-item {
  display: block;
  width: 100%;
  min-height: 62px;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  color: #3f454d;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.22;
  padding: 10px 8px;
  text-align: center;
}

.subcat-item.is-active {
  border-left-color: var(--blue);
  background: #fff;
  color: #111827;
}

.catalog-content {
  min-width: 0;
  background: #fff;
}

.catalog-sortbar {
  display: none;
}

.sort-tab {
  border: 0;
  background: transparent;
  color: #8b929c;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 0;
}

.sort-tab.is-active {
  color: #111827;
}

.catalog-sortbar span {
  margin-left: auto;
  color: #9aa1aa;
  font-size: 12px;
  white-space: nowrap;
}

.product-list {
  display: grid;
  padding-bottom: 18px;
}

.product-card {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 44px;
  gap: 10px;
  min-height: 148px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.product-media {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.product-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-info {
  min-width: 0;
}

.product-name {
  margin: 0;
  color: #111827;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}

.product-name span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #8b929c;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-note {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #9aa1aa;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
}

.product-meta {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 9px;
}

.price {
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.unit {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.add-button {
  align-self: end;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.add-button strong {
  position: absolute;
  right: 4px;
  bottom: 50px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 12px;
}

.page-title {
  padding: 18px 16px 8px;
  background: #fff;
}

.page-title h2 {
  font-size: 28px;
}

.cart-page {
  min-height: calc(100vh - 152px);
  background: #fff;
}

.cart-items {
  display: grid;
  background: #fff;
}

.empty-cart {
  margin: 54px 0;
  color: var(--muted);
  text-align: center;
}

.cart-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.cart-item img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.cart-item-body {
  min-width: 0;
}

.cart-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.cart-item h3 {
  margin: 0;
  color: #111827;
  font-size: 15px;
  line-height: 1.3;
}

.cart-item h3 span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.remove-button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

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

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #eaf3fb;
  color: var(--blue);
  cursor: pointer;
  font-size: 19px;
  font-weight: 900;
}

.qty-display {
  min-width: 20px;
  color: #111827;
  font-size: 14px;
  text-align: center;
}

.cart-summary {
  position: sticky;
  bottom: calc(72px + env(safe-area-inset-bottom));
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
}

.summary-line strong {
  color: var(--red);
  font-size: 25px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
}

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

.secondary-action {
  background: #eef3f7;
  color: #334155;
}

.full {
  width: 100%;
  margin-top: 8px;
}

textarea {
  width: 100%;
  min-height: 112px;
  margin-top: 10px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.about-page {
  padding: 22px 16px;
}

.about-panel {
  padding: 28px 20px;
  border-radius: 20px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.about-logo {
  display: block;
  width: min(230px, 70vw);
  margin: 0 auto 16px;
  border-radius: 18px;
}

.about-panel h2 {
  font-size: 25px;
}

.about-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.about-lines {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  text-align: left;
}

.contact-card {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  text-align: left;
}

.contact-card div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.contact-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-card strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.about-lines span {
  padding: 12px;
  border-radius: 12px;
  background: #f5f8fb;
  color: #334155;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(72px + env(safe-area-inset-bottom));
  padding: 6px 8px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: #fff;
}

.bottom-nav-item {
  position: relative;
  display: grid;
  gap: 2px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.bottom-nav-item:focus-visible,
.home-category:focus-visible,
.category-tab:focus-visible,
.subcat-item:focus-visible,
.add-button:focus-visible,
.qty-button:focus-visible,
.lang-toggle:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible {
  outline: 2px solid rgba(0, 119, 200, 0.45);
  outline-offset: 2px;
}

.bottom-nav-item.is-active {
  color: var(--blue);
}

.nav-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
}

.bottom-nav-item.is-active .nav-icon {
  background: var(--blue);
  color: #fff;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 22%;
  display: grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  left: 16px;
  z-index: 50;
  padding: 12px 14px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 720px) {
  .app-shell {
    max-width: 480px;
    margin: 0 auto;
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }

  .bottom-nav {
    right: calc((100vw - 480px) / 2);
    left: calc((100vw - 480px) / 2);
  }
}
