:root {
  --nav-width: 112px;
  --ink: #22302b;
  --muted: #75827c;
  --line: #dbe5dd;
  --accent: #0d8f63;
  --accent-dark: #076b4d;
  --paper: #f7faf5;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  max-width: 520px;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, rgba(235, 247, 232, 0.92), rgba(247, 250, 245, 0.98) 220px),
    var(--paper);
  box-shadow: 0 0 0 1px rgba(34, 48, 43, 0.05);
}

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 10px;
  min-height: 64px;
  color: #fff;
  background: linear-gradient(135deg, #0b7a58, #13a676);
  box-shadow: 0 8px 24px rgba(13, 97, 69, 0.18);
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.contactButton,
.viewerBar button,
.contactClose {
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  min-width: 48px;
  min-height: 36px;
  padding: 8px 12px;
}

.catalogShell {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.brandNav {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 10px 8px 96px;
  background: #edf5ee;
  border-right: 1px solid var(--line);
}

.brandButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  margin: 0 0 8px;
  padding: 8px 6px;
  border: 1px solid #cfded3;
  border-radius: 8px;
  color: #2b3a34;
  background: #fff;
  font-size: 15px;
  line-height: 1.28;
  text-align: center;
}

.brandButton.isActive {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(13, 143, 99, 0.2);
}

.catalogPanel {
  min-width: 0;
  padding: 10px 10px 28px;
}

.brandTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 10px;
}

.brandTitle h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.brandTitle span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.imageList {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.catalogImageButton {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(43, 60, 51, 0.1);
  overflow: hidden;
}

.catalogImageButton img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #fff;
}

.priceBadge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 237, 172, 0.82);
  border-radius: 8px;
  color: #fff6d7;
  background: linear-gradient(135deg, #c52a1d, #ec7b2b);
  box-shadow: 0 8px 18px rgba(91, 27, 12, 0.26);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.emptyState {
  display: grid;
  gap: 8px;
  min-height: 180px;
  align-content: center;
  justify-items: center;
  padding: 24px;
  border: 1px dashed #b9cbbf;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.emptyState strong {
  color: var(--ink);
  font-size: 18px;
}

.emptyState span {
  max-width: 220px;
  font-size: 13px;
  line-height: 1.5;
}

.viewer,
.contactPanel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(10, 18, 14, 0.92);
}

.viewer.isOpen,
.contactPanel.isOpen {
  display: block;
}

.viewerBar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}

.viewerBar span {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.viewerCanvas {
  height: 100%;
  overflow: auto;
  padding: 64px 12px 24px;
  text-align: center;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
}

.viewerImageWrap {
  position: relative;
  display: inline-block;
  width: min(100%, 980px);
}

.viewerCanvas img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
}

.viewerPriceBadge {
  top: 12px;
  right: 12px;
  min-width: 110px;
  min-height: 40px;
  font-size: 17px;
}

.contactPanel {
  place-items: center;
  padding: 20px;
}

.contactPanel.isOpen {
  display: grid;
}

.contactCard {
  position: relative;
  width: min(92vw, 420px);
  padding: 48px 16px 16px;
  border-radius: 8px;
  background: #fff;
}

.contactCard img {
  display: block;
  width: 100%;
  height: auto;
}

.contactClose {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #fff;
  background: var(--accent-dark);
}

@media (min-width: 760px) {
  :root {
    --nav-width: 154px;
  }

  .topbar {
    padding-inline: 24px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .catalogPanel {
    max-width: 980px;
    padding: 18px 22px 46px;
  }

  .brandButton {
    min-height: 58px;
    font-size: 16px;
  }
}
