:root {
  color-scheme: light;
  --paper: #f7f7f4;
  --ink: #202124;
  --muted: #6a6f73;
  --line: #d7d9d6;
  --panel: #ffffff;
  --accent: #28666e;
  --accent-dark: #18484e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

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

button,
.button-link {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  min-height: 40px;
  padding: 8px 14px;
  text-decoration: none;
}

.actions button:first-child,
.actions .button-link.secondary {
  background: transparent;
  color: var(--accent-dark);
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 18px;
}

.pager-bottom {
  padding: 0 24px 36px;
}

.pager-status {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  min-width: 190px;
  text-align: center;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.catalog {
  display: grid;
  gap: 18px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 36px;
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 36px;
}

.list-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.list-card:hover {
  border-color: var(--accent);
}

.list-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: #ececea;
}

.list-code {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.list-card strong {
  font-size: 14px;
  line-height: 1.25;
}

.shoe-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 22px;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  break-inside: avoid;
}

.photo-panel {
  min-width: 0;
}

.main-photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ececea;
  cursor: zoom-in;
}

.main-photo-link {
  display: block;
  color: inherit;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  background: #ececea;
}

.thumb.is-active {
  border: 2px solid var(--accent);
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(16, 17, 18, 0.88);
  padding: 24px;
}

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

.modal-photo {
  max-width: min(100%, 1400px);
  max-height: 88vh;
  object-fit: contain;
  background: #111;
  border-radius: 6px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border-color: #fff;
  background: #fff;
  color: var(--ink);
}

.modal-nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 64px;
  min-height: 0;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 42px;
  line-height: 1;
  transform: translateY(-50%);
}

.modal-prev {
  left: 18px;
}

.modal-next {
  right: 18px;
}

.modal-nav:disabled {
  display: none;
}

.details-panel {
  display: grid;
  gap: 12px;
}

.static-details {
  align-content: start;
}

.static-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.static-fields {
  display: grid;
  gap: 10px;
  margin: 0;
}

.static-fields div {
  display: grid;
  gap: 3px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.static-fields dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.static-fields dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  white-space: pre-wrap;
}

.detail-link {
  justify-self: start;
  margin-top: 2px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  min-height: 40px;
  padding: 8px 10px;
  text-transform: none;
}

textarea.field {
  resize: vertical;
}

@media (max-width: 820px) {
  .page-header {
    display: grid;
    align-items: start;
    padding: 24px 14px 18px;
  }

  h1 {
    font-size: 28px;
  }

  .catalog {
    padding: 0 14px 28px;
  }

  .photo-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    padding: 0 14px 28px;
  }

  .pager,
  .pager-bottom {
    padding-right: 14px;
    padding-left: 14px;
  }

  .shoe-card {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .pager-status {
    min-width: 120px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body {
    background: #fff;
  }

  .page-header {
    padding: 0 0 8mm;
  }

  .actions,
  .pager,
  .photo-modal,
  .subtitle {
    display: none;
  }

  .catalog {
    display: block;
    max-width: none;
    padding: 0;
  }

  .shoe-card {
    grid-template-columns: 58% 1fr;
    gap: 12px;
    margin-bottom: 8mm;
    padding: 10px;
    border-color: #c9c9c9;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .main-photo {
    aspect-ratio: 16 / 8;
  }

  .thumb-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
  }

  .field {
    border-color: #d0d0d0;
    min-height: 32px;
    padding: 4px 6px;
  }
}
