/* Megamenu - Full screen container */
#megamenu-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
}

#megamenu-container.active {
  display: block;
}

.megamenu {
  --megamenu-header-height: 4.5rem;
  position: relative;
  width: 100vw;
  height: 100vh;
  font-family: "Gilroy", sans-serif;
  display: flex;
  flex-direction: column;
}

/* Megamenu Header */
.megamenu-header {
  position: relative;
  height: var(--megamenu-header-height);
  background: var(--shadow-color);
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  z-index: 10;
}

.megamenu-header ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: flex-start;
  gap: 0;
  flex: 1;
}

/* Close button in header */
.megamenu-header .megamenu-close {
  position: absolute;
  top: 50%;
  right: 1.125rem;
  transform: translateY(-50%);
  z-index: 6;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 20, 24, 0.25);
  color: var(--light-color);
  font-size: 1.5rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  backdrop-filter: blur(4px);
}

.megamenu-header .megamenu-close:hover {
  transform: translateY(-50%) scale(1.03);
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-light);
}

.megamenu-header-item {
  width: 180px;
  height: var(--megamenu-header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-color);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.megamenu-header-item::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--light-color);
  transition: width 0.25s ease;
}

/* Hover */
.megamenu-header-item:hover {
  color: var(--secondary-light);
  background: var(--glass-30);
}

.megamenu-header-item:hover::after {
  background: var(--secondary-light);
  width: 100%;
}

/* Active */
.megamenu-header-item.active::after {
  width: 100%;
  background: var(--light-color);
}

/* Megamenu Block */
.megamenu-block {
  display: none;
  position: relative;
  width: 100vw;
  height: calc(100vh - var(--megamenu-header-height));
  overflow: hidden;
}

.megamenu-block.active {
  display: block;
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Background Image */
.backgorund {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.backgorund img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.backgorund-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--glass-80), var(--glass-70));
  backdrop-filter: blur(2px);
  z-index: 2;
}

/* Megamenu Container */
.megamenu-container {
  position: relative;
  z-index: 3;
  display: flex;
  max-width: 87.5rem;
  margin: 0 auto;
  padding: 0;
  gap: 0;
  min-height: 100%;
  height: 100%;
}

/* Megamenu Left */
.megamenu-left {
  width: 11rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--glass-30);
}

.megamenu-left:first-child {
  border-right: 1px solid var(--glass-50);
}

.megamenu-left-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* left items */
.megamenu-left-item {
  width: 100%;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-color);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  position: relative;
  background: transparent;
  border-left: none;
  transition: color 0.18s ease;
}

.megamenu-left-item a {
  color: inherit;
  text-decoration: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.megamenu-left-item::before {
  content: none;
}

.megamenu-left-item::after {
  content: "";
  position: absolute;
  bottom: 0.5rem;
  left: 0.75rem;
  right: 0.75rem;
  height: 0.125rem;
  background: var(--glass-50);
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.25s ease, background 0.25s ease;
}

.megamenu-left-item:hover::after,
.megamenu-left-item:focus::after,
.megamenu-left-item.active::after {
  background: var(--primary-color);
}

.megamenu-left-item:hover {
  color: var(--primary-light);
  background: transparent;
}

/* Sublist */
.megamenu-left-sublist {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.megamenu-left-subitem {
  width: 100%;
  height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-gray);
  font-size: 0.875rem;
  font-weight: 300;
  cursor: pointer;
  position: relative;
  background: transparent;
  transition: color 0.18s ease;
}

.megamenu-left-subitem a {
  color: inherit;
  text-decoration: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.megamenu-left-subitem::after {
  content: "";
  position: absolute;
  bottom: 0.375rem;
  left: 0.75rem;
  right: 0.75rem;
  height: 0.125rem;
  background: var(--glass-50);
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.25s ease, background 0.25s ease;
}

.megamenu-left-subitem:hover {
  color: var(--white);
  background: transparent;
  text-decoration: none;
}

.megamenu-left-subitem:hover::after {
  background: var(--primary-color);
}

/* Megamenu Right */
.megamenu-right {
  flex: 1;
  min-width: 25rem;
  background: rgba(255, 255, 255, 0);
  backdrop-filter: none;
  padding: 1.875rem;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.megamenu-right-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.megamenu-right-content h2 {
  color: var(--primary-light);
  font-size: 1.75rem;
  font-weight: 300;
  margin: 0 0 1.25rem 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 600px;
}

.megamenu-right-content p {
  color: var(--light-color);
  font-size: 1rem;
  line-height: 1.8;
  margin: 0;
  opacity: 0.95;
  text-align: center;
  max-width: 600px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .megamenu-container {
    padding: 0;
  }
  .megamenu-left {
    width: 9rem;
  }
  .megamenu-header-item {
    width: 5rem;
  }
}

@media (max-width: 992px) {
  .megamenu-container {
    flex-wrap: wrap;
    padding: 30px 20px;
  }
  .megamenu-left {
    width: 50%;
  }
  .megamenu-right {
    display: none;
  }
  .megamenu-header-item {
    padding: 15px 25px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .megamenu-header {
    height: calc(var(--megamenu-header-height) * 0.9);
  }
  .megamenu-header .megamenu-close {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.125rem;
    right: 0.75rem;
  }
  .megamenu-left {
    width: 50%;
  }
  .megamenu-left-item {
    height: 2.5rem;
    font-size: 0.875rem;
  }
  .megamenu-left-subitem {
    height: 1.75rem;
    font-size: 0.8125rem;
  }
}

/* ensure no border-radius anywhere in megamenu */
.megamenu * {
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
