header {
  width: -webkit-fill-available;
  padding: 0px 20px;
  background-color: var(--y-color-bg);
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header{
  padding: var(--y-space-22) 0;
  display: grid;
    grid-template-columns: 1fr;
}

header.y-u-fixed {
  padding-top: 0px;
  padding-bottom: 0px;
}

header .logo {
  gap: 32px;
  column-gap: 79px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding-block: var(--y-space-10);
}

header > div:first-child {
  background-color: var(--y-color-bg);
}


header .logo-seconed {
  gap: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--y-space-16);
}

header .logo img {
  width: 173px;
  cursor: pointer;
  object-fit: contain;
}
.logo a {
  font-size: 24px;
  font-weight: bolder;
}

header ul.desktop-menu {
  list-style: none;
  gap: var(--y-space-24);
  padding: var(--y-space-8) 0;
}
header ul li a {
  text-decoration: none;
  color: var(--y-color-bg);
  font-size: 20px;
  line-height: 28px;
  padding: 8px;
  font-weight: 600;
  transition: color 0.3s ease;
  border-radius: var(--y-space-8);
}
header ul li a:hover {
  color: rgba(247, 246, 255, 1) !important;
  background-color: rgba(85, 193, 223, 1) !important;
}

header ul li a.special-link {
  color: rgba(247, 246, 255, 1) !important;
  background-color: rgba(85, 193, 223, 1) !important;
}

header ul li a.active {
  color: rgba(247, 246, 255, 1) !important;
}

/* Exclude mobile menu from desktop active link styling */
.mobile-menu-list li a.active {
  color: var(--y-color-primary) !important;
}
header .user-nav {
  gap: var(--y-space-12);
}
header .user-nav a {
  text-decoration: none;
  color: var(--y-color-muted);
  font-size: 20px;
  line-height: var(--y-space-24);
  font-weight: 600;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
}
header .user-nav img {
  width: 23px;
}
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.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 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.8) !important;
  z-index: 9999 !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow: hidden;
  pointer-events: none;
}

.mobile-menu-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.mobile-menu {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 280px !important;
  height: 100vh !important;
  background-color: #f5f5f0 !important;
  padding: var(--y-space-24) var(--y-space-24) var(--y-space-32) !important;
  transform: translateX(100%) !important;
  transition: transform 0.3s ease !important;
  display: flex !important;
  flex-direction: column !important;
  gap: var(--y-space-24) !important;
  z-index: 10000 !important;
  overflow-y: auto;
}

.mobile-menu-close {
  align-self: flex-end;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--y-space-8);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: var(--y-space-8);
}

.mobile-menu-close svg {
  width: 24px;
  height: 24px;
}

.mobile-menu-search {
  width: 100%;
  margin-bottom: var(--y-space-8);
}

.mobile-menu-overlay.active .mobile-menu {
  transform: translateX(0) !important;
}

.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--y-space-16);
}

.mobile-menu-list li {
  position: relative;
}

.mobile-menu-list li a {
  text-decoration: none;
  color: #000;
  font-size: 18px;
  font-weight: 600;
  padding: var(--y-space-12) 0;
  display: block;
  transition: color 0.3s ease;
}

.mobile-menu-list li a:hover,
.mobile-menu-list li a.active {
  color: var(--y-color-primary) !important;
}

.mobile-menu-item-with-bullet {
  position: relative;
  padding-right: var(--y-space-20);
}

.mobile-menu-item-with-bullet::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background-color: var(--y-color-primary);
  border-radius: 50%;
}

@media (max-width: 1024px) {
  header .logo ul.desktop-menu {
    gap: 15px;
  }

  header .logo ul li a {
    font-size: 18px;
    padding: 12px 6px;
  }

  header .user-nav a {
    font-size: 18px;
    padding: 12px 6px;
  }
}

@media (max-width: 768px) {
  header .container {
    flex-direction: row-reverse;
    padding-block: var(--y-space-28);
  }

  header .logo {
    gap: 20px;
  }

  header .logo img {
    width: 100px;
  }

  header .logo ul.desktop-menu {
    display: none;
  }

  header .user-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

}

@media (max-width: 480px) {
  header {
    padding: 8px 15px;
  }

  .mobile-menu {
    padding: var(--y-space-20) var(--y-space-20) var(--y-space-24);
    width: 100%;
  }

}

header .y-header-search {
  position: relative;
}

