/* ==================== ПЕРЕМЕННЫЕ (ЦВЕТА) ==================== */
:root {
  --color-gold: #FFD700;
  --color-bg-dark: #000;
  --color-text: #FFD700;
  --color-text-alt: #888;
  --color-line: #fff;
  --color-error: #FF4D4D;
  --color-product-bg: #1a1a1a;
  --color-tag-bg: #333;
  --color-highlight: #0f0;
  --color-bg-darker: #111;
  --color-white: #fff;
  --color-border-dark: #555;
  --color-placeholder: #aaa;
  --color-bg-main: rgb(15, 17, 17);
}

/* ==================== БАЗОВАЯ СБРОС И ОСНОВА ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Orbitron', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: transparent;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==================== ЛОГОТИП ==================== */
.logo {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  user-select: none;
}

.logo h1 {
  font-size: 3em;
  letter-spacing: 4px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--color-gold);
  text-shadow: 0 0 25px var(--color-gold), 0 0 5px var(--color-white);
  line-height: 1;
  margin: 0;
}

.logo a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

/* ==================== ШАПКА ==================== */
header {
  position: relative;
  height: 100px;
  background-color: var(--color-bg-dark);
  border-bottom: 3px solid var(--color-gold);
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.center-section {
  display: flex;
  justify-content: center;
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
  flex: none;
}

.right-section {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ==================== КОРЗИНА ==================== */
.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-gold);
}

.cart-icon {
  width: 28px;
  height: 28px;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background-color: var(--color-error);
  color: var(--color-white);
  font-size: 0.75em;
  padding: 2px 6px;
  border-radius: 50%;
  font-weight: 900;
  user-select: none;
}

.divider {
  width: 1px;
  height: 30px;
  background-color: var(--color-gold);
  opacity: 0.5;
}

/* ==================== АККАУНТ ==================== */
.account-info,
.guest-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.account-text,
.guest-text {
  color: var(--color-gold);
  font-weight: 600;
  text-decoration: none;
  transition: text-decoration 0.3s ease;
  white-space: nowrap;
  font-size: 0.9rem;
  cursor: pointer;
}

.account-text:hover,
.guest-text:hover {
  text-decoration: underline;
}

.enter-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  cursor: pointer;
}

.guest-info {
  flex-direction: column;
}

/* ==================== НАВИГАЦИЯ ==================== */
nav a {
  color: var(--color-gold);
  text-decoration: none;
  margin-left: 30px;
  font-weight: 700;
  font-size: 1.2em;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: all 0.3s ease;
  user-select: none;
}

nav a:hover {
  background-color: var(--color-gold);
  color: #000;
  border-color: var(--color-gold);
  box-shadow: 0 0 15px var(--color-gold);
}

/* ==================== КАТАЛОГ ==================== */
.dropdown {
  position: relative;
  z-index: 1000;
}

.dropdown-btn {
  background: transparent;
  color: var(--color-gold);
  border: 2px solid var(--color-gold);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s;
}

.dropdown-btn:hover {
  background-color: var(--color-gold);
  color: var(--color-bg-dark);
  box-shadow: 0 0 12px var(--color-gold);
}

.dropdown-content {
  position: absolute;
  top: 110%;
  left: 0;
  background: var(--color-bg-darker);
  border: 2px solid var(--color-gold);
  border-radius: 12px;
  min-width: 320px;
  display: none;
  flex-direction: column;
  padding: 20px;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
  animation: fadeIn 0.3s ease-in-out;
}

.dropdown-content.show {
  display: flex;
}

.dropdown-item {
  margin-bottom: 16px;
}

.submenu-trigger {
  color: var(--color-gold);
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease-in-out;
}

.submenu-trigger:hover {
  color: #0ff;
}

.submenu {
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  padding: 10px 0 0 10px;
  border-left: 2px solid var(--color-gold);
  margin-top: 10px;
  animation: fadeInSubmenu 0.3s ease-in-out;
}

.submenu.show {
  display: flex;
}

.submenu-column {
  min-width: 140px;
  display: flex;
  flex-direction: column;
}

.submenu-column strong a {
  color: var(--color-gold);
  font-size: 1.05em;
  margin-bottom: 4px;
  display: inline-block;
}

.submenu-column a {
  color: #0ff;
  text-decoration: none;
  padding: 3px 0;
  transition: color 0.2s ease-in-out;
}

.submenu-column a:hover {
  color: var(--color-gold);
}

/* ==================== ПОИСК ==================== */
.search-form {
  display: flex;
  align-items: center;
}

.search-form input[type="text"] {
  background-color: var(--color-bg-darker);
  color: var(--color-gold);
  border: 2px solid var(--color-gold);
  border-radius: 8px;
  padding: 8px 15px;
  font-size: 1em;
  width: 600px;
  max-width: 100%;
  transition: all 0.3s ease;
}

.search-form input::placeholder {
  color: var(--color-placeholder);
}

.search-form input:focus {
  outline: none;
  background-color: var(--color-bg-dark);
  box-shadow: 0 0 10px var(--color-gold);
}

