/**
 * GT Market — базовые стили
 * Primary #1F7FE5 · Secondary #23C9A6 · Accent #7CF24A
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --primary: #1F7FE5;
  --primary-hover: #1565c4;
  --primary-light: rgba(31, 127, 229, 0.12);
  --secondary: #23C9A6;
  --secondary-hover: #1ab896;
  --secondary-light: rgba(35, 201, 166, 0.12);
  --accent: #7CF24A;
  --accent-hover: #68e038;
  --accent-light: rgba(124, 242, 74, 0.2);
  --gradient: linear-gradient(135deg, #1F7FE5 0%, #23C9A6 50%, #7CF24A 100%);
  --gradient-soft: linear-gradient(180deg, rgba(31, 127, 229, 0.06) 0%, transparent 60%);
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 12px 40px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

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

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(31, 127, 229, 0.35);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--secondary-hover);
}

.btn-accent {
  background: var(--accent);
  color: var(--ink);
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.site-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.section {
  margin-top: 56px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* Карточки товаров */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.product-card a {
  color: inherit;
}

.product-card a:hover {
  color: inherit;
}

.product-card__image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--border-soft);
}

.product-card__body {
  padding: 20px;
}

.product-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-card__price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}

.product-card__meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Сетка категорий */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--secondary);
  text-decoration: none;
  color: inherit;
}

.category-card__name {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.category-card::after {
  content: '→';
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-left: auto;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}

.category-card:hover::after {
  opacity: 1;
  transform: translateX(4px);
}

/* ========== Шапка и футер (все страницы с base_site) ========== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.site-brand:hover {
  color: var(--ink);
}

.site-brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.site-brand__name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-search {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}

.site-search__input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
}

.site-search__input::placeholder {
  color: var(--muted);
}

.site-search__input:focus {
  outline: none;
}

.site-search__btn {
  padding: 12px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.site-search__btn:hover {
  background: var(--primary-hover);
}

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.site-header__link {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.site-header__link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.site-header__link--btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn--header {
  padding: 10px 18px;
  font-size: 14px;
}

.site-lang {
  position: relative;
}

.site-lang summary {
  list-style: none;
  cursor: pointer;
}

.site-lang summary::-webkit-details-marker {
  display: none;
}

.site-lang__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 8px;
  min-width: 100px;
  box-shadow: var(--shadow-hover);
  z-index: 50;
  border: 1px solid var(--border);
}

.site-lang__dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.site-lang__dropdown a:hover,
.site-lang__dropdown a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.site-main {
  min-height: 60vh;
}

.site-footer {
  margin-top: 64px;
  padding: 40px 24px 24px;
  background: var(--ink);
  color: rgba(255,255,255,0.8);
}

.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.site-footer__name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.site-footer__tagline {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer__links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14px;
}

.site-footer__links a:hover {
  color: #fff;
}

.site-footer__bottom {
  padding-top: 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.my-inquiries-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  z-index: 200;
  overflow-y: auto;
}

.my-inquiries-panel__inner {
  padding: 24px;
}

.my-inquiries-panel__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 20px;
}

.my-inquiries-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.my-inquiries-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}

.my-inquiries-list .empty {
  color: var(--muted);
  padding: 24px 0;
}

.filters-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-hover);
  z-index: 150;
  border: 1px solid var(--border);
}

.filters-panel.is-open {
  display: block;
}

.filters-panel__inner {
  min-width: 280px;
}

.filters-panel__row {
  margin-bottom: 16px;
}

.filters-panel__row:last-child {
  margin-bottom: 0;
}

.filters-panel label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.filters-panel input,
.filters-panel select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
}

.filters-panel .btn {
  margin-right: 8px;
}

@media (max-width: 768px) {
  .site-shell { padding: 0 16px 48px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .categories-grid { grid-template-columns: 1fr; }
  .site-header__inner {
    padding: 12px 16px;
  }
  .site-search {
    order: 3;
    max-width: none;
    width: 100%;
  }
}
