/* ================================================================
   MEGA MENU — XS-style category navigation bar
   ================================================================ */

.mk-mega-menu {
  background: var(--mk-menu-bg);
  z-index: 999;
  position: relative;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.mk-mega-menu__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.mk-mega-menu__list {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mk-mega-menu__item {
  position: static;
  flex: 1;
}

.mk-mega-menu__link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: #2d1f2d;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
  letter-spacing: 0.01em;
}

.mk-mega-menu__link:hover,
.mk-mega-menu__item:hover > .mk-mega-menu__link {
  background: rgba(0, 0, 0, 0.06);
  color: #2d1f2d;
}

/* Special items — colored backgrounds, same height as other items */
.mk-mega-menu__item--new .mk-mega-menu__link {
  color: #fff;
  font-weight: 600;
  background: #4caf50;
}

.mk-mega-menu__item--new .mk-mega-menu__link:hover {
  color: #fff;
  background: #388e3c;
}

.mk-mega-menu__item--sale .mk-mega-menu__link {
  color: #fff;
  font-weight: 600;
  background: #e53935;
}

.mk-mega-menu__item--sale .mk-mega-menu__link:hover {
  color: #fff;
  background: #c62828;
}

/* ================================================================
   DROPDOWN — full-width panel below the bar
   ================================================================ */

.mk-mega-menu__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, box-shadow 0.25s ease;
  z-index: 1001;
  border-top: 2px solid var(--mk-ink);
}

.mk-mega-menu__item:hover > .mk-mega-menu__dropdown {
  opacity: 1;
  visibility: visible;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
}

.mk-mega-menu__dropdown-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px;
}

.mk-mega-menu__subcategories {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px 32px;
}

.mk-mega-menu__subitem {
  margin: 0;
}

.mk-mega-menu__sublink {
  display: block;
  padding: 8px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #555;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.mk-mega-menu__sublink:hover {
  background: #fde5f1;
  color: #111;
}

/* ================================================================
   GROUPS — columnar layout for categorised dropdown sections
   ================================================================ */

.mk-mega-menu__groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.mk-mega-menu__group-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--mk-ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}

/* ================================================================
   HAMBURGER BUTTON (mobile only)
   ================================================================ */

.mk-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #111;
  -webkit-tap-highlight-color: transparent;
}

/* ================================================================
   MOBILE DRAWER
   ================================================================ */

#mk-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 100001;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
}

#mk-mobile-menu {
  overscroll-behavior: contain;
}

#mk-mobile-menu.is-open {
  display: flex;
}

body.mk-mobile-menu-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}

.mk-mobile-menu__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  max-height: 56px;
}

.mk-mobile-menu__logo {
  height: 28px;
  width: auto;
  max-height: 28px;
  max-width: 120px;
  object-fit: contain;
}

.mk-mobile-menu__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #111;
  -webkit-tap-highlight-color: transparent;
}

.mk-mobile-menu__nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.mk-mobile-menu__list,
.mk-mobile-menu__categories {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mk-mobile-menu__item {
  border-bottom: 1px solid #f5f5f5;
}

.mk-mobile-menu__link {
  display: block;
  padding: 14px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #111;
  text-decoration: none;
}

.mk-mobile-menu__link:active {
  background: #f9f9f9;
}

.mk-mobile-menu__category {
  border-bottom: 1px solid #f5f5f5;
}

.mk-mobile-menu__toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #111;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.mk-mobile-menu__toggle::after {
  content: '+';
  font-size: 20px;
  font-weight: 300;
  color: #888;
  transition: transform 0.2s;
}

.mk-mobile-menu__category.is-open > .mk-mobile-menu__toggle::after {
  content: '\2212';
}

.mk-mobile-menu__submenu {
  display: none;
  padding: 0 20px 14px 32px;
}

.mk-mobile-menu__category.is-open > .mk-mobile-menu__submenu {
  display: block;
}

.mk-mobile-menu__submenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mk-mobile-menu__submenu li + li {
  margin-top: 2px;
}

.mk-mobile-menu__sublink {
  display: block;
  padding: 8px 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #555;
  text-decoration: none;
}

.mk-mobile-menu__sublink:active {
  color: #111;
}

.mk-mobile-menu__sublink--all {
  color: var(--mk-ink);
  font-weight: 500;
}

.mk-mobile-menu__group-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mk-ink);
  padding: 12px 0 4px;
  list-style: none;
}

.mk-mobile-menu__category--new > .mk-mobile-menu__toggle,
.mk-mobile-menu__category--new > .mk-mobile-menu__link {
  color: #2e7d32;
}

.mk-mobile-menu__category--sale > .mk-mobile-menu__toggle,
.mk-mobile-menu__category--sale > .mk-mobile-menu__link {
  color: #c62828;
}

.mk-mobile-menu__footer {
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.mk-mobile-menu__footer .kiddie-lang-menu {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.mk-mobile-menu__footer .mk-lang-link {
  font-size: 15px;
  padding: 8px 12px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 900px) {
  .mk-mega-menu {
    display: none;
  }

  .mk-mobile-toggle {
    display: flex;
  }
}

@media (min-width: 901px) {
  #mk-mobile-menu {
    display: none !important;
  }

  .mk-mobile-toggle {
    display: none !important;
  }
}
