.ultra-fancy-toggle-grid-wrapper {
  position: relative;
  text-align: center;
}

.ultra-fancy-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 30px;
  justify-content: center;
  overflow: hidden;
  max-height: 360px; /* حدود دو ردیف */
  transition: max-height 0.5s ease;
}

.ultra-fancy-toggle-grid.expanded {
  max-height: 2000px; /* باز شدن کامل */
}

.ultra-fancy-toggle-grid .grid-item {
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
    padding: 20px 5px;
    text-align: center;
    flex: 1 0 120px;
    max-width: 140px;
    align-items: center;
    transition: transform 0.3s ease;
    display: flex
;
    justify-content: center;
    flex-direction: column;
}

.grid-item:hover {
  transform: translateY(-5px);
}

.grid-icon {
  font-size: 32px;
  margin-bottom: 10px;
  color: #f48b6b;
}

.grid-title {
  font-weight: bold;
  font-size: 14px;
  color: #333;
   font-family: "یکان بخ", Sans-serif;
}
.ultra-fancy-toggle-grid.expanded{
    overflow: unset;
    padding-bottom:30px;
    
}

.ultra-fancy-toggle-grid.expanded .toggle-button {

    margin-top: 30px;
 
}
.toggle-overlay {
  content: "";
  position: absolute;
  bottom: 45px;
  left: 0;
  width: 100%;
  height: 120px;
  background: linear-gradient(to top, #fff, transparent);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ultra-fancy-toggle-grid.expanded + .toggle-overlay {
  opacity: 0;
}


.toggle-button {
     font-family: "یکان بخ", Sans-serif;
  display: inline-block;
  margin-top: 10px;
  padding: 10px 22px;
  border-radius: 25px;
  background-color: #f48b6b!important;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.toggle-button:hover {
  background-color: #e66d4d;
}


.toggle-overlay,
.toggle-button { display: none; }            /* در ابتدا مخفی‌اند */

.ultra-fancy-toggle-grid.has-more .toggle-overlay,
.ultra-fancy-toggle-grid.has-more + .toggle-overlay,
.ultra-fancy-toggle-grid.has-more ~ .toggle-button {
  display: block;                            /* فقط وقتی داده اضافه داریم */
}