/* Сайт LHMALL — базовые стили каркаса.
   Один файл без сборки и внешних CDN: страница не зависит от интернета. */

:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #1c2430;
  --muted: #667085;
  --brand: #0b6bcb;
  --brand-dark: #084f97;
  --border: #e4e7ec;
  --danger: #b42318;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: 1.3rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- Шапка --- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; }
.brand-text small { color: var(--muted); font-size: .75rem; }

.main-nav { display: flex; gap: 18px; margin-left: auto; }
.main-nav a { color: var(--text); font-weight: 500; }
.main-nav a:hover { color: var(--brand); text-decoration: none; }

.header-tools { display: flex; align-items: center; gap: 16px; }

.langs { display: flex; gap: 4px; }
.lang {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
}
.lang:hover { background: var(--bg); text-decoration: none; }
.lang.active { background: var(--brand); color: #fff; }

.cart-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: .9rem;
}
.cart-link:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.badge {
  min-width: 20px; height: 20px;
  display: inline-grid; place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: .72rem;
}

/* --- Основное --- */
.main { padding: 32px 0 56px; }

.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .3em; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 62ch; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card h2 { margin-bottom: .2em; }
.card p { color: var(--muted); margin: 0 0 12px; }

.status {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 12px;
}
.status-list { display: grid; gap: 8px; margin: 0; }
.status-list > div { display: flex; gap: 12px; flex-wrap: wrap; }
.status-list dt { color: var(--muted); min-width: 210px; }
.status-list dd { margin: 0; }

/* --- Кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}
.btn:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 8px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

/* --- Хлебные крошки и заголовки страниц --- */
.breadcrumbs {
  display: flex; flex-wrap: wrap; gap: 6px;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }

.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 { margin: 0; }

.muted { color: var(--muted); }

.alert {
  padding: 14px 16px;
  border: 1px solid #f5c2bc;
  border-left: 4px solid var(--danger);
  border-radius: 10px;
  background: #fef3f2;
  color: #5b1a13;
}

/* --- Каталог --- */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}
.sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.sidebar h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.cat-tree { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cat-tree .cat-tree { margin: 4px 0 4px 14px; }
.cat-tree a { display: block; padding: 5px 8px; border-radius: 8px; color: var(--text); }
.cat-tree a:hover { background: var(--bg); color: var(--brand); text-decoration: none; }

.search-form { display: flex; gap: 8px; margin-bottom: 20px; }
.search-form input[type="search"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: var(--panel);
}
.search-form .btn { align-self: stretch; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .15s ease, transform .15s ease;
}
.product-card:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .1); transform: translateY(-1px); }
.product-media {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: #eef2f6;
  overflow: hidden;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.no-image { color: var(--muted); font-size: 2rem; }
.product-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-title { color: var(--text); font-weight: 600; font-size: .95rem; }
.product-title:hover { color: var(--brand); text-decoration: none; }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; white-space: nowrap; }

.pagination { display: flex; align-items: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* --- Карточка товара --- */
.product {
  display: grid;
  grid-template-columns: minmax(280px, 480px) 1fr;
  gap: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
}
.product-main-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #eef2f6;
  border-radius: 10px;
}
.product-gallery .no-image {
  display: grid;
  place-items: center;
  font-size: 3rem;
}
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-top: 10px; }
.thumbs img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #eef2f6;
}
.product-info h1 { margin-bottom: .5em; }
.product-meta { display: grid; gap: 6px; margin: 0 0 16px; }
.product-meta > div { display: flex; gap: 10px; }
.product-meta dt { color: var(--muted); min-width: 120px; }
.product-meta dd { margin: 0; }
.product-price { font-size: 1.8rem; font-weight: 700; margin: 0 0 16px; }
.add-form { display: flex; gap: 10px; margin-bottom: 16px; }
.add-form input[type="number"],
.qty-form input[type="number"] {
  width: 90px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: var(--panel);
}

.prose { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.prose h2 { margin-top: 0; }
.prose img { border-radius: 8px; margin: 12px 0; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px; text-align: left; }

/* --- Таблицы --- */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th { background: #f9fafb; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:last-child td { border-bottom: none; }
.table tfoot th { background: #f9fafb; }

/* --- Отзывы --- */
.reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.review { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-title { font-weight: 600; margin: 8px 0 4px; }
.rating { background: #fff7e6; color: #b54708; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; }

/* --- Корзина --- */
.cart-product { display: flex; align-items: center; gap: 12px; }
.cart-thumb {
  width: 56px; height: 56px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #eef2f6;
  overflow: hidden;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qty-form { display: flex; gap: 6px; align-items: center; }
.cart-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }

/* --- Блог --- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: .85rem;
}
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.post-list { display: grid; gap: 16px; }
.post-preview {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.post-preview:not(:has(.post-cover)) { grid-template-columns: 1fr; }
.post-cover { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #eef2f6; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-meta { color: var(--muted); font-size: .82rem; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.post-preview h2 { font-size: 1.2rem; margin-bottom: .4em; }
.post-preview h2 a { color: var(--text); }
.post-preview p { color: var(--muted); margin: 0 0 12px; }
.post { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.post > header { margin-bottom: 18px; }
.post-cover-full { width: 100%; max-height: 420px; object-fit: cover; border-radius: 10px; margin-bottom: 18px; }

/* --- Ошибки --- */
.error-page { padding: 60px 0; max-width: 620px; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--brand); margin: 0; line-height: 1; }

/* --- Подвал --- */
.site-footer { border-top: 1px solid var(--border); background: var(--panel); padding: 20px 0; }
.footer-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }

/* --- Мобильные --- */
@media (max-width: 900px) {
  .header-row { flex-wrap: wrap; padding: 10px 0; gap: 12px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; gap: 14px; }
  .header-tools { margin-left: auto; }
  .catalog-layout { grid-template-columns: 1fr; }
  .product { grid-template-columns: 1fr; }
  .post-preview { grid-template-columns: 1fr; }
  .post-cover { max-width: 320px; }
  .status-list dt { min-width: 0; }
}

@media (max-width: 560px) {
  .cart-table thead { display: none; }
  .cart-table tr { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .cart-table td { border: none; padding: 2px 0; }
  .cart-table tfoot tr { display: flex; justify-content: space-between; }
}