header .y-header-search__wrap {
  display: flex;
  align-items: center;
  background: var(--y-color-bg-profile-content);
  border-radius: 32px;
  border-style: solid;
  border-width: 1px;
  border-color: rgba(119, 119, 119, 1);
  padding: var(--y-space-8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  width: auto;
  min-width: auto;
  padding-inline: var(--y-space-12);
}

header .y-header-search__icon-btn {
  background: transparent;
  border: none;
  border-radius: var(--y-space-8);
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

header .y-header-search__icon-btn:hover {
  opacity: 0.8;
}

header .y-header-search__icon-btn img {
  width: 20px;
  height: 20px;
}

header .y-header-search__input {
  width:100%;
  min-width: 200px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--y-color-text);
  font-size: var(--y-text-base);
  direction: rtl;
  text-align: right;
  padding: 0 var(--y-space-8);
  opacity: 1;
  transition: width 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

header .y-header-search__wrap.y-header-search--active {
  border-radius: var(--y-space-12);
  padding: var(--y-space-12) var(--y-space-16);
  min-width: 300px;
}

header
  
  .y-header-search__wrap.y-header-search--active
  .y-header-search__input {
  width: 220px;
  opacity: 1;
  padding: 0 var(--y-space-8);
}

header  .y-header-search__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  opacity: 0.6;
}

header  .y-header-search__input::placeholder {
  color: #666;
  opacity: 0.7;
}

@media (max-width: 1024px) {
  header  .y-header-search__wrap.y-header-search--active {
    min-width: 250px;
  }

  header
    
    .y-header-search__wrap.y-header-search--active
    .y-header-search__input {
    width: 160px;
  }
}

@media (max-width: 768px) {
  header  .y-header-search__wrap.y-header-search--active {
    min-width: 200px;
  }

  header
    
    .y-header-search__wrap.y-header-search--active
    .y-header-search__input {
    width: 120px;
  }
  header .y-header-search__wrap {
    width: 37vw;
  }
}

.mobile-menu .y-header-search {
  width: 100%;
  position: relative;
}

.mobile-menu .y-header-search__wrap {
  display: none;
}

.mobile-menu .y-header-search__icon-btn {
  background: transparent;
  border: none;
  border-radius: var(--y-space-8);
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.mobile-menu .y-header-search__icon-btn:hover {
  opacity: 0.8;
}

.mobile-menu .y-header-search__icon-btn img {
  width: 20px;
  height: 20px;
}

.mobile-menu .y-header-search__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  opacity: 0.6;
}

.mobile-menu .y-header-search__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--y-color-text);
  font-size: var(--y-text-base);
  direction: rtl;
  text-align: right;
  padding: 0 var(--y-space-8);
  opacity: 1;
  width: 100%;
}

.mobile-menu .y-header-search__input::placeholder {
  color: #666;
  opacity: 0.7;
}
.mobile-user-links {
  flex-wrap: wrap;
}
.dropdown-wrapper {
  position: relative;
}

.dropdown-wrapper::before {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 5px;
  background: transparent;
  z-index: 999;
}

.dropdown-trigger {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
}

.dropdown-options {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background-color: #fff;
  min-width: 150px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px 0;
  list-style: none;
  z-index: 1000;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.dropdown-wrapper:hover .dropdown-options,
.dropdown-wrapper:focus-within .dropdown-options {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-options:hover {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

header ul.dropdown-options li {
  margin: 0;
  padding: 0;
}

header ul.dropdown-options li a {
  display: block;
  color: #333 !important;
  background-color: transparent !important;
  font-size: 16px;
  padding: 10px 15px;
  text-align: right;
  border-radius: 0;
  white-space: nowrap;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

header ul.dropdown-options li a:hover,
header ul.dropdown-options li a:focus {
  background-color: #f5f5f5 !important;
  color: var(--y-color-primary) !important;
  outline: none;
}

.dropdown-wrapper:hover .dropdown-trigger i,
.dropdown-wrapper:focus-within .dropdown-trigger i {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.dropdown-trigger:focus {
  outline: 2px solid var(--y-color-primary);
  outline-offset: 2px;
  border-radius: var(--y-space-8);
}

.desktop-header-view > div:last-child{
  background-color: var(--y-color-primary);
} 

.mobile-header-view {
  display: none;
}


.cart-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  background-color: #ff3b30;
  color: white;
  font-size: 10px;
  font-weight: bold;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.cart-wrap {
  position: relative;
  display: inline-block;
}

@media (max-width: 768px) {
  
  .desktop-header-view {
    display: none;
  }

  .mobile-header-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 15px;
    padding: 10px 5px;
  }

  .mobile-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .mobile-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
  }

  .mobile-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-direction: row-reverse;
  }

  .mobile-icon-link img,
  .mobile-icon-btn img {
    width: 24px;
    height: 24px;
    cursor: pointer;
  }

  .mobile-icon-btn {
    background: none;
    border: none;
    padding: 0;
  }

  .cart-wrap {
    position: relative;
    display: inline-block;
  }

  .mobile-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .mobile-login-btn {
    background-color: #5BC0DE;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
  }

  .mobile-login-btn:hover {
    background-color: #1c3e46;
  }
  .mobile-login-btn i {
    font-size: 18px;
  }

  .mobile-menu-btn {
    display: flex !important;
    width: 30px;
    height: 22px;
  }
  
  .mobile-menu-btn span {
    background-color: #000;
    height: 3px;
    border-radius: 2px;
  }
  
  header {
    background-color: #F7F8FC;
    padding: 10px 20px;
  }
}