/* === OPLEX mega menu === */
.oplex-megamenu {
  background: #181818;
  color: #f9fafb;
  border: 0;
  position: relative;
  z-index: 50;
}
.oplex-megamenu__inner {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  min-height: 48px;
}
.oplex-megamenu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0;
}
.oplex-megamenu__item {
  position: relative;
  display: flex;
  align-items: stretch;
}
/* subtelne białe separatory między buttonami megamenu (desktop) */
@media (min-width: 992px) {
  .oplex-megamenu__item + .oplex-megamenu__item::before {
    content: ""; align-self: center; flex: 0 0 auto;
    width: 1px; height: 18px; background: rgba(255,255,255,.30);
  }
}
.oplex-megamenu__link {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 0 1rem;
  font-size: .92rem;
  font-weight: 600;
  color: #f9fafb;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.oplex-megamenu__link:hover,
.oplex-megamenu__item:hover > .oplex-megamenu__link {
  background: #232323;
  color: var(--oplex-accent, #facc15);
  text-decoration: none;
}
.oplex-megamenu__caret {
  font-size: 18px;
  opacity: .7;
}
/* przycisk „Kategorie" + nagłówek drawera — tylko mobile */
.oplex-megamenu__toggle { display: none; }
.oplex-megamenu__drawer-head { display: none; }

/* Dropdown */
.oplex-megamenu__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  max-width: 320px;
  background: #fff;
  color: #1f2937;
  list-style: none;
  margin: 0;
  padding: .35rem 0;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  border-top: 2px solid var(--oplex-accent, #f97316);
  display: none;
  z-index: 100;
}
.oplex-megamenu__item:hover .oplex-megamenu__dropdown,
.oplex-megamenu__item:focus-within .oplex-megamenu__dropdown {
  display: block;
}
.oplex-megamenu__dropdown-link {
  display: block;
  padding: .55rem 1rem;
  font-size: .88rem;
  color: #1f2937;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.oplex-megamenu__dropdown-link:hover {
  background: #f5f5f5;
  color: var(--oplex-accent, #f97316);
  text-decoration: none;
}

/* Chip "Mój pojazd" po prawej */
.oplex-megamenu__vehicle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .8rem;
  margin: .35rem 0;
  background: var(--oplex-accent, #f97316);
  color: var(--oplex-on-accent, #fff);
  border-radius: 999px;
  font-weight: 600;
  font-size: .82rem;
  align-self: center;
  cursor: pointer;
}
.oplex-megamenu__vehicle:hover { background: var(--oplex-accent-hover, #ea580c); }
.oplex-megamenu__vehicle .material-icons { font-size: 18px; }
.oplex-megamenu__vehicle-clear {
  background: rgba(0,0,0,.15);
  color: #fff;
  border: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.oplex-megamenu__vehicle-clear:hover { background: rgba(0,0,0,.3); }

/* ===== MOBILE: zwinięte menu za buttonem „Kategorie" + akordeon ===== */
@media (max-width: 991.98px) {
  .oplex-megamenu__inner { flex-wrap: wrap; align-items: stretch; }
  .oplex-megamenu__toggle {
    display: flex; align-items: center; gap: .5rem;
    width: 100%; padding: .75rem 1rem;
    background: transparent; color: #f9fafb; border: 0;
    font-weight: 700; font-size: .95rem; cursor: pointer;
  }
  .oplex-megamenu__toggle .material-icons { font-size: 22px; }

  /* backdrop overlay */
  .oplex-megamenu__backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    opacity: 0; visibility: hidden; transition: opacity .25s ease; z-index: 99990;
  }
  .oplex-megamenu.is-open .oplex-megamenu__backdrop { opacity: 1; visibility: visible; }
  /* drawer wysuwany z lewej */
  .oplex-megamenu__list {
    display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0;
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 84%; max-width: 340px;
    background: #1a1a1a; z-index: 99991;
    transform: translateX(-100%); transition: transform .28s ease;
    overflow-y: auto; overscroll-behavior: contain;
    box-shadow: 4px 0 24px rgba(0,0,0,.45);
    padding-bottom: 1rem;
  }
  .oplex-megamenu.is-open .oplex-megamenu__list { transform: translateX(0); }
  /* nagłówek drawera (tytuł + zamknij) */
  .oplex-megamenu__drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .9rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1);
    color: #fff; font-weight: 700; font-size: 1rem;
    position: sticky; top: 0; background: #1a1a1a; z-index: 1;
  }
  .oplex-megamenu__close {
    background: none; border: 0; color: #fff; font-size: 1.7rem; line-height: 1;
    cursor: pointer; padding: 0 .25rem;
  }

  .oplex-megamenu__item { flex-direction: column; align-items: stretch; }
  .oplex-megamenu__link {
    justify-content: space-between;
    padding: .75rem 1rem;
    border-top: 1px solid rgba(255,255,255,.07);
  }
  .oplex-megamenu__caret { transition: transform .15s ease; opacity: .9; }
  .oplex-megamenu__item.is-open > .oplex-megamenu__link .oplex-megamenu__caret { transform: rotate(180deg); }

  .oplex-megamenu__dropdown {
    display: none !important;
    position: static; min-width: 0; max-width: none;
    box-shadow: none; border-top: 0; border-radius: 0;
    background: #232323; padding: 0;
  }
  .oplex-megamenu__item.is-open > .oplex-megamenu__dropdown { display: block !important; }
  .oplex-megamenu__dropdown-link { color: #e5e7eb; padding: .6rem 1rem .6rem 2.25rem; font-size: .9rem; }
  .oplex-megamenu__dropdown-link:hover { background: #2c2c2c; color: var(--oplex-accent, #facc15); }
  .oplex-megamenu__dropdown-all { font-weight: 700; padding-left: 1rem; }
}
