:root {
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  color: #172033;
  background: #f4f7fb;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 8px 0 12px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.25;
}

.page-header p {
  max-width: 760px;
  margin: 0;
  color: #526078;
  line-height: 1.8;
}

.eyebrow {
  color: #1769e0 !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.search-panel,
.products-section {
  border: 1px solid #dce3ee;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgb(24 42 72 / 8%);
}

.search-panel {
  margin-bottom: 28px;
  padding: 24px;
}

.search-panel__header,
.products-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.search-panel__header {
  margin-bottom: 22px;
}

.search-panel__header h2,
.products-section__header h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.search-panel__header p,
.result-count,
.status {
  margin: 0;
  color: #657188;
  font-size: 14px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #172033;
  background: #ffffff;
}

.field input::placeholder {
  color: #8a96aa;
}

.field input:disabled,
.field select:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  gap: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #1769e0;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #1769e0;
  border-radius: 10px;
  color: #ffffff;
  background: #1769e0;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  border-color: #0d56bf;
  background: #0d56bf;
}

.button--secondary {
  border-color: #cbd5e1;
  color: #334155;
  background: #ffffff;
}

.button--secondary:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.button:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.checkbox input:focus-visible {
  outline: 3px solid #90baff;
  outline-offset: 3px;
}

.products-section {
  overflow: hidden;
}

.products-section__header {
  padding: 24px;
  border-bottom: 1px solid #e7ecf3;
}

.status {
  max-width: 560px;
  text-align: right;
}

.status.is-success {
  color: #18733d;
}

.status.is-error {
  color: #b42318;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 24px;
}

.product-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid #dce3ee;
  border-radius: 14px;
  background: #ffffff;
}

.product-card__category {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #1757a6;
  background: #eaf3ff;
  font-size: 12px;
  font-weight: 700;
}

.product-card__name {
  margin: 0 0 7px;
  font-size: 20px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.product-card__id {
  margin: 0 0 18px;
  color: #6b778c;
  font-size: 13px;
}

.product-card__details {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid #e7ecf3;
}

.product-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.product-card__row dt {
  color: #657188;
  font-size: 13px;
}

.product-card__row dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.product-card__price {
  color: #0f4fa8;
  font-size: 18px;
}

.is-in-stock,
.is-out-of-stock {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.is-in-stock {
  color: #18733d;
  background: #e8f7ee;
}

.is-out-of-stock {
  color: #b42318;
  background: #fff0ee;
}

.empty-message {
  margin: 0;
  padding: 56px 24px;
  color: #657188;
  text-align: center;
}

@media (max-width: 1000px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1120px);
    padding: 32px 0;
  }

  .search-panel,
  .products-section__header,
  .product-grid {
    padding: 18px;
  }

  .search-panel__header,
  .products-section__header {
    align-items: stretch;
    flex-direction: column;
  }

  .filters,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .status {
    text-align: left;
  }
}
