:root {
  --bg: #070a11;
  --bg-elevated: #0d1320;
  --surface: rgba(12, 18, 31, 0.72);
  --surface-strong: rgba(14, 22, 36, 0.88);
  --surface-line: rgba(146, 171, 214, 0.24);
  --surface-line-strong: rgba(160, 190, 238, 0.36);
  --text: #eef4ff;
  --muted: #b2c0d8;
  --accent: #8bb8ff;
  --accent-strong: #c8dcff;
  --ok: #6ddfa4;
  --ok-bg: rgba(39, 112, 74, 0.42);
  --ok-line: rgba(117, 225, 169, 0.42);
  --tag-bg: rgba(152, 176, 217, 0.14);
  --tag-line: rgba(160, 188, 236, 0.33);
  --field-bg: rgba(9, 14, 23, 0.72);
  --shadow-card: 0 18px 44px rgba(3, 8, 18, 0.5);
  --shadow-glow: 0 0 0 1px rgba(164, 196, 247, 0.18), 0 20px 42px rgba(20, 44, 87, 0.34);
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 680px at 16% -8%, rgba(111, 159, 238, 0.2), transparent 56%),
    radial-gradient(900px 520px at 92% 6%, rgba(87, 128, 201, 0.17), transparent 55%),
    linear-gradient(180deg, #060911 0%, #080d16 42%, #070a11 100%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 400px at 50% 100%, rgba(126, 172, 246, 0.09), transparent 72%);
  pointer-events: none;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 24px auto 0;
  min-height: 62px;
  border: 1px solid var(--surface-line);
  background: var(--surface);
  backdrop-filter: blur(16px);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-family: "Sora", "Manrope", sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--accent-strong);
}

.brand-chip:hover {
  color: #f5f9ff;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 180ms ease;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: #f5f9ff;
}

.site-nav a.is-external::after {
  content: "↗";
  font-size: 11px;
  margin-left: 5px;
  opacity: 0.8;
}

.catalog-app {
  width: min(1180px, calc(100% - 40px));
  margin: 28px auto 0;
  padding: 0 0 36px;
}

.catalog-head {
  margin-bottom: 18px;
}

.catalog-kicker {
  margin: 0 0 10px;
  font-family: "Sora", "Manrope", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: rgba(171, 197, 239, 0.92);
}

.catalog-head h1 {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.catalog-subtitle {
  margin: 14px 0 0;
  max-width: 74ch;
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.5;
  color: var(--muted);
}

.catalog-sections {
  margin-bottom: 14px;
}

.sections-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(135, 164, 211, 0.5) transparent;
}

.sections-list::-webkit-scrollbar {
  height: 5px;
}

.sections-list::-webkit-scrollbar-thumb {
  background: rgba(135, 164, 211, 0.48);
  border-radius: 999px;
}

.section-pill {
  flex: 0 0 auto;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: rgba(22, 32, 52, 0.62);
  color: #c9d8ee;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.section-pill:hover {
  border-color: var(--surface-line-strong);
  background: rgba(31, 44, 69, 0.76);
  transform: translateY(-1px);
}

.section-pill.is-active {
  border-color: rgba(160, 196, 248, 0.68);
  background: rgba(123, 163, 231, 0.25);
  color: #f0f6ff;
  box-shadow: 0 0 0 1px rgba(166, 196, 242, 0.3);
}

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  margin-bottom: 12px;
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-field span {
  font-size: 12px;
  color: rgba(176, 194, 220, 0.9);
  letter-spacing: 0.02em;
}

.control-field input,
.control-field select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--surface-line);
  border-radius: 14px;
  padding: 0 14px;
  font-size: 14px;
  background: var(--field-bg);
  color: var(--text);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.control-field input::placeholder {
  color: rgba(172, 190, 216, 0.68);
}

.control-field select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 5 7 9.5 11.5 5' stroke='%23AFC2DF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.control-field input:focus,
.control-field select:focus {
  outline: none;
  border-color: var(--surface-line-strong);
  box-shadow: 0 0 0 2px rgba(143, 183, 255, 0.25);
}

.catalog-meta {
  margin-bottom: 14px;
}

#catalogSummary {
  margin: 0;
  color: rgba(180, 196, 220, 0.86);
  font-size: 13px;
}

