/* ========================================
   МОТОРЫТУТ.РФ — Магазин двигателей и трансмиссий
   Тёмная индустриальная тема
   ======================================== */

:root {
  --motor-bg: #0d1117;
  --motor-surface: #161b22;
  --motor-surface2: #21262d;
  --motor-border: #30363d;
  --motor-accent: #f0883e;
  --motor-accent2: #e94560;
  --motor-text: #e6edf3;
  --motor-text2: #8b949e;
  --motor-gold: #f0c040;
  --motor-green: #3fb950;
}

body {
  width: 100%;
  height: 100%;
  background: var(--motor-bg);
  color: var(--motor-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, h4, h5, h6 { color: var(--motor-text); }
a { color: var(--motor-accent); text-decoration: none; }
a:hover { color: var(--motor-accent2); }

/* ===== TOP BAR ===== */
#top {
  background: var(--motor-surface);
  border-bottom: 1px solid var(--motor-border);
  margin-bottom: 0;
  padding: 4px 0;
}
#top ul.list-inline { margin-bottom: 0; }
#top .list-inline-item > a,
#top .list-inline-item .dropdown > a {
  font-size: 0.9em;
  color: var(--motor-text2);
  line-height: 36px;
  padding: 0 8px;
}
#top .list-inline-item > a:hover { color: var(--motor-accent); }

/* ===== HEADER ===== */
header {
  background: linear-gradient(180deg, var(--motor-surface) 0%, var(--motor-bg) 100%);
  border-bottom: 2px solid var(--motor-accent);
  padding: 20px 0;
}
#logo { text-align: center; margin: 0; }
#logo img { max-height: 135px; }
#logo h1 { margin: 0; }
#logo h1 a {
  font-size: 1.8em;
  font-weight: 800;
  color: var(--motor-accent);
  text-transform: uppercase;
  letter-spacing: 2px;
}
#logo h1 a:hover { color: var(--motor-accent2); }

/* ===== SEARCH ===== */
#search { margin-bottom: 0; }
#search .form-control-lg {
  height: 48px;
  font-size: 15px;
  background: var(--motor-surface2);
  border: 1px solid var(--motor-border);
  color: var(--motor-text);
  border-radius: 8px 0 0 8px;
}
#search .form-control-lg:focus {
  border-color: var(--motor-accent);
  box-shadow: 0 0 0 3px rgba(240,136,62,0.2);
}
#search .btn-lg {
  font-size: 16px;
  padding: 0 28px;
  background: var(--motor-accent);
  border: 1px solid var(--motor-accent);
  color: #000;
  font-weight: 700;
  border-radius: 0 8px 8px 0;
}
#search .btn-lg:hover { background: #e07b2e; }

/* ===== CART ===== */
#cart { margin-bottom: 0; }
#cart .btn-lg {
  background: var(--motor-surface2);
  border: 1px solid var(--motor-border);
  color: var(--motor-text);
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 8px;
}
#cart .btn-lg:hover { border-color: var(--motor-accent); }
#cart .dropdown-menu {
  background: var(--motor-surface);
  border: 1px solid var(--motor-border);
}
#cart .dropdown-menu li { min-width: 300px; }
#cart .img-thumbnail { min-width: 80px; }

/* ===== MENU / NAV ===== */
#menu {
  background: var(--motor-surface);
  border: 1px solid var(--motor-border);
  border-radius: 8px;
  min-height: 48px;
  padding: 0 1rem;
  margin-bottom: 0;
}
#menu .navbar-nav > li > a {
  color: var(--motor-text);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#menu .navbar-nav > li > a:hover {
  color: var(--motor-accent);
  background: rgba(240,136,62,0.08);
}
#menu .dropdown-menu {
  background: var(--motor-surface);
  border: 1px solid var(--motor-border);
  border-top: 2px solid var(--motor-accent);
  border-radius: 0 0 8px 8px;
}
#menu .dropdown-item { color: var(--motor-text); }
#menu .dropdown-item:hover {
  background: rgba(240,136,62,0.1);
  color: var(--motor-accent);
}
#menu .dropdown-divider { border-color: var(--motor-border); }
#category {
  float: left;
  font-size: 16px;
  font-weight: 700;
  line-height: 48px;
  color: var(--motor-accent);
}
#menu .navbar-toggler i { color: var(--motor-accent); font-size: 1.1em; }

