/* ============================================
   Header Styles (جایگزین تیلویند)
============================================ */

/* ─── Navbar اصلی ─── */
#header {
  
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
/* ─── کانتینر داخلی ─── */
#headerInner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  max-width: 96vw;
  margin-left: auto;
  margin-right: auto;
  height: 4rem;gap:2rem
  /* 16 * 0.25 = 4rem */
}

@media (min-width: 768px) {
  #headerInner {
    height: 5rem;
    /* 20 * 0.25 = 5rem */
  }
}

/* ─── بخش ۱: اقدامات ─── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .header-actions {
    gap: 1rem;
  }
}

/* ─── سبد خرید ─── */
.basket-btn {
  position: relative;
  padding: 5px;
  border-radius: 50%;
  transition: .3s ease-in-out;
}
.basket-btn:hover {background-color: rgba(231, 223, 100, 0.3);}

.basket-btn img {
  width: 2rem;
  height: 2rem;
  transition: 0.3s ease;
}

.basket-btn:hover img {
  transform: scale(1.01);
    
}

.basket-btn .badge {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  height: 1.25rem;
  width: 1.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: #ffffff;
  font-size: 0.625rem;
  font-weight: 700;
  color: #ef4444;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}
        .text-aqua {
          color: aqua;
        }
/* ─── دکمه BMI ─── */
.hide-on-search {
  display: inline-flex;
}

.bmi-btn {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background-color: rgba(108, 99, 255, 0.1);
  color: #6C63FF;
  font-size: 0.875rem;
  font-weight: 700;
  transition: color 0.15s, background-color 0.15s;
  border: none;
  cursor: pointer;
}

.bmi-btn:hover {
  background-color: #6C63FF;
  color: #d82b2b;
}

@media (min-width: 768px) {
  .bmi-btn {
    display: flex;
  }
}

/* ─── پروفایل ─── */
#profileWrapper {
  position: relative;
  right:3vw;
}

#profileToggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
  border-radius: 9999px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s;
}

#profileToggle:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

#profileToggle:hover {
  background-color: rgba(18, 9, 25, 0.1);
}

#profileToggle img {
  width: 2.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
  pointer-events: none;
}

/* ─── منوی پروفایل ─── */
#profileMenu {
  position: absolute;
  right: 0;
  margin-top: 1.5rem;
  width: 14rem;
  transform-origin: top right;
  border-radius: 0.75rem;
  background-color: rgba(29, 25, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 70;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.2rem);
  transition: all 0.2s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

}

@media (prefers-color-scheme: dark) {
  #profileMenu {
    background-color: rgba(17, 24, 39, 0.95);
  }
}
#profileWrapper>div {
  transition: none;
  /* GSAP کنترل می‌کند */
  transform-origin: top right;
}


#profileMenu .menu-items {
  padding: 0.5rem 0;
}

#profileMenu .menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}

#profileMenu .menu-item:hover {
  background-color: rgba(18, 99, 25, 0.4);
  color: #6C63FF;
}

#profileMenu .menu-item img {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  object-fit: contain;
}

#profileMenu .menu-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0.25rem 0;
}

#profileMenu .menu-item-danger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #ef4444;
  text-decoration: none;
  transition: background-color 0.15s;
}

#profileMenu .menu-item-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

/* ─── دکمه ورود/ثبت‌نام ─── */
.auth-btn {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background-color: #6C63FF;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s;
  box-shadow: 0 10px 15px -3px rgba(108, 99, 255, 0.2);
}

.auth-btn:hover {
  background-color: rgba(108, 99, 255, 0.9);
}

.auth-btn img {
  width: 1rem;
}

.auth-btn .text-dark {
  color: #1f2937;
}

@media (min-width: 768px) {
  .auth-btn {
    display: flex;
  }
}

/* ─── منوی موبایل ─── */
#mobileMenuBtn {
  display: block;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

#mobileMenuBtn img {
  width: 1.5rem;
  height: 1.5rem;
}