.catalog-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.catalog-card {
  border: 1px solid var(--surface-line);
  background: linear-gradient(165deg, rgba(18, 27, 45, 0.82) 0%, rgba(12, 19, 33, 0.82) 100%);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.catalog-card:hover {
  transform: translateY(-3px);
  border-color: var(--surface-line-strong);
  box-shadow: var(--shadow-glow);
  background: linear-gradient(165deg, rgba(20, 30, 50, 0.86) 0%, rgba(13, 21, 36, 0.86) 100%);
}

.catalog-card:active {
  transform: translateY(-1px);
}

.catalog-card:focus-visible {
  outline: 2px solid rgba(157, 194, 255, 0.85);
  outline-offset: 2px;
}

.catalog-card > div {
  min-width: 0;
}

.catalog-image,
.modal-image {
  border-radius: 13px;
  border: 1px solid rgba(166, 192, 231, 0.3);
  background: linear-gradient(165deg, rgba(28, 41, 66, 0.7) 0%, rgba(16, 24, 39, 0.78) 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9fb5d8;
  font-weight: 700;
}

.catalog-image {
  width: 112px;
  height: 112px;
  object-fit: cover;
}

.modal-image {
  width: 100%;
  height: 270px;
  margin-bottom: 14px;
  object-fit: cover;
}

.catalog-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: #f3f8ff;
}

.catalog-brand {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(174, 192, 216, 0.88);
}

.catalog-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 11px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--tag-line);
  background: var(--tag-bg);
  color: #cad8ee;
  backdrop-filter: blur(6px);
}

.chip.stock {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}

.catalog-price {
  font-size: 21px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #d9e8ff;
}

.catalog-pagination {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.catalog-pagination button {
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--surface-line);
  background: rgba(123, 162, 224, 0.14);
  color: #e6f0ff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.catalog-pagination button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--surface-line-strong);
  background: rgba(129, 170, 236, 0.2);
}

.catalog-pagination button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.catalog-state {
  border: 1px dashed rgba(154, 181, 224, 0.36);
  border-radius: 14px;
  background: rgba(14, 22, 36, 0.74);
  padding: 20px 14px;
  text-align: center;
  color: rgba(177, 194, 218, 0.9);
  font-size: 14px;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.product-modal.hidden {
  display: none;
}

.product-modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 11, 20, 0.72);
  backdrop-filter: blur(5px);
}

.product-modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(820px, calc(100% - 30px));
  max-height: min(86vh, 940px);
  overflow: auto;
  border: 1px solid var(--surface-line);
  background: var(--surface-strong);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 28px 64px rgba(2, 8, 18, 0.6);
}

.product-modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 1px solid var(--surface-line);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(26, 38, 60, 0.82);
  color: #d9e7ff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.product-modal-close:hover {
  border-color: var(--surface-line-strong);
}

.modal-title {
  margin: 0 44px 10px 0;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #f4f8ff;
}

.modal-meta {
  margin: 0 0 14px;
  color: rgba(173, 191, 216, 0.86);
  font-size: 14px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 14px;
}

.modal-cell {
  border: 1px solid var(--surface-line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(17, 26, 43, 0.72);
}

.modal-cell span {
  display: block;
  color: rgba(171, 190, 216, 0.84);
  font-size: 12px;
  margin-bottom: 4px;
}

.modal-cell b {
  font-size: 14px;
  color: #ecf4ff;
}

.modal-description {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  color: rgba(213, 225, 243, 0.95);
  font-size: 15px;
}

@media (max-width: 980px) {
  .site-header,
  .catalog-app {
    width: calc(100% - 28px);
  }

  .site-header {
    margin-top: 16px;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
  }

  .catalog-head h1 {
    font-size: clamp(28px, 7.2vw, 40px);
  }

  .catalog-controls {
    grid-template-columns: 1fr;
  }

  .catalog-list {
    grid-template-columns: 1fr;
  }

  .product-modal-card {
    width: calc(100% - 20px);
    max-height: 88vh;
    padding: 14px;
  }

  .modal-title {
    font-size: 24px;
  }
}

@media (min-width: 1080px) {
  .catalog-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .catalog-app {
    margin-top: 22px;
    padding-bottom: 24px;
  }

  .catalog-head h1 {
    font-size: clamp(28px, 9.3vw, 36px);
  }

  .catalog-subtitle {
    font-size: 14px;
  }

  .section-pill {
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .catalog-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
  }

  .catalog-image {
    width: 96px;
    height: 96px;
  }

  .catalog-card h3 {
    font-size: 17px;
  }

  .catalog-price {
    font-size: 18px;
  }

  .catalog-pagination {
    grid-template-columns: 1fr;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-image {
    height: 220px;
  }

  .product-modal-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    width: auto;
    transform: none;
    border-radius: 16px;
    max-height: 82vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
