* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: peyda;
  src: url("font/Peyda-Medium.ttf") format("truetype");
}

body {
  font-family: "peyda";
  background: radial-gradient(
    circle at top right,
    rgba(175, 6, 164, 0.02),
    transparent 32%
  ),
  linear-gradient(180deg, #fcfafc 0%, #f9f6f9 100%);
}

header {
  background: transparent;
  padding: 20px 20px 0 20px;
  direction: rtl;
  position: relative;
  z-index: 1001;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  background: #a3238e;
  border-radius: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 30px;
  position: relative;
  z-index: 1001;
}

.logo {
  background: #a3238e;
  padding: 8px 15px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  width: 50px;
  height: auto;
  display: block;
}

.main-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.main-nav ul {
  display: flex;
  gap: 35px;
  list-style: none;
}

.main-nav ul li {
  position: static;
}

.main-nav ul li a {
  text-decoration: none;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  transition: 0.3s;
  padding-bottom: 5px;
  position: relative;
  border-radius: 16px;
}

.main-nav ul li a:hover {
  color: #ffddff;
}

.main-nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: white;
  transition: 0.3s;
}

.main-nav ul li a:hover::after {
  width: 100%;
}



/* ======================================== */
/* مگامنو - نمایش محصولات هر دسته */
/* ======================================== */
.mega-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%) translateY(15px);
  width: 750px;
  max-width: 90vw;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  z-index: 1002;
  padding: 25px;
  border: 1px solid rgba(175, 6, 164, 0.1);
}

/* مثلث بالای مگامنو */
.mega-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 51%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid white;
}

.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* کارت محصولات در مگامنو */
.mega-product-card {
  text-align: center;
  background: #f8f9fa;
  padding: 15px 10px;
  border-radius: 16px;
  transition: all 0.2s ease;
  border: 1px solid #f0f0f0;
}

.mega-product-card:hover {
  background: #f3e5f2;
  transform: translateY(-3px);
  border-color: #e0d4e0;
}

.mega-product-card a {
  text-decoration: none;
}

.mega-product-card img {
  width: 100%;
  max-width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}

.mega-product-card h4 {
  font-size: 13px;
  margin: 8px 0;
  font-weight: 600;
  color: #1a1a2e;
}

.mega-price {
  font-size: 13px;
  font-weight: bold;
  margin-top: 5px;
}

.mega-old-price {
  text-decoration: line-through;
  color: #888;
  font-size: 11px;
  margin-left: 5px;
}

.mega-new-price {
  color: #a3238e;
}

.mega-price span:not(.mega-old-price):not(.mega-new-price) {
  color: #1a1a2e;
}

.mega-view-all-bottom {
  text-align: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.mega-view-all-bottom a {
  color: #a3238e;
  text-decoration: none;
  font-size: 13px;
  font-weight: bold;
  display: inline-block;
  padding: 6px 16px;
  border-radius: 25px;
  transition: 0.2s;
}

.mega-view-all-bottom a:hover {
  background: #f3e5f2;
}

.mega-product-card a::after{
  display: none;
}

/* ریسپانسیو */
@media (max-width: 800px) {
  .mega-menu-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  .mega-menu {
    width: 550px;
  }
}

@media (max-width: 600px) {
  .mega-menu-container {
    grid-template-columns: 1fr;
  }
  .mega-menu {
    width: 280px;
  }
}



.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-right: auto;
}

.dropdown {
  position: relative;
}

.dropdown-btn {
  background: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 40px;
  font-family: "peyda";
  font-size: 16px;
  color: #a3238e;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.3s;
  font-weight: bold;
}

.arrow {
  font-size: 10px;
  transition: 0.3s;
}

.dropdown:hover .arrow {
  transform: rotate(180deg);
}

.dropdown-content {
  position: absolute;
  top: 45px;
  left: 0;
  background: white;
  min-width: 160px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 100;
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
}

