/* ========================================
   FarmParts.ru — OpenCart 3.x Theme
   Запчасти для сельхозтехники
   ======================================== */

:root {
  --green-dark:   #1a6b2e;
  --green-mid:    #2d8a42;
  --green-light:  #e8f5eb;
  --gold:         #f5a623;
  --gold-dark:    #c98100;
  --text-main:    #1c1c1c;
  --text-muted:   #6b7280;
  --bg:           #f4f6f4;
  --white:        #ffffff;
  --border:       #d8e5da;
  --shadow:       0 2px 8px rgba(0,0,0,0.08);
  --radius:       8px;
  --radius-lg:    12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  color: var(--text-main);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--gold-dark); }

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

/* ── Топ-бар ── */
#top {
  background: var(--green-dark);
  color: #a8d5b5;
  font-size: 13px;
  padding: 6px 0;
}
#top a { color: #a8d5b5; }
#top a:hover { color: var(--gold); }
#top .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; }

/* ── Шапка ── */
#header {
  background: var(--white);
  border-bottom: 3px solid var(--green-dark);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
#header .container { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

#logo { flex-shrink: 0; }
#logo img, #logo svg { height: 64px; width: auto; }

/* Поиск */
#search {
  flex: 1;
  min-width: 200px;
  max-width: 560px;
}
#search .input-group { display: flex; }
#search input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
#search input:focus { border-color: var(--green-mid); }
#search button {
  background: var(--gold);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background .2s;
}
#search button:hover { background: var(--gold-dark); }

/* Корзина и аккаунт */
#cart-account { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.btn-header-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-header-icon:hover { border-color: var(--green-mid); color: var(--green-dark); }
.btn-header-icon .icon { font-size: 22px; }

#cart-btn {
  background: var(--green-dark);
  color: var(--white);
  border-color: var(--green-dark);
}
#cart-btn:hover { background: var(--green-mid); color: var(--white); }

/* ── Навигация ── */
#nav {
  background: var(--green-dark);
}
#nav ul { list-style: none; display: flex; flex-wrap: wrap; }
#nav ul li a {
  display: block;
  padding: 12px 18px;
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  transition: background .2s;
}
#nav ul li a:hover,
#nav ul li.active a { background: var(--gold); color: var(--white); }

/* Дропдаун */
#nav ul li { position: relative; }
#nav ul li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  border-top: 3px solid var(--gold);
  z-index: 200;
  flex-direction: column;
}
#nav ul li:hover > ul { display: flex; }
#nav ul li ul li a { color: var(--text-main); padding: 10px 18px; font-weight: 400; }
#nav ul li ul li a:hover { background: var(--green-light); color: var(--green-dark); }

/* ── Хлебные крошки ── */
#breadcrumb {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
#breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; font-size: 13px; color: var(--text-muted); }
#breadcrumb ol li + li::before { content: '›'; margin-right: 4px; }
#breadcrumb ol li a { color: var(--green-dark); }

/* ── Контейнер ── */
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ── Главный баннер ── */
#slideshow {
  background: linear-gradient(135deg, var(--green-dark) 0%, #0f4a1f 100%);
  color: var(--white);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}
#slideshow::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 400px;
  height: 400px;
  background: rgba(245,166,35,.08);
  border-radius: 50%;
}
.slideshow-inner { position: relative; z-index: 1; }
.slideshow-inner h1 { font-size: 38px; font-weight: 800; margin-bottom: 12px; line-height: 1.2; }
.slideshow-inner h1 span { color: var(--gold); }
.slideshow-inner p { font-size: 18px; color: #a8d5b5; margin-bottom: 28px; max-width: 520px; }
.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  transition: background .2s, transform .15s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--gold-dark); color: var(--white); transform: translateY(-1px); }

/* ── Преимущества ── */
#advantages {
  background: var(--white);
  padding: 24px 0;
  border-bottom: 2px solid var(--border);
}
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.adv-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-right: 1px solid var(--border);
}
.adv-item:last-child { border-right: none; }
.adv-icon { font-size: 32px; flex-shrink: 0; }
.adv-text strong { display: block; font-size: 14px; font-weight: 700; color: var(--green-dark); }
.adv-text span { font-size: 13px; color: var(--text-muted); }

/* ── Секции на главной ── */
.section { padding: 40px 0; }
.section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
}
.section-title span { color: var(--gold); }

