/**
 * Mega Menu Styles
 * 4 alternatif mega menu tasarımı
 */

/* Mega Menu Overlay */
.mega-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9997;
  pointer-events: none;
}

.mega-menu-overlay.is-active {
  opacity: 0.5;
  visibility: visible;
  pointer-events: auto;
}

/* Mega Menu Container */
.mega-menu {
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border-radius: 0;
  width: 90%;
  display: none;
  z-index: -1;
  white-space: nowrap;
  box-sizing: border-box;
  padding-top: 120px;
  transition: padding-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mega-menu a {
  padding: 10px 20px;
}

.mega-menu.mega-menu--type-2,
.mega-menu.mega-menu--type-3 {
  width: 60% !important;
}

/* Sticky durumunda mega menu padding'i güncellenir */
.site-header.is-sticky ~ * .mega-menu,
.site-header.is-sticky .mega-menu {
  padding-top: 90px;
}

/* Type-4 için genel mega-menu stillerini override et */

.menu-item-has-mega-menu:hover > .mega-menu,
.menu-item-has-mega-menu.is-active > .mega-menu {
  display: grid !important;
}

.menu-item-has-mega-menu:hover > .mega-menu--type-4,
.menu-item-has-mega-menu.is-active > .mega-menu--type-4 {
  display: flex !important;
}

/* İki Kutu Düzeni (Tip 1, 2, 3) */
.mega-menu__left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  min-width: 400px;
  background: #f7f9fc;
  border-radius: 48px;
  box-sizing: border-box;
  min-height: 400px;
  align-self: stretch;
}

.mega-menu__right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  align-content: start;
  list-style: none;
  margin: 0;
  padding: 40px;
  width: 100%;
  background: #f7f9fc;
  border-radius: 48px;
  box-sizing: border-box;
  min-height: 400px;
  align-self: stretch;
}

.mega-menu__hidden-submenu {
  display: none !important;
}

.mega-menu--type-1,
.mega-menu--type-2,
.mega-menu--type-3 {
  display: grid !important;
  grid-template-columns: 400px 1fr;
  gap: 20px;
  align-items: start;
}

.mega-menu--type-2 .mega-menu__title,
.mega-menu--type-3 .mega-menu__title,
.mega-menu--type-4 .mega-menu__title {
  font-weight: 300 !important;
}

.mega-menu--type-2 .mega-menu__right {
  grid-template-columns: 1fr;
}

.mega-menu--type-3 .mega-menu__right {
  grid-template-columns: 1fr;
}

/* Tek Kutu Düzeni (Tip 4) */
.mega-menu--type-4 {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-sizing: border-box;
  position: absolute;
  top: 100%;
  left: 50%;
  width: auto;
  min-width: 400px;
  max-width: 600px;
  padding-top: 25px !important;
  transform: translateX(-50%) translateY(-10px);
}

.mega-menu__single {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 40px;
  width: 100%;
  background: #f7f9fc;
  border-radius: 48px;
  box-sizing: border-box;
}

.menu-item-image {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mega Menu Item */
.mega-menu__item {
  background: #ffffff;
  border-radius: 48px;
  transition: all 0.2s ease;
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: fit-content;
}

.mega-menu__link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-gray-dark, #4d4c4d);
  width: 100%;
}

