:root {
  --bg: #ededed;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --text: #042554;
  --muted: #65789a;
  --primary: #042554;
  --secondary: #0c4ba1;
  --border: #dce2ec;
  --shadow: 0 8px 22px rgba(4, 37, 84, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Montserrat, Avenir Next, Segoe UI, Arial, sans-serif;
  font-size: 15.5px;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 22px 18px 26px;
  color: white;
  background: linear-gradient(135deg, #031d48 0%, var(--secondary) 100%);
  box-shadow: 0 2px 12px rgba(4, 37, 84, 0.20);
}

.header-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.header-kicker {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-header h1 {
  max-width: 100%;
  margin: 0;
  color: white;
  font-size: clamp(1.75rem, 8vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.site-header p:last-child {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 4.2vw, 1.18rem);
  line-height: 1.35;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.20);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.28);
}

.icon-button:active {
  transform: scale(0.96);
}

.menu-button {
  flex-direction: column;
  gap: 6px;
}

.menu-button span {
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 999px;
  background: white;
}

.category-nav {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

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

.category-pill {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  background: #e7ebf0;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.category-pill:hover,
.category-pill.is-active {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.category-pill:active {
  transform: scale(0.97);
}

.tool-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.search-field,
.sort-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-field input,
.sort-field select {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #f7f8fb;
  outline: 0;
}

.search-field input {
  width: 100%;
  padding: 0 14px;
}

.sort-field select {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  cursor: pointer;
}

.search-field input:focus,
.sort-field select:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(12, 75, 161, 0.14);
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px 16px 32px;
}

.product-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 28px rgba(4, 37, 84, 0.16);
}

.product-card:focus-within {
  border-color: var(--secondary);
}

.card-media,
.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.media-placeholder {
  color: var(--primary);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.card-type {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-card h3 {
  margin: -4px 0 0;
  font-size: 1.28rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.variant-tab {
  min-width: 50px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #f4f6f9;
  font-weight: 800;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.variant-tab.is-active {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.card-excerpt {
  display: -webkit-box;
  min-height: 3.95em;
  margin: 0;
  overflow: hidden;
  color: #405882;
  line-height: 1.32;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-price {
  margin: auto 0 0;
  color: #7b8da8;
  font-size: 1.05rem;
  font-weight: 800;
}

.detail-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--primary);
  font-weight: 800;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.detail-button:hover {
  background: var(--secondary);
}

.detail-button:active {
  transform: scale(0.98);
}

.empty-state {
  margin: 0;
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.42);
}

.bottom-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 28px 18px 24px;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, 105%);
  transition: transform 220ms ease;
}

.bottom-sheet.is-open {
  transform: translate(-50%, 0);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.sheet-header h2,
.detail-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.65rem, 7vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.plain-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font-size: 2.3rem;
  line-height: 1;
  cursor: pointer;
}

.plain-icon:hover {
  background: #eef2f8;
}

.menu-list {
  display: grid;
  gap: 12px;
}

.menu-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: #f7f8fb;
  font-size: 1rem;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-list a:hover {
  background: #eef4ff;
}

.menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--primary);
  background: transparent;
  font-size: 1.45rem;
  font-weight: 900;
}

.menu-arrow {
  margin-left: auto;
  color: #7b8da8;
  font-size: 1.9rem;
  line-height: 1;
}

.detail-sheet {
  z-index: 50;
}

.detail-close {
  position: absolute;
  top: 22px;
  right: 16px;
}

.detail-kicker {
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 48px 20px 0;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: white;
  background: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.detail-muted {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.detail-gallery {
  display: grid;
  gap: 14px;
  margin: 0 0 22px;
}

.zoom-trigger {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: zoom-in;
}

.zoom-trigger img {
  display: block;
  width: 100%;
  max-height: min(56vh, 560px);
  object-fit: contain;
  padding: 14px;
  border-radius: 8px;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.gallery-controls button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: white;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
}

.gallery-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.gallery-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: #b9c4d4;
  cursor: pointer;
}

.gallery-dot.is-active {
  background: var(--primary);
}

.detail-panel {
  margin: 0 0 18px;
  padding: 22px;
  border-radius: 8px;
  background: #eef6ff;
}

.detail-panel p,
.detail-panel ul {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.detail-panel ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.price-panel {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.price-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.price-value {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.8rem, 5vw, 2.35rem);
  font-weight: 900;
  letter-spacing: 0;
}

.back-button {
  width: 100%;
  min-height: 54px;
  margin-top: 26px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #f4f6f9;
  font-weight: 800;
  cursor: pointer;
}

.back-button:hover {
  background: #e9eef6;
}

.zoom-overlay,
.zoom-modal {
  position: fixed;
  inset: 0;
}

.zoom-overlay {
  z-index: 60;
  background: rgba(0, 0, 0, 0.74);
}

.zoom-modal {
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.zoom-modal.is-open {
  display: flex;
}

.zoom-modal img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 8px;
  object-fit: contain;
  background: white;
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  background: rgba(4, 37, 84, 0.82);
}

.zoom-close:hover {
  background: rgba(4, 37, 84, 1);
}

[hidden] {
  display: none !important;
}

@media (min-width: 720px) {
  body {
    font-size: 16px;
  }

  .app-shell,
  .bottom-sheet {
    width: min(100%, 980px);
  }

  .site-header {
    padding: 30px 38px 34px;
  }

  .header-content {
    gap: 22px;
  }

  .site-header h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
  }

  .site-header p:last-child {
    margin-top: 14px;
    font-size: clamp(1.12rem, 2vw, 1.45rem);
  }

  .icon-button {
    width: 58px;
    height: 58px;
  }

  .category-nav {
    gap: 14px;
    padding: 20px 38px;
  }

  .category-pill {
    min-height: 52px;
    padding: 0 28px;
    font-size: 1rem;
  }

  .tool-row {
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 14px;
    padding: 18px 38px;
  }

  .sort-field select {
    width: auto;
    min-width: 174px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 22px 38px 40px;
  }

  .product-card {
    gap: 14px;
    padding: 22px;
  }

  .product-card h3 {
    font-size: clamp(1.25rem, 2vw, 1.55rem);
  }

  .bottom-sheet {
    max-height: 86vh;
    padding: 36px 42px 34px;
    border-radius: 24px 24px 0 0;
  }

  .detail-close {
    right: 28px;
  }

  .detail-chip-row {
    margin-right: 54px;
  }

  .menu-list a {
    gap: 16px;
    min-height: 66px;
    padding: 12px 16px;
    font-size: 1.1rem;
  }

  .menu-icon {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .zoom-modal {
    padding: 28px;
  }
}
