/* Accordion Hook */
*, *:after, *:before {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* اطمینان از نمایش آکاردئون در همه حالت‌ها */
.accordion {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

.section {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    float: none !important;
    clear: none !important;
}

/* بهبود سازگاری با شبکه وردپرس */
.elementor-widget-hook_custom_accordion {
    position: relative !important;
    z-index: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* اطمینان از اینکه آکاردیون در همه زبان‌ها درست کار می‌کند */
.accordion[lang="fa"],
.accordion[lang="de"],
.accordion[lang="en"] {
    direction: inherit !important;
    text-align: inherit !important;
}

/* اطمینان از اینکه آکاردئون تمام عرض را می‌گیرد */
.elementor-widget-hook_custom_accordion {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.elementor-widget-hook_custom_accordion .elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.accordion * {
  transition: all .3s ease 0s; 
}

.accordion {
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  width: 100% !important;
  height: 600px;
  min-height: 400px;
  list-style: none;
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  overflow: hidden;
  transition: 0.1s ease background;
  margin: 0 !important;
  padding: 0 !important;
  left: 0 !important;
  box-sizing: border-box !important;
}

.section {
  flex: 1 1 0 !important;
  width: 25% !important;
  height: 100% !important;
  text-align: center;
  color: #e5af58;
  text-decoration: none;
  vertical-align: bottom;
  box-sizing: border-box;
  padding: 0 !important;
  margin: 0 !important;
  position: relative !important;
  cursor: pointer;
  border-right: 2px solid #e5af58;
  transition: 1.2s ease all;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  min-width: 0 !important;
  display: block !important;
  float: none !important;
}

.accordion .section:last-of-type {
  border-right: none; 
}

.section .heading {
  transition: 0.5s ease all; 
}

.section:hover .heading {
  margin-top: -30px; 
}

.accordion.enabled .section:not(.open) {
  flex: 0 0 4% !important;
  width: 4% !important; 
  min-width: 60px !important;
  display: block !important;
  float: none !important;
}

.section.open {
  flex: 1 1 0 !important;
  width: 88% !important;
  display: block !important;
  float: none !important;
  /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0.4+0,0+100 */
  background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
  /* FF3.6-15 */
  background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
  /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(to right, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
  /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#66000000', endColorstr='#00000000',GradientType=1 );
  /* IE6-9 */
  cursor: default;
}

/* تغییر width فقط در موبایل */
@media (max-width: 747px) {
  .section.open {
    flex: 1 !important;
    width: 70% !important; /* افزایش عرض برای نمایش بهتر محتوا */
  }
  
  /* بهبود عملکرد لمس در موبایل */
  .section {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    position: relative;
    z-index: 10;
  }
  
  /* بهبود عملکرد کلیک در موبایل */
  .accordion.enabled .section:not(.open) {
    flex: 0 0 30% !important;
    width: 30% !important; /* افزایش عرض سلول‌های بسته */
    min-width: 80px !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* اطمینان از اینکه سلول باز روی همه چیز قرار دارد */
  .accordion.enabled .section.open {
    z-index: 20;
    position: relative;
  }
}

.inside-content {
  opacity: 0;
  transition: opacity .3s ease 0; 
}

.section.open > .inside-content {
  opacity: 1;
  transition: opacity .3s ease .3s; 
}

/* navigation */
.heading {
  top: 30px;
  position: absolute;
  width: 70%;
  max-width: 100%;
  margin: 0;
  font-size: 2.0rem;
  text-transform: uppercase;
  font-weight: 400;
  text-align: left;
  letter-spacing: 1px;
  color: #e5af58;
  line-height: 1.3; 
}

.heading .above {
  font-size: 13px;
  font-weight: 400;
  display: block;
  margin-bottom: 5px;
  color: #fff;
}

.heading .below {
  display: block;
  width: 36px;
  height: 36px;
  border: 1px solid #e5af58;
  margin-top: 15px;
  text-align: center;
  line-height: 33px;
  border-radius: 100%;
  font-size: 30px; 
}

.accordion.enabled .section:not(.open) {
  background: rgba(0, 0, 0, 0.1);
  flex: 0 0 4% !important;
  width: 4% !important;
  min-width: 60px !important;
  position: relative !important;
  z-index: 5;
  display: block !important;
  float: none !important;
}

.accordion.enabled .section:not(.open) h2.heading {
  top: 25px;
  left: 13%;
  text-align: left;
  font-size: 1.5rem;
  width: 400px;
  height: 400px;
  transform-origin: 0px 0px 0px;
  transform: matrix(0, 1, -1, 0, 27, 0);
  white-space: nowrap;
  line-height: 1;
}

.accordion.enabled .section:not(.open) h2.heading .above,
.accordion.enabled .section:not(.open) h2.heading .below {
  display: none; 
}

.accordion.enabled .section.open h2.heading .below {
  display: none; 
}

.accordion.enabled .section.open h2.heading {
  padding-left: 1rem;
  max-width: 40rem;
}

.accordion.enabled .section:hover {
  background: rgba(0, 0, 0, 0.4); 
}

.accordion.enabled .section:hover .heading {
  margin-top: -5px; 
}

.accordion.enabled .section.open:hover {
  /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0.4+0,0+100 */
  background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
  /* FF3.6-15 */
  background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
  /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(to right, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
  /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#66000000', endColorstr='#00000000',GradientType=1 );
  /* IE6-9 */ 
}

.accordion:not(.enabled) .section:hover {
  background: rgba(0, 0, 0, 0.2); 
}

.accordion:not(.enabled) .section:hover .heading .below {
  -ms-transform: rotate(90deg);
  /* IE 9 */
  -webkit-transform: rotate(90deg);
  /* Chrome, Safari, Opera */
  transform: rotate(90deg); 
}

@media screen and (min-width: 768px) {
  .accordion.enabled .section.open h2.heading {
    font-size: 45px;
    top: 2rem; 
  } 
}

.inside-content {
  text-align: left;
  width: 100%;
  padding-left: 2rem;
  max-width: 80%;
  position: absolute;
  top: 17rem;
  line-height: 1.4;
  font-size: 1rem;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 2rem;
  border-radius: 8px;
  backdrop-filter: blur(5px);
}

/* استایل مخصوص موبایل */
@media (max-width: 600px) {
  .inside-content {
    padding-left: 1rem;
    max-width: 97%;
    font-size: 0.7rem;
    top: 15rem !important;
    /* اگر لازم است موقعیت را هم تغییر دهید */
  }
}

.inside-content p,
.inside-content h2,
.inside-content h3 {
  margin: 0 0 1em 0; 
}

.close {
  display: none;
  z-index: 300;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #e5af58;
  background-color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #e5af58;
  font-weight: bold;
  transition: all 0.3s ease;
}

.close:hover {
  background-color: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.close .cross {
  display: none;
}

.close .a,
.close .b {
  display: none;
}

.section.open .close {
  display: block; 
}

@media (max-width: 900px) {
  .section {
    padding: 0 !important; 
    margin: 0 !important;
    position: relative;
    overflow: hidden;
  }
  .heading {
    transform: rotate(90deg);
    min-width: 100vh;
    text-align: left;
    transform-origin: 0 0 0;
    opacity: 1;
    top: 10vh;
    font-size: 22px;
    width: auto;
    left: 61%; 
    pointer-events: none; /* جلوگیری از تداخل کلیک */
  }
  .heading .above,
  .heading .below {
    display: none; 
  }
  .accordion.enabled .section.open h2.heading {
    transform: none;
    width: 95%;
    min-width: 200px;
    max-width: 95%;
    left: 0;
    top: 20%; 
    pointer-events: auto;
  }
  .inside-content {
    max-height: calc(72%);
    overflow-y: auto;
    left: 0;
    top: 30%; 
    padding: 1.5rem;
    font-size: 0.9rem;
    pointer-events: auto;
  }
  
  /* بهبود آیکون close در موبایل */
  .close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .accordion.enabled .section:not(.open) {
    flex: 0 0 25% !important;
    width: 25% !important; /* افزایش عرض سلول‌های بسته */
    padding: 0 !important; 
    margin: 0 !important;
    min-width: 60px !important; /* حداقل عرض برای قابل کلیک بودن */
  }
  
  /* بهبود عملکرد لمس در موبایل */
  .section {
    position: relative;
    z-index: 10;
    cursor: pointer;
  }
  
  .accordion.enabled .section:not(.open) {
    z-index: 5;
  }
  
  .accordion.enabled .section.open {
    flex: 1 !important;
    width: 75% !important;
    z-index: 15;
  }
}

/* Alignment & Direction for Accordion */
.accordion.align-left { text-align: left !important; direction: ltr !important; }
.accordion.align-center { text-align: center !important; }
.accordion.align-right { text-align: right !important; direction: rtl !important; }
.accordion.direction-ltr { direction: ltr !important; }
.accordion.direction-rtl { direction: rtl !important; }

/* ریست موقعیت برای جلوگیری از خارج شدن از کادر */
.accordion {
  left: 0 !important;
  right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  position: relative !important;
  transform: none !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
}
.elementor-widget-hook_custom_accordion,
.elementor-widget-hook_custom_accordion .elementor-widget-container {
  left: 0 !important;
  margin-left: 0 !important;
  right: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* نمایش همه ستون‌های آکاردئون در حالت اولیه */
.accordion:not(.enabled) .section {
  flex: 1 1 0 !important;
  width: 25% !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  min-width: 0 !important;
  float: none !important;
  position: relative !important;
} 