/* Category Items - Tüm Mega Menu Tipleri İçin */
.mega-menu__item--category {
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.mega-menu__item--category.is-active {
  background: #ffffff;
  border-color: var(--color-green);
}

/* Sağ kutu itemlar için hover state - Tüm Mega Menu Tipleri İçin */
.mega-menu--type-1 .mega-menu__right .mega-menu__item,
.mega-menu--type-2 .mega-menu__right .mega-menu__item,
.mega-menu--type-3 .mega-menu__right .mega-menu__item {
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.mega-menu--type-1 .mega-menu__right .mega-menu__item:hover,
.mega-menu--type-2 .mega-menu__right .mega-menu__item:hover,
.mega-menu--type-3 .mega-menu__right .mega-menu__item:hover {
  border-color: var(--color-green);
}

/* Type-4 için hover state */
.mega-menu--type-4 .mega-menu__item {
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.mega-menu--type-4 .mega-menu__item:hover {
  border-color: var(--color-green);
}

.mega-menu__image-wrapper {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mega-menu__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.mega-menu__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mega-menu__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-gray-dark, #4d4c4d);
  line-height: 1.4;
}

.mega-menu__description {
  font-size: 14px;
  color: var(--color-gray, #999);
  line-height: 1.4;
}

.mega-menu__arrow {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.mega-menu__arrow-icon {
  width: 32px;
  height: 32px;
  display: block;
}

/* Tip 2: İkonlu Kategoriler */
.mega-menu__icon-wrapper {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mega-menu__icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.mega-menu__icon-wrapper .mega-menu__icon {
  /* CSS class için */
  width: 32px;
  height: 32px;
  display: block;
}

/* Tip 3: Minimal - Sadece Oklar */
.mega-menu--type-3 .mega-menu__item--category .mega-menu__link {
  justify-content: space-between;
}

/* Tip 4: Tek Kutu */
/* Tek kutu için özel stiller - özel stil gerekirse buraya eklenebilir */

/* Sağ Kutu Itemlar (Sub-items) */
/* Sağ kutu item stilleri - özel stil gerekirse buraya eklenebilir */

.mega-menu__item--sub-item .mega-menu__link {
  justify-content: space-between;
}

@media (max-width: 1023px) {
  .mega-menu-overlay {
    display: none !important;
  }
}

@media (max-width: 1190px) {
  .mega-menu--type-1 .mega-menu__right {
    grid-template-columns: 1fr;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .mega-menu {
    position: static;
    min-width: 100%;
    max-width: 100%;
    border-radius: 24px;
    padding: 16px;
    margin-top: 8px;
  }

  .mega-menu--type-1,
  .mega-menu--type-2,
  .mega-menu--type-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mega-menu--type-4 {
    max-width: 100%;
    min-width: 100%;
    padding-top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-10px) !important;
  }

  .mega-menu__single {
    padding: 16px;
    border-radius: 24px;
  }

  .menu-item-has-mega-menu:hover > .mega-menu--type-4,
  .menu-item-has-mega-menu.is-active > .mega-menu--type-4 {
    transform: translateX(-50%) translateY(0) !important;
  }

  .mega-menu__left,
  .mega-menu__right {
    gap: 8px;
  }

  .mega-menu__item {
    padding: 12px 16px;
    border-radius: 24px;
  }

  .mega-menu__image-wrapper,
  .mega-menu__icon-wrapper {
    width: 40px;
    height: 40px;
  }

  .mega-menu__title {
    font-size: 14px;
  }

  .mega-menu__description {
    font-size: 12px;
  }
}

/* Menu Item Hover State */
.main-menu .menu-item-has-mega-menu {
  position: static;
  overflow: visible;
}

/* Type-4 için özel konumlandırma - item'ın altında açılması için */
.main-menu .menu-item-mega-menu-type-4 {
  position: relative;
}

.main-menu .menu-item-has-mega-menu > a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-menu .menu-item-has-mega-menu > a::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-image: url("../images/icons/dropdown.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* Mega Menu Animation - transform zaten mega-menu'da tanımlı */
.mega-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.menu-item-has-mega-menu:hover > .mega-menu,
.menu-item-has-mega-menu.is-active > .mega-menu {
  display: grid !important;
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Type-4 için özel animasyon - aşağıdan gelip aşağı gitmesi için */
.mega-menu--type-4 {
  transform: translateX(-50%) translateY(-10px) !important;
}

.menu-item-has-mega-menu:hover > .mega-menu--type-4,
.menu-item-has-mega-menu.is-active > .mega-menu--type-4 {
  transform: translateX(-50%) translateY(0) !important;
}

@media (max-width: 1279px) {
  .mega-menu {
    margin: 0 20px;
    padding-top: 80px;
  }
  .mega-menu__single {
    padding: 25px;
  }
  .mega-menu__title {
    font-size: 15px;
  }
  .mega-menu a {
    padding: 7px 15px;
  }
  .mega-menu__left,
  .mega-menu__right {
    padding: 25px;
  }
}

@media (max-width: 1133px) {
  .mega-menu__title {
    font-size: 14px !important;
  }
}