/* ── Категории ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.category-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 12px 16px;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
}
.category-card:hover {
  border-color: var(--green-mid);
  box-shadow: 0 4px 16px rgba(26,107,46,.12);
  transform: translateY(-2px);
}
.category-card:hover .cat-name { color: var(--green-dark); }
.cat-icon { font-size: 36px; margin-bottom: 10px; display: block; }
.cat-name { font-size: 13px; font-weight: 600; color: var(--text-main); }
.cat-count { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Карточка товара ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--green-mid);
  box-shadow: 0 6px 20px rgba(26,107,46,.12);
  transform: translateY(-2px);
}
.product-img {
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
}
.product-img img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform .3s; }
.product-card:hover .product-img img { transform: scale(1.04); }
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gold);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.product-badge.new { background: var(--green-mid); }
.product-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-sku { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.product-name { font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; line-height: 1.4; flex: 1; }
.product-name a { color: inherit; }
.product-name a:hover { color: var(--green-dark); }
.product-compat { font-size: 12px; color: var(--green-dark); margin-bottom: 10px; font-weight: 500; }
.product-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.price-new { font-size: 20px; font-weight: 800; color: var(--green-dark); }
.price-old { font-size: 14px; color: var(--text-muted); text-decoration: line-through; }
.product-actions { display: flex; gap: 8px; }
.btn-cart {
  flex: 1;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-cart:hover { background: var(--green-mid); }
.btn-wish {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all .2s;
}
.btn-wish:hover { border-color: var(--gold); color: var(--gold); }

/* ── Страница категории с боковой панелью ── */
#column-left {
  width: 260px;
  flex-shrink: 0;
}
.filter-box {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.filter-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green-light);
}
.filter-list { list-style: none; }
.filter-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.filter-list li:last-child { border-bottom: none; }
.filter-list a { font-size: 14px; color: var(--text-main); display: flex; justify-content: space-between; }
.filter-list a:hover { color: var(--green-dark); }
.filter-list .count { color: var(--text-muted); font-size: 12px; }
.filter-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-size: 14px; }
.filter-check input { accent-color: var(--green-dark); width: 15px; height: 15px; }

/* ── Основная колонка + лэйаут ── */
#content-row { display: flex; gap: 24px; align-items: flex-start; }
#content-main { flex: 1; min-width: 0; }

/* Тулбар каталога */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.catalog-toolbar select {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  background: var(--white);
}
.found-count { font-size: 14px; color: var(--text-muted); }

/* ── Страница товара ── */
.product-detail { display: flex; gap: 40px; flex-wrap: wrap; }
.product-detail-images { flex: 0 0 440px; }
.product-detail-info { flex: 1; min-width: 280px; }
.main-image {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.main-image img { width: 100%; display: block; }
.thumb-row { display: flex; gap: 8px; }
.thumb {
  width: 72px;
  height: 72px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s;
}
.thumb:hover, .thumb.active { border-color: var(--green-mid); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-detail-info h1 { font-size: 26px; font-weight: 800; color: var(--text-main); margin-bottom: 10px; line-height: 1.3; }
.detail-sku { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.detail-sku span { font-weight: 600; color: var(--text-main); }
.compat-block {
  background: var(--green-light);
  border-left: 4px solid var(--green-mid);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 18px;
}
.compat-block strong { font-size: 13px; color: var(--green-dark); display: block; margin-bottom: 6px; }
.compat-block ul { list-style: none; }
.compat-block ul li { font-size: 13px; color: var(--text-main); padding: 2px 0; }
.compat-block ul li::before { content: '✓ '; color: var(--green-mid); font-weight: 700; }

.detail-price-block { margin: 20px 0; }
.detail-price { font-size: 34px; font-weight: 900; color: var(--green-dark); }
.detail-price-old { font-size: 18px; color: var(--text-muted); text-decoration: line-through; margin-left: 8px; }
.detail-stock { font-size: 14px; font-weight: 600; margin-top: 8px; }
.in-stock { color: var(--green-mid); }
.out-stock { color: #dc2626; }

.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.qty-input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty-input button { background: var(--bg); border: none; padding: 10px 14px; font-size: 18px; cursor: pointer; }
.qty-input input { width: 52px; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); padding: 10px 0; font-size: 16px; }
.btn-cart-detail {
  flex: 1;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.btn-cart-detail:hover { background: var(--green-mid); }

/* ── Табы описания ── */
.tabs { margin-top: 40px; }
.tab-nav { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}
.tab-btn.active { color: var(--green-dark); border-bottom-color: var(--green-dark); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Футер ── */
#footer {
  background: var(--green-dark);
  color: #a8d5b5;
  padding: 48px 0 0;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 { color: var(--white); font-size: 15px; margin-bottom: 14px; font-weight: 700; }
.footer-col p { font-size: 14px; line-height: 1.7; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: #a8d5b5; font-size: 14px; transition: color .2s; }
.footer-col ul li a:hover { color: var(--gold); }
.footer-logo { margin-bottom: 12px; }
.footer-logo img, .footer-logo svg { height: 52px; filter: brightness(0) invert(1); }
.footer-contacts li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.footer-contacts .icon { flex-shrink: 0; }
.footer-bottom {
  background: rgba(0,0,0,.2);
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: #5aad6e;
}

/* ── Пагинация ── */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-main);
  transition: all .2s;
}
.pagination a:hover { border-color: var(--green-mid); color: var(--green-dark); }
.pagination .active { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }

/* ── Сообщения ── */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--green-mid); }
.alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ── Responsive ── */
@media (max-width: 991px) {
  .advantages-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  #content-row { flex-direction: column; }
  #column-left { width: 100%; }
}
@media (max-width: 767px) {
  #header .container { gap: 12px; }
  #logo img, #logo svg { height: 48px; }
  .slideshow-inner h1 { font-size: 26px; }
  .advantages-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .product-detail { flex-direction: column; }
  .product-detail-images { flex: none; width: 100%; }
  #nav ul { overflow-x: auto; flex-wrap: nowrap; }
}
@media (max-width: 479px) {
  #search { min-width: 100%; order: 3; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}