/* === Общая структура === */
.header {
  padding: 14px 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-logo img {
  height: 40px;
  object-fit: contain;
}

.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 24px;
  position: relative;
}

.header-catalog {
  position: static;
}

.header-button {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: none;
  background: #f58220;
  color: #fff;
  cursor: pointer;
}

.header-button img {
  width: 15px;
  height: 15px;
}

/* === Меню === */
.header-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px 40px;
  background: #fff;
  border: 1px solid #e7e9ee;
  box-shadow: 0 20px 42px rgba(31, 41, 51, 0.12);
  border-radius: 8px;
  padding: 24px 32px;
  margin-top: 10px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.header-menu-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header-menu-column h5 a {
  font-weight: 800;
  margin-bottom: 12px;
  color: #db6812;
  font-size: 20px;
}

.header-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  width: 100%;
}

.header-menu a {
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.header-menu a:hover {
  color: #db6812;
}

/* Поиск */
.header-search {
  position: relative;
  flex: 1;
}

.header-search input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 14px;
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.header-search input:focus {
  border-color: #f58220;
  box-shadow: 0 0 0 4px rgba(245, 130, 32, 0.14);
}

.header-search button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
}

.header-search button img {
  width: 20px;
  height: 20px;
}

/* Правая часть */
.header-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-location {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #e7e9ee;
  border-radius: 8px;
  color: #344054;
  font-weight: 800;
}

/* === Корзина === */
.header-shopping-cart {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: black; /* исходный цвет иконки и текста */
  transition: color 0.2s ease;
}

.header-shopping-cart .cart-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.header-shopping-cart:hover {
  border-color: #f7d5b6;
  background: #fff6ed;
  color: #db6812;
}

.header-shopping-cart:hover .cart-icon {
  transform: scale(1.1); /* лёгкий эффект увеличения */
}


/* Пользователь */
.header-user-square {
  text-decoration: none;
  color: black;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  cursor: pointer;
}

.header-user-square:hover {
  background-color: #fff6ed;
  color: #db6812;
  opacity: 98%;
}

.header-shopping-cart img,
.header-user-square img {
  width: 24px;
  height: 24px;
}

.header-shopping-cart p,
.header-user-square p {
  margin: 0;
}

.header-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-username {
  font-weight: 500;
  color: #333;
}

.header-logout-form {
  margin: 0;
}

.header-logout-button {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  color: #db6812;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 400;
}

.header-logout-button:hover {
  color: #f58220;
}

/* === Toast === */
.header-toast {
  min-width: 250px;
  padding: 15px 20px;
  border-radius: 8px;
  background-color: #f58220;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.header-toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* Мобильный бургер */
.header-mobile-burger, .burger-menu {
  display: none;
}

.header-mobile-burger img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* === Адаптив === */
@media screen and (max-width: 768px) {
  .header-center, .header-right {
    display: none;
  }
  .header-mobile-burger {
    display: block;
  }
  .burger-menu {
    display: block;
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: #fff;
    z-index: 2000;
    padding: 24px;
    box-shadow: -4px 0 12px rgba(0,0,0,0.2);
    overflow-y: auto;
    transition: right 0.3s ease;
  }
  .burger-menu.show { right: 0; }
  .burger-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 500;
  }
  .burger-menu-close {
    font-size: 28px;
    cursor: pointer;
  }
  .burger-category a {
    display: block;
    margin-left: 10px;
    margin-bottom: 6px;
    text-decoration: none;
    color: #333;
  }
  .burger-search {
    display: flex;
    margin-bottom: 16px;
  }
  .burger-search input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
  }
  .burger-search button {
    background: none;
    border: none;
    margin-left: 8px;
    cursor: pointer;
  }
  .burger-favorites,
  .burger-login,
  .burger-user-info {
    display: block;
    padding: 8px 0;
    font-size: 16px;
    text-decoration: none;
    color: #333;
  }
  .burger-favorites img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
  }

  /* Мобильный пользователь */
  .burger-user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
  }
  .burger-username {
    font-weight: 500;
    color: #333;
  }
  .burger-logout-form {
    margin: 0;
  }
  .burger-logout-button {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: #db6812;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 400;
  }
  .burger-logout-button:hover {
    color: #f58220;
  }
}