.dropdown-content a {
  display: block;
  padding: 10px 18px;
  text-decoration: none;
  color: #1a1a2e;
  font-size: 14px;
  border-bottom: 1px solid #eee;
  transition: 0.2s;
  border-radius: 16px;
}

.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background: #f9f9f9;
  color: #a3238e;
}

.auth-btn a {
  background: white;
  padding: 8px 22px;
  border-radius: 40px;
  text-decoration: none;
  color: #a3238e;
  font-weight: bold;
  font-size: 16px;
  transition: 0.3s;
}

.login-link {
  background: white;
  padding: 8px 22px;
  border-radius: 40px;
  text-decoration: none;
  color: #a3238e;
  font-weight: bold;
  font-size: 16px;
  transition: 0.3s;
}

.icon-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-user,
.icon-cart {
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  color: #a3238e;
  position: relative;
  transition: 0.3s;
}

.icon-user:hover,
.icon-cart:hover {
  background: #ffddff;
  transform: scale(1.05);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #fff;
  color: #a3238e;
  font-size: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* ======================================== */
/* موبایل */
/* ======================================== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #a3238e;
  margin: 10px 10px;
  padding: 12px 20px;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  direction: rtl;
  border-radius: 55px;
}

.menu-toggle {
  font-size: 28px;
  color: white;
  cursor: pointer;
}

.mobile-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-logo img {
  width: 40px;
  height: auto;
}

.mobile-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mobile-cart,
.mobile-auth {
  background: white;
  padding: 6px 10px;
  border-radius: 30px;
  text-decoration: none;
  color: #a3238e;
  font-size: 13px;
  font-weight: bold;

}

.mobile-cart i{
  margin: auto 0 !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4px 0px;
}

.mobile-cart {
  position: relative;
}

/* سایدبار موبایل */
.sidebar {
  position: fixed;
  top: 0;
  right: -280px;
  width: 260px;
  height: 100%;
  background: white;
  z-index: 2000;
  transition: 0.3s;
  padding-top: 60px;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
  direction: rtl;
  transition: 0.5s ease;
}

.sidebar.active {
  right: 0;
}

.close-sidebar {
  position: absolute;
  top: 15px;
  left: 18px;
  font-size: 28px;
  cursor: pointer;
  color: #a3238e;
}

.sidebar a {
  display: block;
  padding: 14px 22px;
  text-decoration: none;
  color: #1a1a2e;
  border-bottom: 1px solid #eee;
  transition: 0.2s;
}

.sidebar a:hover {
  background: #f3f3f3;
  color: #a3238e;
}

.sidebar-user {
  background: #f9f9f9;
  font-weight: bold;
  color: #a3238e !important;
}

.sidebar-category {
  border-bottom: 1px solid #eee;
}

.sidebar-category > span {
  display: block;
  padding: 14px 22px;
  cursor: pointer;
  font-weight: bold;
  color: #1a1a2e;
}

.arrow-sub {
  font-size: 10px;
  transition: 0.3s;
}

.submenu {
  display: none;
  background: #f9f9f9;
}

.submenu a {
  padding-right: 40px !important;
  font-size: 13px;
  color: #1a1a2e;
}

.submenu.active {
  display: block;
}

/* ======================================== */
/* ریسپانسیو */
/* ======================================== */
@media (max-width: 1050px) {
  .mega-menu {
    width: 95vw;
  }
}

@media (max-width: 900px) {
  header {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  body {
    padding-top: 70px;
  }

  .mega-menu {
    display: none;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .header-container {
    padding: 8px 20px;
  }

  .main-nav ul {
    gap: 25px;
  }

  .main-nav ul li a {
    font-size: 14px;
  }

  .dropdown-btn {
    padding: 6px 14px;
    font-size: 13px;
  }

  .auth-btn a {
    padding: 6px 18px;
    font-size: 13px;
  }

  .icon-user,
  .icon-cart {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}
