header {
  width: 100%;
  background-color: var(--y-color-bg);
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.top-header {
  background-color: var(--y-color-primary);
  color: var(--y-color-bg);
  z-index: 100;
}
.top-header ul {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.top-header ul li a {
  font-size: var(--y-space-14);
  text-decoration: none;
  color: var(--y-color-bg);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.top-header ul li a.active,
.top-header ul li a:hover {
  border-bottom: 1px solid white;
}

header .logo {
  gap: 32px;
  width: 100%;
}
header .logo > a img {
  width: 67px;
  height: 68px;
  cursor: pointer;
  object-fit: contain;
}
header .logo ul.desktop-menu,
header .logo form.desktop-menu {
  list-style: none;
  gap: var(--y-space-8);
  padding: var(--y-space-8) var(--y-space-12);
  background-color: var(--y-color-warning);
  color: var(--y-color-bg);
  border-radius: var(--y-space-8);
  width: 63%;
}
header .logo ul.desktop-menu input,
header .logo form.desktop-menu input {
  width: 100%;
  flex: 1;
  min-width: 0;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--y-color-bg);
  font-size: var(--y-text-md);
}
header .logo ul.desktop-menu input:focus,
header .logo form.desktop-menu input:focus {
  outline: none;
}
header .logo ul.desktop-menu input::placeholder,
header .logo form.desktop-menu input::placeholder {
  color: rgba(255, 255, 255, 0.9);
}
header .logo ul li a {
  text-decoration: none;
  color: var(--y-color-muted);
  font-size: 20px;
  line-height: 28px;
  padding: 16px 8px;
  font-weight: 600;
  transition: color 0.3s ease;
}
header .logo ul li a:hover {
  color: var(--y-color-primary);
}
header .user-nav {
  gap: var(--y-space-6);
}
header .user-nav a {
  text-decoration: none;
  color: var(--y-color-muted);
  font-size: 20px;
  line-height: var(--y-space-24);
  padding: 16px 8px;
  font-weight: 600;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
}
header .user-nav a:nth-child(1) {
  text-decoration: none;
  color: var(--y-color-primary);
  font-size: 14px;
  width: 200px;
  gap: var(--y-text-xs);
  line-height: var(--y-space-24);
  padding: 16px 8px;
  font-weight: 600;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--y-color-primary);
  padding-block: 0;
}
header .user-nav img {
  width: 30px;
}
header .user-nav a.cart-link {
  position: relative;
}
header .user-nav .cart-count {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--y-color-primary);
  color: white;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: var(--y-radius-100);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
header .user-nav .cart-count[data-cart-count="0"] {
  display: none;
}
header .user-nav i {
  text-decoration: none;
  font-size: 20px;
  line-height: var(--y-space-24);
  padding: 16px 8px;
  font-weight: 600;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
}

.mobile-menu-btn {
  width: var(--y-space-32);
  height: 25px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
  display: none;
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: var(--y-space-4);
  background-color: var(--y-color-primary);
  border-radius: var(--y-space-6);
  transition: all 0.3s ease;
}
.mobile-menu-btn span:nth-child(2) {
  width: 60%;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(var(--y-space-6), var(--y-space-6));
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(9px, -9px);
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background-color: var(--y-color-primary);
  color: var(--y-color-bg);
  padding: 20px 30px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-menu-overlay.active .mobile-menu {
  transform: translateX(0);
}

.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu ul li a {
  text-decoration: none;
  color: var(--y-color-bg);
  font-size: 17px;
  font-weight: 600;
  padding: 12px 0;
  display: block;
  transition: color 0.3s ease;
}

.mobile-menu ul li a:hover,
.mobile-menu ul li a.active {
  color: var(--y-color-muted);
}

@media (max-width: 1024px) {
  header .logo ul.desktop-menu,
  header .logo form.desktop-menu {
    gap: 15px;
    width: auto;
    border-radius: var(--y-space-44);
  }

  header .logo ul li a {
    font-size: 18px;
    padding: 12px 6px;
  }

  header .user-nav a {
    font-size: 18px;
    padding: 12px 6px;
  }
  .mobile-user-links a{
    padding: 0 !important;
  }
}

@media (max-width: 768px) {
  header .container {
    padding: 8px 15px;
    flex-direction: row-reverse;
  }
  header .top-header > ul {
    display: none;
  }
  header .top-header {
    display: none;
  }

  header .logo {
    gap: 20px;
    flex-direction: row-reverse;
  }

  header .logo img {
    width: 29px;
    height: 29px;
  }

  header .user-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex !important;
  }
}

header .y-header-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--y-space-8);
}
header .y-header-search__wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: var(--y-space-10);
  padding-block: var(--y-space-8);
  gap: var(--y-space-8);
  border: 2px solid transparent;
  border-radius: var(--y-space-38);
  background: var(--y-color-primary);
  transition: box-shadow var(--y-transition), border-color var(--y-transition);
  cursor: pointer;
}

header .y-header-search__wrap.y-header-search--active {
  display: flex;
  align-items: center;
  gap: var(--y-space-8);
  border: 2px solid transparent;
  border-radius: var(--y-space-38);
  background: var(--y-color-primary);
  padding: var(--y-space-4) var(--y-space-8);
  color: var(--y-color-bg);
  transition: box-shadow var(--y-transition), border-color var(--y-transition);
}
header .y-header-search__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  opacity: 0.8;
}
header .y-header-search__input {
  width: 0;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--y-color-bg);
  font-size: var(--y-text-sm);
  transition: width var(--y-transition);
}
header .y-header-search--active .y-header-search__input {
  width: 220px;
}

@media (max-width: 1024px) {
  header .y-header-search--active .y-header-search__input {
    width: 160px;
  }
}
@media (max-width: 470px) {
  header .logo ul.desktop-menu,
  header .logo form.desktop-menu {
    width: 188px;
  }
}

.mobile-menu .y-header-search {
  width: fit-content;
}
.mobile-menu .y-header-search__wrap {
  border-radius: var(--y-space-14);
  background: var(--y-color-bg);
  display: flex;
}
.mobile-menu .y-header-search__icon {
  width: 20px;
  height: 20px;
}
.mobile-menu .y-header-search__input {
  width: 0;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--y-color-text);
  font-size: var(--y-text-sm);
  transition: width var(--y-transition);
}
.mobile-menu .y-header-search--active .y-header-search__input {
  width: 100%;
}

.mobile-menu .y-header-search--active {
  border: 2px solid var(--y-color-primary);
  border-radius: var(--y-space-14);
  padding: var(--y-space-6) var(--y-space-12);
}
.mobile-user-links {
  flex-wrap: wrap;
  background-color: var(--y-color-bg);
  padding: var(--y-space-4) var(--y-space-0);
  justify-content: center;
  gap: var(--y-space-24);
  border-radius: var(--y-space-42);
}

.mobile-user-links a:nth-child(1) img {
  border-left: 3px solid var(--y-color-primary);
  padding-left: var(--y-space-20);
}