@media (min-width: 960px) {
  #menu .dropdown:hover .dropdown-menu { display: block; }
}

/* ===== HERO SECTION ===== */
.hero-section {
  background: linear-gradient(135deg, #161b22 0%, #0d1117 50%, #1a0a00 100%);
  border-bottom: 3px solid var(--motor-accent);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(240,136,62,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-title {
  font-size: 3em;
  font-weight: 900;
  color: var(--motor-text);
  line-height: 1.1;
  margin-bottom: 15px;
}
.hero-title span { color: var(--motor-accent); }
.hero-subtitle {
  font-size: 1.2em;
  color: var(--motor-text2);
  margin-bottom: 30px;
  max-width: 500px;
}
.hero-search .form-control {
  height: 56px;
  font-size: 16px;
  background: var(--motor-surface);
  border: 2px solid var(--motor-border);
  color: var(--motor-text);
  border-radius: 12px 0 0 12px;
  padding: 0 20px;
}
.hero-search .form-control:focus {
  border-color: var(--motor-accent);
  box-shadow: 0 0 0 4px rgba(240,136,62,0.15);
}
.hero-search .btn {
  height: 56px;
  padding: 0 36px;
  font-size: 17px;
  font-weight: 700;
  background: var(--motor-accent);
  border: 2px solid var(--motor-accent);
  color: #0d1117;
  border-radius: 0 12px 12px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.hero-search .btn:hover { background: #e07b2e; border-color: #e07b2e; }
.hero-stats { margin-top: 30px; display: flex; gap: 40px; }
.hero-stat { text-align: center; }
.hero-stat-num {
  font-size: 2em;
  font-weight: 800;
  color: var(--motor-accent);
}
.hero-stat-label {
  font-size: 0.85em;
  color: var(--motor-text2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== CATEGORY CARDS ===== */
.category-cards { padding: 60px 0; }
.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title h2 {
  font-size: 2.2em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.section-title h2 span { color: var(--motor-accent); }
.section-title p { color: var(--motor-text2); font-size: 1.05em; }

.cat-card {
  background: var(--motor-surface);
  border: 1px solid var(--motor-border);
  border-radius: 16px;
  padding: 40px 25px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: block;
  color: var(--motor-text);
  text-decoration: none;
}
.cat-card:hover {
  border-color: var(--motor-accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(240,136,62,0.15);
  color: var(--motor-text);
}
.cat-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--motor-accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.cat-card:hover::after { transform: scaleX(1); }
.cat-icon {
  font-size: 3em;
  margin-bottom: 15px;
  display: block;
}
.cat-card h3 {
  font-size: 1.2em;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cat-card p {
  font-size: 0.9em;
  color: var(--motor-text2);
  margin: 0;
}
.cat-card .cat-count {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 14px;
  background: rgba(240,136,62,0.1);
  color: var(--motor-accent);
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
}

/* ===== ENGINE CARDS (главная) ===== */
.latest-engines { padding: 60px 0; }

.engine-card {
  background: var(--motor-surface);
  border: 1px solid var(--motor-border);
  border-radius: 14px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}
.engine-card:hover {
  border-color: var(--motor-accent);
  box-shadow: 0 8px 30px rgba(240,136,62,0.12);
  transform: translateY(-3px);
}
.engine-card-img {
  display: block;
  position: relative;
  background: #000;
  text-align: center;
  padding: 20px;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.engine-card-img img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.engine-card:hover .engine-card-img img { transform: scale(1.06); }
.engine-stock {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.engine-stock.in-stock {
  background: rgba(63,185,80,0.15);
  color: var(--motor-green);
  border: 1px solid rgba(63,185,80,0.3);
}
.engine-stock.out-stock {
  background: rgba(240,136,62,0.15);
  color: var(--motor-accent);
  border: 1px solid rgba(240,136,62,0.3);
}
.engine-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.engine-car-badge {
  display: inline-block;
  background: rgba(240,136,62,0.1);
  color: var(--motor-accent);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.78em;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
  align-self: flex-start;
}
.engine-card-body h3 {
  font-size: 0.95em;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.engine-card-body h3 a { color: var(--motor-text); }
.engine-card-body h3 a:hover { color: var(--motor-accent); }
.engine-meta {
  font-size: 0.8em;
  color: var(--motor-text2);
  margin-bottom: 10px;
  margin-top: auto;
}
.engine-price { margin-top: 10px; }
.engine-price .price-new {
  font-size: 1.25em;
  font-weight: 800;
  color: var(--motor-accent);
}
.engine-card-actions {
  display: flex;
  border-top: 1px solid var(--motor-border);
}
.engine-card-actions button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--motor-text2);
  padding: 12px;
  font-size: 0.88em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.engine-card-actions button:hover {
  background: var(--motor-accent);
  color: #0d1117;
}
.engine-card-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  border-left: 1px solid var(--motor-border);
  color: var(--motor-text2);
  transition: all 0.2s;
}
.engine-card-actions a:hover {
  background: rgba(240,136,62,0.08);
  color: var(--motor-accent);
}

/* ===== CAR FILTER ===== */
.car-filter {
  background: var(--motor-surface);
  border: 1px solid var(--motor-border);
  border-radius: 12px;
  overflow: hidden;
}
.car-filter .card-header {
  background: var(--motor-surface2);
  border-bottom: 1px solid var(--motor-border);
  padding: 15px 20px;
}
.car-filter .card-header h5 {
  margin: 0;
  font-weight: 700;
  font-size: 1.05em;
  color: var(--motor-accent);
}
.car-filter .card-body {
  padding: 20px;
  background: var(--motor-surface);
}
.car-filter .form-label {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--motor-text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.car-filter .form-select {
  background: var(--motor-surface2);
  border: 1px solid var(--motor-border);
  color: var(--motor-text);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}
.car-filter .form-select:focus {
  border-color: var(--motor-accent);
  box-shadow: 0 0 0 3px rgba(240,136,62,0.15);
}

/* ===== PRODUCT CARDS ===== */
.product-thumb {
  background: var(--motor-surface);
  border: 1px solid var(--motor-border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  height: 100%;
  transition: all 0.25s ease;
}
.product-thumb:hover {
  border-color: var(--motor-accent);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}
.product-thumb .image { text-align: center; padding: 15px; background: var(--motor-bg); }
.product-thumb .image img {
  max-height: 200px;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.product-thumb:hover .image img { transform: scale(1.04); }
.product-thumb .image a:hover { opacity: 1; }
.product-thumb .description {
  padding: 16px;
  margin-bottom: 52px;
}
.product-thumb .description h4 {
  font-size: 1em;
  font-weight: 700;
  margin-bottom: 6px;
}
.product-thumb .description h4 a {
  color: var(--motor-text);
}
.product-thumb .description h4 a:hover { color: var(--motor-accent); }
.product-thumb .description p {
  font-size: 0.85em;
  color: var(--motor-text2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-thumb .button {
  display: flex;
  position: absolute;
  width: 100%;
  bottom: 0;
}
.product-thumb .button button {
  width: 33.33%;
  border: none;
  border-top: 1px solid var(--motor-border);
  background: var(--motor-surface2);
  color: var(--motor-text2);
  line-height: 44px;
  text-align: center;
  transition: all 0.2s;
}
.product-thumb .button button:hover {
  color: var(--motor-accent);
  background: rgba(240,136,62,0.08);
}
.product-thumb .button button + button {
  border-left: 1px solid var(--motor-border);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  margin: 0 0 20px 0;
  padding: 10px 0;
  background: transparent;
  border: none;
}
.breadcrumb .breadcrumb-item { font-size: 0.9em; }
.breadcrumb .breadcrumb-item a { color: var(--motor-text2); }
.breadcrumb .breadcrumb-item a:hover { color: var(--motor-accent); }
.breadcrumb .breadcrumb-item.active { color: var(--motor-text); }
.breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: var(--motor-border);
  content: "/";
}

/* ===== PRICE ===== */
.price { margin-top: 8px; }
.price-new {
  font-size: 1.3em;
  font-weight: 800;
  color: var(--motor-accent);
}
.price-old {
  color: var(--motor-text2);
  text-decoration: line-through;
  font-size: 0.9em;
  margin-left: 8px;
}
.price-tax {
  color: var(--motor-text2);
  font-size: 0.75em;
  display: block;
}

/* ===== RATING ===== */
.rating .fa-star { color: var(--motor-gold); font-size: 13px; }
.rating .fa-star-o { color: var(--motor-border); }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--motor-accent);
  border-color: var(--motor-accent);
  color: #0d1117;
  font-weight: 700;
}
.btn-primary:hover {
  background: #e07b2e;
  border-color: #e07b2e;
  color: #0d1117;
}
.btn-light {
  background: var(--motor-surface2);
  border-color: var(--motor-border);
  color: var(--motor-text);
}
.btn-light:hover {
  background: var(--motor-surface);
  border-color: var(--motor-accent);
  color: var(--motor-accent);
}
.btn-outline-primary {
  border-color: var(--motor-accent);
  color: var(--motor-accent);
}
.btn-outline-primary:hover {
  background: var(--motor-accent);
  color: #0d1117;
}

/* ===== FORM CONTROLS ===== */
.form-select, .form-control {
  background: var(--motor-surface2);
  border: 1px solid var(--motor-border);
  color: var(--motor-text);
}
.form-select:focus, .form-control:focus {
  border-color: var(--motor-accent);
  box-shadow: 0 0 0 3px rgba(240,136,62,0.15);
  background: var(--motor-surface2);
  color: var(--motor-text);
}
.input-group-text {
  background: var(--motor-surface);
  border-color: var(--motor-border);
  color: var(--motor-text2);
}

/* ===== PAGINATION ===== */
.pagination .page-link {
  background: var(--motor-surface);
  border-color: var(--motor-border);
  color: var(--motor-text);
}
.pagination .page-link:hover {
  background: var(--motor-surface2);
  border-color: var(--motor-accent);
  color: var(--motor-accent);
}
.pagination .active .page-link {
  background: var(--motor-accent);
  border-color: var(--motor-accent);
  color: #0d1117;
  font-weight: 700;
}

/* ===== FOOTER ===== */
footer {
  background: var(--motor-surface);
  border-top: 3px solid var(--motor-accent);
  padding: 50px 0 30px;
  margin-top: 60px;
  color: var(--motor-text2);
  position: relative;
  bottom: auto;
  width: 100%;
}
footer h5 {
  font-size: 0.95em;
  font-weight: 700;
  color: var(--motor-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
footer a { color: var(--motor-text2); font-size: 0.9em; }
footer a:hover { color: var(--motor-accent); }
footer hr { border-color: var(--motor-border); margin: 25px 0; }
footer ul.list-unstyled li { margin-bottom: 6px; }

/* ===== STANDARD OVERRIDES ===== */
legend {
  border-bottom: 1px solid var(--motor-border);
  color: var(--motor-text);
}
label { color: var(--motor-text2); }
.nav-tabs {
  border-bottom: 1px solid var(--motor-border);
  margin-bottom: 15px;
}
.nav-tabs .nav-link {
  color: var(--motor-text2);
  border: none;
}
.nav-tabs .nav-link:hover { color: var(--motor-accent); border: none; }
.nav-tabs .nav-link.active {
  background: transparent;
  color: var(--motor-accent);
  border: none;
  border-bottom: 2px solid var(--motor-accent);
  font-weight: 700;
}
.card {
  background: var(--motor-surface);
  border-color: var(--motor-border);
}
.card-header {
  background: var(--motor-surface2);
  border-bottom-color: var(--motor-border);
}
.table {
  color: var(--motor-text);
}
.table td, .table th {
  border-color: var(--motor-border);
}
hr { border-color: var(--motor-border); }
.alert-success {
  background: rgba(63,185,80,0.1);
  border-color: var(--motor-green);
  color: var(--motor-green);
}
.alert-danger {
  background: rgba(233,69,96,0.1);
  border-color: var(--motor-accent2);
  color: var(--motor-accent2);
}
.bg-primary {
  background: var(--motor-accent) !important;
}
.text-muted { color: var(--motor-text2) !important; }

/* ===== CONTAINER ===== */
#container {
  width: 100%;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
#content, #column-left, #column-right { padding-bottom: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-title { font-size: 2em; }
  .hero-section { padding: 40px 0; }
  .hero-stats { gap: 20px; }
  .hero-stat-num { font-size: 1.5em; }
  #logo { text-align: center; margin-bottom: 15px; }
  #search { margin-bottom: 10px; }
  .cat-card { padding: 25px 15px; }
  .section-title h2 { font-size: 1.6em; }
  .engine-card-body h3 { font-size: 0.88em; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--motor-bg); }
::-webkit-scrollbar-thumb { background: var(--motor-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--motor-accent); }

/* ===== COOKIE ===== */
#cookie {
  background: var(--motor-surface);
  border-top: 1px solid var(--motor-border);
  color: var(--motor-text);
}

/* ===== POPULAR BRANDS ===== */
.popular-brands { padding: 60px 0; }
.brand-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--motor-surface);
  border: 1px solid var(--motor-border);
  border-radius: 14px;
  padding: 24px 12px 18px;
  text-align: center;
  text-decoration: none;
  color: var(--motor-text);
  transition: all 0.3s ease;
  height: 100%;
}
.brand-card:hover {
  border-color: var(--motor-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(240,136,62,0.12);
  color: var(--motor-text);
}
.brand-icon {
  font-size: 2.4em;
  color: var(--motor-accent);
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}
.brand-card:hover .brand-icon {
  transform: scale(1.15);
}
.brand-name {
  font-size: 0.9em;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ===== ADVANTAGES ===== */
.advantages {
  padding: 60px 0;
  background: linear-gradient(180deg, var(--motor-surface) 0%, var(--motor-bg) 100%);
  border-top: 1px solid var(--motor-border);
  border-bottom: 1px solid var(--motor-border);
}
.adv-card {
  text-align: center;
  padding: 36px 24px;
  background: var(--motor-surface2);
  border: 1px solid var(--motor-border);
  border-radius: 16px;
  height: 100%;
  transition: all 0.3s ease;
}
.adv-card:hover {
  border-color: var(--motor-accent);
  box-shadow: 0 8px 30px rgba(240,136,62,0.1);
}
.adv-icon {
  font-size: 3em;
  color: var(--motor-accent);
  margin-bottom: 16px;
}
.adv-card h3 {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--motor-text);
}
.adv-card p {
  font-size: 0.9em;
  color: var(--motor-text2);
  line-height: 1.5;
  margin: 0;
}

/* ===== HOW TO ORDER ===== */
.how-to-order { padding: 60px 0; }
.step-card {
  text-align: center;
  padding: 36px 24px;
  background: var(--motor-surface);
  border: 1px solid var(--motor-border);
  border-radius: 16px;
  height: 100%;
  position: relative;
  transition: all 0.3s ease;
}
.step-card:hover {
  border-color: var(--motor-accent);
  box-shadow: 0 8px 30px rgba(240,136,62,0.1);
}
.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  background: var(--motor-accent);
  color: #0d1117;
  font-size: 1.6em;
  font-weight: 900;
  border-radius: 50%;
  line-height: 1;
}
.step-card h3 {
  font-size: 1.1em;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--motor-text);
}
.step-card p {
  font-size: 0.9em;
  color: var(--motor-text2);
  line-height: 1.5;
  margin: 0;
}
