/* Models mega-menu — omodajaecoo.com.my style */

.nav-models {
  position: relative;
  display: flex;
  align-items: center;
}

.header__nav .nav-models__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--white, #fff);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.nav-models__trigger:hover,
.nav-models.is-open .nav-models__trigger {
  opacity: 1;
}

.nav-models__chevron {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.nav-models.is-open .nav-models__chevron {
  transform: rotate(180deg);
}

.header--models-open {
  background: rgba(15, 20, 18, 0.72) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
}

.models-mega {
  position: fixed;
  top: calc(var(--header-h, 52px) + 12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 99;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  color: #111;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 0 0 16px 16px;
  animation: modelsMegaIn 0.22s ease;
}

@keyframes modelsMegaIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.models-mega__panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 36px 32px 28px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 28px 40px;
  align-items: start;
}

.models-mega__brands {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 12px;
}

.models-mega__brand {
  appearance: none;
  background: none;
  border: 0;
  padding: 0 0 8px;
  font-family: var(--font-display, inherit);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9a9a9a;
  cursor: pointer;
  text-align: left;
  border-bottom: 3px solid transparent;
  width: fit-content;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.models-mega__brand.is-active {
  color: #111;
  border-bottom-color: #111;
}

.models-mega__models {
  min-height: 160px;
}

.models-mega__grid {
  display: none;
  flex-wrap: wrap;
  gap: 20px 28px;
  justify-content: flex-start;
  align-items: flex-end;
}

.models-mega__grid.is-active {
  display: flex;
}

.models-mega__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(200px, 22vw);
  color: #111;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.models-mega__card:hover {
  transform: translateY(-3px);
  color: #111;
}

.models-mega__card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: transparent;
}

.models-mega__card span {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.models-mega__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  padding: 18px 24px 22px;
  border-top: 1px solid #e6e6e6;
}

.models-mega__actions a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #111;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.models-mega__actions a:hover {
  opacity: 0.7;
  color: #111;
}

.models-mega__actions svg {
  flex-shrink: 0;
}

.mobile-models,
.mobile-nav__models {
  display: none;
}

body.models-mega-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .models-mega {
    display: none !important;
  }

  .nav-models {
    display: none;
  }

  .mobile-nav__models {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 4px 16px;
    border: 0;
    background: transparent;
    color: var(--black, #111);
    font: inherit;
    font-size: 17px;
    font-weight: var(--weight-ui, 600);
    cursor: pointer;
  }

  .mobile-nav__chevron {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-top: -4px;
    transition: transform 0.2s ease;
  }

  .mobile-nav__models.is-open .mobile-nav__chevron {
    margin-top: 2px;
    transform: rotate(225deg);
  }

  .mobile-models {
    display: block;
    width: min(100%, 280px);
    margin: 0 auto 8px;
    padding: 4px 0 12px;
    text-align: center;
  }

  .mobile-models[hidden] {
    display: none !important;
  }

  .mobile-models__tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .mobile-models__tab {
    flex: 1;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: rgba(0, 0, 0, 0.45);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .mobile-models__tab.is-active {
    color: #111;
    box-shadow: inset 0 -2px 0 #111;
  }

  .mobile-models__list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0;
  }

  .mobile-models__list[hidden] {
    display: none !important;
  }

  .mobile-models__list a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 500;
    color: #111;
    text-decoration: none;
  }

  .mobile-models__actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .mobile-models__actions a {
    min-height: 40px;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #111;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .header--models-open {
    background: rgba(10, 12, 14, 0.96) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .models-mega {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