@media (min-width: 768px) {
  #mobileMenuBtn {
    display: none;
  }
}

/* ─── بخش ۲: جستجو ─── */
.header-search {
  display: none;
  align-items: center;
  flex: 1 1 0%;
  max-width: 24rem;
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

@media (min-width: 768px) {
  .header-search {
    display: flex;
  }
}

.header-search form {
  position: relative;
  width: 100%;
}

.header-search input {
  width: 100%;
  padding: 0.625rem 2.5rem 0.625rem 3rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: all 0.3s ease;
  outline: none;
}

.header-search input::placeholder {
  color: #9ca3af;
}

.header-search input:focus {
  border-color: rgba(108, 99, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.15);
}

.header-search .search-submit {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}

.header-search .search-submit:hover {
  color: #6C63FF;
}

.header-search .search-submit svg {
  width: 1.125rem;
  height: 1.125rem;
}

.header-search .voice-btn {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s;
}

.header-search .voice-btn:hover {
  background-color: rgba(108, 99, 255, 0.2);
}

.header-search .voice-btn svg {
  width: 1rem;
  height: 1rem;
  color: #6C63FF;
}

/* ─── بخش ۳: لینک‌های ناوبری ─── */
#headerNav {
  display: none;
  align-items: center;
  font-family: inherit;
  font-size: 1.125rem;
  line-height: 1.75rem;
}



.nav-link-hover {
  position: relative;
  color: #ffffff;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  transition: color 0.15s;
}

.nav-link-hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(80deg,#ce4949 , #dbee71);
  transition: all 0.3s ease;
}

.nav-link-hover:hover::after,
.nav-link-hover.active::after {
  width: 100%;
}

.nav-link-hover.active {
  color: #6C63FF;
}
@media (min-width: 1024px) {
  #headerNav {
    display: flex;
  }

}
/* ─── بخش ۴: لوگو ─── */
.header-logo {
  flex-shrink: 0;
}

.header-logo img {
  height: 2rem;
  width: auto;margin-right:4rem;
  object-fit: contain;
  transition: transform 0.35s;
}

.header-logo img:hover {
  transform: scale(1.02);
}

@media (min-width: 768px) {
  .header-logo img {
    height: 3rem;
  }
}

/* ─── کلاس‌های کمکی ─── */
.pointer {
  cursor: pointer;
}

.icons {
  width: 1.5rem;
  height: 1.5rem;
}

/* ─── استایل‌های dark mode ─── */
@media (prefers-color-scheme: dark) {
  #profileMenu {
    background-color: rgba(17, 4, 39, 0.8);
  }
}

/* ─── استایل‌های RTL ─── */
[dir="rtl"] #profileMenu {
  right: auto;
  left: 0;
}

[dir="rtl"] .header-search input {
  padding: 0.625rem 3rem 0.625rem 2.5rem;
}

[dir="rtl"] .header-search .search-submit {
  right: auto;
  left: 0.75rem;
}

[dir="rtl"] .header-search .voice-btn {
  left: auto;
  right: 0.5rem;
}

/* بهبود انیمیشن آیتم‌ها */
#profileMenu .menu-item,
#profileMenu .menu-item-danger {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* بهینه‌سازی برای موبایل */
@media (max-width: 640px) {
  #profileMenu {
    width: 12rem;
    right: -6rem;
    min-width: 200px;
  }

  [dir="rtl"] #profileMenu {
    right: auto;
    left: -6rem;
  }
}

/* انیمیشن ورودی آیتم‌ها */
#profileMenu .menu-item {
  transition: none;
  /* GSAP کنترل می‌کند */
}

/* بهبود readability در dark mode */
@media (prefers-color-scheme: dark) {
  #profileMenu .menu-item {
    color: #fafffc;
  }

  #profileMenu .menu-item:hover {
    color: #6C63FF;
  }

  #profileMenu .menu-item-danger {
    color: #f87171;
  }
}
@media (max-width: 1024px) {
  .nav-link{font-size:.75rem}
}