:root {
  --sky: #73c7f2;
  --sky-strong: #2199d4;
  --sky-soft: #e9f7ff;
  --orange: #f5a623;
  --orange-strong: #eb7d16;
  --navy: #12324a;
  --text: #203040;
  --muted: #667789;
  --line: #d8e8f2;
  --surface: #ffffff;
  --background: #f6fbff;
  --shadow: 0 14px 36px rgba(18, 50, 74, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  padding-bottom: 78px;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input[type="checkbox"] {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.top-strip {
  height: 6px;
  background: linear-gradient(90deg, var(--sky), #ffffff 48%, var(--orange));
}

.header-inner,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: grid;
  grid-template-columns: 210px minmax(260px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  display: block;
  width: 188px;
  max-width: 100%;
  height: auto;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(115, 199, 242, 0.14);
  overflow: hidden;
}

.search-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0 16px;
  color: var(--navy);
  outline: none;
}

.search-form button {
  border: 0;
  background: var(--orange);
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}

main {
  padding: 34px 0 48px;
}

.catalog-toolbar {
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: 36px;
  line-height: 1.1;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
}

.select-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-menu {
  position: relative;
  display: grid;
  min-width: 230px;
  gap: 6px;
}

.filter-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-trigger {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(115, 199, 242, 0.36);
  border-radius: 8px;
  padding: 0 14px 0 16px;
  background: linear-gradient(180deg, #ffffff, #f8fcff);
  color: var(--navy);
  box-shadow: 0 10px 24px rgba(18, 50, 74, 0.07);
  font-weight: 800;
}

.filter-trigger:hover,
.filter-trigger[aria-expanded="true"] {
  border-color: var(--sky-strong);
  box-shadow: 0 12px 28px rgba(33, 153, 212, 0.15);
}

.filter-arrow {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--sky-soft);
  color: var(--sky-strong);
  font-size: 11px;
  font-weight: 900;
}

.filter-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 15;
  display: grid;
  width: min(320px, calc(100vw - 32px));
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.filter-option {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 0 11px;
  background: transparent;
  color: var(--navy);
  text-align: left;
  font-weight: 800;
}

.filter-option:hover,
.filter-option.active {
  background: var(--sky-soft);
  color: #0f628c;
}

.select-label select {
  min-width: 188px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--navy);
  background: #ffffff;
  font-weight: 800;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 28px 0 0;
}

.load-more-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--orange);
  color: var(--navy);
  font-weight: 900;
}

.product-card {
  display: grid;
  min-height: 390px;
  grid-template-rows: 190px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(18, 50, 74, 0.08);
}

.product-media {
  position: relative;
  display: grid;
  place-items: center;
  height: 190px;
  min-height: 190px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, var(--sky-soft));
}

.product-media-button {
  width: 100%;
  border: 0;
  border-radius: 0;
}

.product-media-button:hover img {
  transform: scale(1.03);
}

.product-media img {
  display: block;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  object-fit: contain;
  padding: 0;
  transition: transform 160ms ease;
}

.image-fallback {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 18px;
  background: #dff3ff;
  color: var(--sky-strong);
  font-size: 38px;
  font-weight: 900;
}

.product-info {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  padding: 15px;
}

.product-category {
  color: var(--sky-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.product-name {
  min-height: 44px;
  margin: 0;
  color: var(--navy);
  font-size: 17px;
  line-height: 1.3;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price {
  color: var(--navy);
  font-size: 22px;
  font-weight: 900;
}

.code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.detail-button {
  min-height: 42px;
  border: 1px solid rgba(33, 153, 212, 0.28);
  border-radius: 8px;
  background: #eaf7ff;
  color: #126489;
  font-weight: 900;
}

.detail-button:hover,
.search-form button:hover,
.load-more-button:hover {
  filter: brightness(0.98);
}

.detail-button:hover {
  background: #d9f0fc;
  border-color: rgba(33, 153, 212, 0.45);
}

.empty-state {
  padding: 52px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
}

.empty-state h2 {
  margin-bottom: 8px;
  color: var(--navy);
}

.product-dialog {
  width: min(920px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgba(18, 50, 74, 0.48);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--navy);
  font-size: 28px;
  line-height: 1;
  z-index: 2;
}

.dialog-body {
  display: grid;
  grid-template-columns: minmax(260px, 42%) minmax(0, 1fr);
}

.dialog-gallery {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--sky-soft);
}

.dialog-image {
  display: grid;
  min-height: 430px;
  place-items: center;
  border: 0;
  padding: 0;
  background: var(--sky-soft);
}

.dialog-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 28px;
}

.dialog-image:not(:disabled):hover img {
  transform: scale(1.02);
}

.dialog-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 18px 18px;
}

.dialog-thumb {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 4px;
  background: #ffffff;
}

.dialog-thumb.active {
  border-color: var(--orange);
}

.dialog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-zoom {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 50, 74, 0.9);
}

.image-zoom img {
  max-width: min(1100px, 96vw);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.image-zoom-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: var(--navy);
  font-size: 26px;
  font-weight: 900;
}

.dialog-info {
  padding: 34px;
}

.dialog-info h2 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 28px;
  line-height: 1.15;
}

.dialog-price {
  margin-bottom: 18px;
  color: var(--orange-strong);
  font-size: 30px;
  font-weight: 900;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.spec-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.spec-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.spec-item strong {
  color: var(--navy);
}

.description {
  color: #405569;
  line-height: 1.55;
  white-space: pre-line;
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  border-top: 3px solid var(--orange);
  background: var(--navy);
  box-shadow: 0 -12px 30px rgba(18, 50, 74, 0.18);
}

.footer-inner {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.footer-inner span + span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 14px;
  border-radius: 999px;
  background: var(--orange);
  vertical-align: 1px;
}

@media (max-width: 760px) {
  body {
    padding-bottom: 132px;
  }

  .header-inner {
    grid-template-columns: 1fr;
  }

  .brand img {
    width: 158px;
  }

  .search-form {
    grid-column: 1 / -1;
  }

  .catalog-toolbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .toolbar-actions {
    justify-content: stretch;
  }

  .select-label,
  .select-label select,
  .filter-menu {
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
  }

  .product-card {
    min-height: 350px;
    grid-template-rows: 160px auto;
  }

  .product-media {
    height: 160px;
    min-height: 160px;
  }

  .product-info {
    padding: 12px;
  }

  .product-name {
    font-size: 15px;
  }

  .price {
    font-size: 19px;
  }

  .dialog-body {
    grid-template-columns: 1fr;
  }

  .dialog-image {
    min-height: 280px;
  }

  .dialog-info {
    padding: 24px;
  }

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

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    padding: 18px 0;
  }

  .footer-inner span + span::before {
    display: none;
  }
}
