:root {
  --text: #030b05;
  --background: #F4F5FA;
  --head-foot: #87CEFA;
  --primary: #55DD33;
  --secondary: #df94b7;
  --accent: #d2a365;

}

body {
  direction: rtl;
  font-family: 'Shabnam', sans-serif;

}

li {
  list-style: none;
}

a {
  text-decoration: none;
}

.hbottop {
  display: none;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgb(148, 148, 148, 0.7);
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.3s ease-in;
  z-index: 1012;
}

.overlay.show {
  opacity: 1;
  display: block;
  transform: translateY(0);

}

.hbot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding: 10px 20px;
  border-top: none;
  margin-top: 10px;
  border-bottom: 1px solid rgba(69, 69, 69, 0.508);
}

.daste {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  width: 15%;
  z-index: 1013;


}

.daste a {
  cursor: pointer;

}

.nav-item {
  color: #003c7b;
  padding: 10px;
  text-decoration: none;
  font-weight: 900;
  font-size: 3rem;
  margin: 0 10px;

}
.nav-item img{
  width: 40px;
  height: 40px;
}

.nav-item:hover {
  color: #0058b6;
}

.daste .category-link {
  font-weight: 700;
  color: #003a77;
  padding: 10px;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.6rem;
  white-space: nowrap;
}

.cat-menu {
  position: absolute;
  top: 48px;
  right: 0;
  background-color: #f6f6f6;
  z-index: 1013;
  width: 1400px;
  height: auto;
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: 
    opacity 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.5s ease-in;
  pointer-events: none;
}

.cat-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}



.category-item {
  position: relative;
  display: flex;
  width: 100%;
  margin: 10px 20px 10px 20px;
  align-self: center;
  border-radius: 20px;
}

.subcategory {
  display: none;
  position: fixed;
  right: 300px;
  background-color: var(--background);
  width: 70%;
  z-index: 1013;
  border-radius: 12px 0 0 12px;
  height: 100%;
  top: 0;
  flex-wrap: wrap;
  align-items: start;
}

.subcategory-item {
  flex: 0 0 calc(25% - 20px);
  box-sizing: border-box;
  padding: 18px 10px;
  margin: 30px 40px;
  text-align: center;
  text-decoration: underline 2px #00ff11;
  text-underline-offset: 8px;
  color: #000;
  white-space: nowrap;
  word-break: break-word;
  font-size: 1.2rem;
  height: auto;
  
  

}

.subcategory-item:hover {
  margin-top: 35px;
  color: #fc0000;
}

.cat-menu a {
  cursor: pointer;
  pointer-events: auto;


}

.cat-item {
  display: flex;
  padding: 5px;
  color: #000000;
  margin-right: 20px;
  justify-content: space-between;
  text-decoration: none;
  border-radius: 20px;
  width: 30%;
  align-items: center;

}

.cat-item:hover {
  background: linear-gradient(to right, rgb(255, 255, 255), rgba(255, 0, 251, 0.189));
  color: #fc0000;
  transition: background-color 0.3s ease-in-out;
  padding: 10px;
  border-radius: 12px;
  text-underline-offset: 10px;

  margin-top: 5px;

}

.cat-item:hover span:first-child {
  text-decoration: underline 2px #00ff11;
}

/* آیکون (دومین span) هیچ‌گاه زیرخط نداشته باشد */
.cat-item span:last-child {
  text-decoration: none !important;
  padding-left: 12%;
}

.subcategory::before {
  content: '';
  position: absolute;
  top: 5%;
  right: auto;
  width: 2px;
  height: 80%;
  background-color: #767676;

}

.cat-item span:first-child {
  flex-grow: 1;
  font-size: 1.2rem;

}

.cat-item span:last-child {
  margin-left: 130px;
  font-size: 2.5rem;
  text-decoration: none !important;
  position: relative;
  font-weight: lighter;

}



.hbotchap {
  display: flex;
  flex-grow: 1;
  justify-content: space-between;
  font-size: 1.1rem;
}

.hbotchap>li {
  position: relative;
  flex: 1;
  text-align: center;
}

.close-menu-btn {
  display: none;
  position: absolute;
  top: 5px;
  left: 5px;
  background: none;
  border: none;
  font-size: 2rem;
  font-weight: lighter;
  color: #888888;
  cursor: pointer;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  z-index: 1040;
}
.subcategory {
  display: none;
}
.subcategory.show {
  display: block; /* یا flex */
}
@media (max-width: 1023px) {
    .subcategory {
    display: none;
  }
  .subcategory.show {
    display: flex; /* یا flex، بسته به طراحی شما */
  }


  .hbot{
max-width: 99vw;
  }
  .hbottop{
    display: block;
  }
  .cat-menu {
    position: fixed !important;
    top: -100vh;
    left: 50%;
    transform: translateX(-50%);
    width: 99vw !important;
    z-index: 1013 !important;
    background: white;
    padding: 16px 2px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: 
      top 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
      opacity 0.3s,
      visibility 0.3s;
    pointer-events: none;
  }

  .cat-menu.show {
    top: 10vh !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* جلوگیری از مخفی شدن منو توسط overflow: hidden */
  .htop.scrolled {
    overflow: visible !important;
    max-width: 99vw;
  }


   .htop.scrolled .cat-menu{
top: 7vh !important;
   }


  .cat-item span:first-child {
    white-space: nowrap;
    font-size: 0.6rem;

  }

  .cat-item {
    justify-content: flex-end !important;
    font-size: 1rem !important;
    width: 100% !important;
    gap: 2px;
/*   background: linear-gradient(to left, #868686 50%, transparent 90%) bottom / 200% 2px no-repeat;*/    
    padding-bottom: 10px !important;
    margin-right: 8px;
    padding: 0;

  }
.cat-item:hover {
  margin: 5px 5px 5px 0px;
    margin: 5px 5px 5px 0px;
}
  .cat-item span:last-child {
    margin-left: 0;
    margin-right: 0;
    padding-right: 8px;
    font-size: 1.2rem;

  }
.category-item{
    width: 20vw;
    margin: 0px 8px 0px 0px;
    justify-content: end;
}
  .subcategory {
    position: fixed;
    right: 27vw;
    width: 70vw;
    border-radius: 0 !important;
    padding: 0px !important;
    box-sizing: border-box;
   max-height: 80vh;
    z-index: 1013;
      display: flex;
    flex-wrap: wrap;
  }


  .subcategory-item {
    position: relative;
    width: 100% !important;
    right: 5px !important;
    text-align: center !important;
    font-size: 0.8rem !important;
    text-decoration: underline 1.5px #00ff11 !important;
    text-underline-offset: 8px !important;
    flex-wrap: wrap;
    top: 20px;
    margin: 10px !important;
    flex: 0 0 calc(25% - 12px);
    word-break: break-word;
  }

  /* دکمه بستن */
  .close-menu-btn {
    display: block !important;
    position: absolute !important;

  }
}