* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f6f8;
  color: #111827;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.site-header {
  background: #111827;
  color: #f9fafb;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  color: #f9fafb;
  text-decoration: none;
}

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.9rem;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

.primary-nav a[aria-current='page'] {
  color: #ffffff;
  font-weight: 700;
  text-decoration: underline;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-inner ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-inner a {
  color: #1d4ed8;
  font-size: 0.85rem;
}

@media (min-width: 768px) {
  .container {
    padding: 2rem 1rem;
  }

  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin: 1.5rem 0 2rem;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
}

.product-image {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  object-fit: cover;
  background: #eef2f7;
}

.product-image-lg {
  max-height: 520px;
}

.card h2 {
  margin-top: 0;
  font-size: 1rem;
}

.error {
  color: #b91c1c;
  font-weight: 600;
}

.info {
  color: #1e40af;
  font-weight: 500;
}

.muted {
  color: #334155;
  font-size: 0.95rem;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #111827;
  color: #ffffff;
  border-radius: 999px;
  transform: translateY(-200%);
  transition: transform 0.15s ease-in-out;
  z-index: 10;
}

.skip-link:focus {
  transform: translateY(0);
}

a {
  color: #1d4ed8;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

.stack {
  display: grid;
  gap: 0.75rem;
}

.stack-sm {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

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

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

input[type='text'],
input[type='email'] {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.stock-ok {
  color: #166534;
  font-weight: 600;
}

.stock-out {
  color: #991b1b;
  font-weight: 600;
}

.trust-blocks ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
}

.catalog-page {
  display: grid;
  gap: 1rem;
}

.catalog-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.catalog-filters h2 {
  margin-top: 0;
}

.catalog-filter-group {
  border: 0;
  padding: 0;
  margin: 0 0 0.85rem;
}

.catalog-filter-group legend {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.catalog-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.catalog-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.catalog-results {
  display: grid;
  gap: 1rem;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.catalog-toolbar p {
  margin: 0;
}

.catalog-sort-form {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.catalog-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.catalog-card {
  display: grid;
  align-content: start;
}

.catalog-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.catalog-price {
  margin: 0;
}

.catalog-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #e5e7eb;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.catalog-select-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 600;
}

@media (min-width: 880px) {
  .catalog-layout {
    grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
    align-items: start;
  }

  .catalog-filters {
    position: sticky;
    top: 1rem;
  }
}