.search-button {
  background-color: var(--color-gold);
  color: #000;
  border: none;
  padding: 8px 12px;
  margin-left: 8px;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-button:hover {
  background-color: #fff;
  box-shadow: 0 0 10px var(--color-gold);
}

/* ==================== КОНТЕНТ ==================== */
main {
  background-color: var(--color-bg-main);
  color: var(--color-text);
  flex: 1;
  position: relative;
  z-index: 1;
}

/* ==================== БРЕНДЫ ==================== */
.brands-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 5%;
  padding: 10px;
  justify-content: center;
  margin: 10px 0;
}

.brand-card-link {
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
  transition: transform 0.3s ease;
}

.brand-card-link:hover {
  transform: scale(1.05);
}

.brand-card {
  width: 200px;
  height: 180px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.brand-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ==================== ТОВАРЫ ==================== */
#product-title {
  padding-left: 20px;
}

.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.product-card {
  background-color: var(--color-product-bg);
  padding: 15px;
  border: 1px solid var(--color-border-dark);
  border-radius: 8px;
  text-align: center;
  animation: fadeInUp 0.6s ease both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
  margin: 20px 20px;
}

.product-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.product-card img {
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 5px;
}

.product-card h3 {
  margin: 10px 0;
  color: var(--color-gold);
}

.product-card .price {
  font-weight: bold;
  color: var(--color-highlight);
}

.product-card a {
  display: inline-block;
  margin: 8px 5px 0;
  padding: 6px 12px;
  font-size: 0.9em;
  color: black;
  background-color: var(--color-gold);
  border: 1px solid var(--color-border-dark);
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.product-card a:hover {
  background-color: black;
  color: var(--color-gold);
  border-color: var(--color-gold);
}

/* ==================== ТЕГИ ==================== */
.tags {
  margin-top: 10px;
}

.tag {
  display: inline-block;
  background-color: var(--color-tag-bg);
  color: var(--color-gold);
  padding: 3px 8px;
  margin: 2px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ==================== РЕЗУЛЬТАТЫ ПОИСКА ==================== */
.search-results h2 {
  margin: 20px 0;
  font-size: 2em;
  text-align: center;
  color: var(--color-gold);
  text-shadow: 0 0 10px var(--color-gold);
}

.no-results,
.error-message {
  text-align: center;
  margin: 30px auto;
  font-size: 1.2em;
  color: var(--color-error);
  font-weight: bold;
  background-color: rgba(255, 77, 77, 0.1);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--color-error);
  max-width: 500px;
  box-shadow: 0 0 15px rgba(255, 77, 77, 0.3);
}

/* ==================== ЛИНИЯ С ЗАГОЛОВКОМ ==================== */
.line-with-text {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

.line-with-text h2 {
  white-space: nowrap;
  color: var(--color-gold);
  font-size: 2em;
}

.line-with-text .line {
  flex-grow: 1;
  height: 2px;
  background-color: var(--color-line);
}

/* ==================== FOOTER ==================== */
footer {
  background-color: var(--color-bg-dark);
  color: var(--color-text-alt);
  text-align: center;
  padding: 15px;
  border-top: 1px solid var(--color-border-dark);
  position: relative;
  z-index: 1;
}

/* ==================== ВИДЕОФОН ==================== */
#video-background {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

#bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-text {
  position: absolute;
  top: 68%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  text-align: center;
  z-index: 2;
  text-shadow: 0 4px 12px rgba(0,0,0,0.9);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  max-width: 90vw;
  user-select: none;
  opacity: 0;
  animation: fadeInUpHero 1.2s ease forwards;
  animation-delay: 0.3s;
}

.hero-text h2 {
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 4px;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  color: #00bfff;
  text-shadow: 0 3px 8px rgba(0,0,0,0.8);
}

.hero-text h1 {
  font-size: 3.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
}

.hero-text h1 b {
  color: #00bfff;
  text-shadow: 0 0 10px #00bfff;
  font-weight: 900;
}

.scroll-down {
  display: inline-block;
  font-size: 3.5rem;
  color: var(--color-white);
  text-decoration: none;
  cursor: pointer;
  animation: bounce 2s infinite;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
  margin-top: 18px;
  transition: color 0.3s ease, filter 0.3s ease;
}

.scroll-down:hover {
  color: #00bfff;
  filter: drop-shadow(0 0 12px #00bfff);
}

/* ==================== СООБЩЕНИЕ ==================== */
.message-container {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  pointer-events: none;
}

.message {
  display: inline-block;
  padding: 15px 25px;
  border-radius: 12px;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  color: var(--color-white);
  max-width: 600px;
  width: fit-content;
  word-wrap: break-word;
  text-align: center;
  background-color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: fadein 0.5s ease, fadeout 0.5s ease 4s;
  opacity: 0;
  animation-fill-mode: forwards;
  pointer-events: auto;
}

.message.success { background-color: #28a745; }
.message.info { background-color: #007bff; }
.message.warning { background-color: #ffc107; color: #000; }
.message.error { background-color: #dc3545; }

/* ==================== АДАПТИВНОСТЬ ==================== */
@media (max-width: 900px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  nav a {
    margin-left: 0;
  }
}

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

/* ==================== АНИМАЦИИ ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInSubmenu {
  from {
    opacity: 0;
    transform: translateX(5px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(15px); }
}

@keyframes fadeInUpHero {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes fadein {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeout {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(30px); }
}