/*
Theme Name: АЛС ПРОЕКТ
Description: Лаконичный прототип каталога без корзины.
Version: 0.1.0
Text Domain: alsproekt
*/

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f8fafc;
  --paper: #fff;
  --canvas: #f8fafc;
  --accent: #526e9f;
  --accent-hover: #425a84;
  --rust: #a02c1f;
  --rust-hover: #862318;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 4px 6px -1px rgba(82, 110, 159, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
}

.logo { flex: 0 0 auto; min-width: 0; }
.logo img { display: block; height: 44px; width: auto; max-width: 210px; object-fit: contain; object-position: left center; }

.bar-contacts {
  margin-left: auto;
  text-align: right;
  font-size: 14px;
  line-height: 1.35;
}

.bar-contacts a { color: var(--ink); font-weight: 600; }
.bar-contacts a:hover { color: var(--accent); text-decoration: none; }
.bar-contacts a[href^="mailto"] {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.nav {
  display: flex;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
}

.nav a {
  color: var(--body);
  padding: 8px 12px;
  border-radius: var(--radius);
}

.nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.nav a.is-active { color: var(--accent); background: #eef2f8; }

.nav-search {
  display: flex;
  align-items: stretch;
  margin-left: auto;
}

.nav-search input[type="search"] {
  width: 280px;
  min-width: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: 0;
}

.nav-search button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  padding: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nav-search button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

main { padding: 32px 0 64px; }

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}

.title-row .note { margin: 0; }

.view-switch {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}

.view-switch a {
  padding: 7px 12px;
  color: var(--body);
  font-size: 13px;
  font-weight: 600;
}

.view-switch a.is-active { background: var(--accent); color: #fff; }
.view-switch a:hover { text-decoration: none; background: var(--bg); }
.view-switch a.is-active:hover { background: var(--accent-hover); color: #fff; }

.note { margin: 6px 0 18px; color: var(--muted); font-size: 14px; }

.crumbs { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

.branch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.branch a {
  display: block;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.branch a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.filters {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin: 0;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.filters select,
.filters button,
.filters .button-link {
  width: 100%;
}

.filters.filters-top {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.filters.filters-top label { min-width: 180px; flex: 1 1 180px; }

.filters.filters-top select,
.filters.filters-top button,
.filters.filters-top .button-link { width: auto; }

.catalog-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

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

.product-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.product-card .photo {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}

.product-card .photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card .photo-empty {
  width: 42%;
  height: 42%;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
}

.product-card .info { padding: 12px 14px 14px; }

.product-card .name {
  display: block;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink);
}

.product-card .name:hover { color: var(--accent); text-decoration: none; }

.product-card .sku {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.product-card .price {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 600;
}

.product-card .source {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

input, select, textarea, button {
  font: inherit;
  color: var(--ink);
}

input, select, textarea {
  padding: 8px 10px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

input[type="search"] { min-width: 180px; }

button {
  padding: 8px 14px;
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { opacity: 0.6; cursor: default; }

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--body);
  font-size: 14px;
  font-weight: 600;
}

.button-link:hover { background: var(--bg); text-decoration: none; color: var(--ink); }

.catalog-scroll {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.catalog {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper);
}

.catalog th,
.catalog td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.catalog tr:last-child td { border-bottom: 0; }

.catalog th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #475569;
  background: #f1f5f9;
}

.catalog tbody tr:nth-child(even) { background: var(--canvas); }
.catalog tbody tr:hover { background: #f1f5f9; }

.catalog td a { color: var(--ink); font-weight: 600; }
.catalog td a:hover { color: var(--accent); }

.price, .sku, .price-lg { font-variant-numeric: tabular-nums; }
.price { white-space: nowrap; font-weight: 600; }
.sku { color: var(--muted); }

.empty {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.product { max-width: 1040px; }

.product-head {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-bottom: 8px;
}

.product-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-photo .photo-empty {
  width: 42%;
  height: 42%;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
}

.product-head h1 { margin-bottom: 12px; }

.product-head .sku { margin: 0; color: var(--muted); font-size: 14px; }

.order-btn,
.order-form button[type="submit"] {
  margin-top: 16px;
  padding: 10px 18px;
  background: var(--rust);
  border-color: var(--rust);
}

.order-btn:hover,
.order-form button[type="submit"]:hover {
  background: var(--rust-hover);
  border-color: var(--rust-hover);
}

.order-form button[type="submit"] { margin-top: 4px; }

body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.4);
}

.modal[hidden] { display: none; }

.modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 22px 22px 18px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
}

.modal-card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }

.modal-product { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.modal-close:hover { background: var(--bg); color: var(--ink); }

.order-form { display: flex; flex-direction: column; gap: 12px; }
.order-form[hidden] { display: none; }

.order-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.order-form input,
.order-form textarea { width: 100%; }

.order-form .hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.form-error { margin: 0; color: #93000a; font-size: 14px; }

.form-ok { margin: 8px 0 4px; color: var(--body); }

.props {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr;
  margin: 28px 0 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.props dt,
.props dd {
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.props dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: var(--canvas);
}

.props dd { font-size: 14px; }

.props dt:nth-last-child(2),
.props dd:last-child { border-bottom: 0; }

.price-lg {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.product-text {
  margin-top: 20px;
  color: var(--body);
  font-size: 15px;
  line-height: 1.55;
}

.product-text > :first-child { margin-top: 0; }

.narrow { width: min(720px, calc(100% - 48px)); }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 22px 0 32px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.site-footer a { color: var(--ink); font-weight: 600; }
.site-footer a:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 800px) {
  .wrap, .narrow { width: min(1180px, calc(100% - 32px)); }
  .bar { flex-wrap: wrap; padding: 12px 0; gap: 12px; min-height: 0; }
  .bar-contacts { margin-left: 0; text-align: left; }
  .nav-row { flex-wrap: wrap; }
  .nav-search { margin-left: 0; width: 100%; }
  .nav-search input[type="search"] { width: 100%; }
  .catalog-layout { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .title-row { align-items: flex-start; }
  .catalog thead { display: none; }
  .catalog,
  .catalog tbody,
  .catalog tr,
  .catalog td { display: block; width: 100%; }
  .catalog-scroll { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .catalog { border: 0; background: transparent; box-shadow: none; }
  .catalog tr {
    margin-bottom: 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .catalog tbody tr:nth-child(even),
  .catalog tbody tr:hover { background: var(--paper); }
  .catalog td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding: 8px 12px;
  }
  .catalog tr:last-child td { border-bottom: 1px solid var(--line); }
  .catalog td:last-child { border-bottom: 0; }
  .catalog td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 600;
    flex: 0 0 42%;
  }
  .product-head { grid-template-columns: 1fr; }
  .product-photo { max-width: 420px; }
  .props { grid-template-columns: 1fr; }
  .props dt { padding-bottom: 2px; border-bottom: 0; }
  .props dd { padding-top: 2px; }
  h1 { font-size: 22px; }
}

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