/* Niebieska belka kategorii + mega — OTUS #2563eb / #1d4ed8 */
:root {
  --otus-mm-ink: #1d4ed8;
  --otus-mm-ink-2: #2563eb;
  --otus-mm-line: rgba(255, 255, 255, 0.22);
  --otus-mm-text: #ffffff;
  --otus-mm-panel: #ffffff;
  --otus-mm-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.otus-mm-catbar {
  position: relative;
  z-index: 90;
  background: var(--otus-mm-ink);
  color: var(--otus-mm-text);
}

/* Mega mobile: stacking context catbara (90) był POD sticky headerem (100)
   → pierwsza pozycja L1 (Kawa) ginęła pod Szukaj. Podnieś cały catbar gdy open. */
body.otus-mm-mega-open .otus-mm-catbar {
  z-index: 320;
}

.otus-mm-catbar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  height: 48px;
  box-sizing: border-box;
  width: min(100% - 1.25rem, var(--otus-header-max, 1440px));
}

.otus-mm-filters-btn,
.otus-mm-cats__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  color: var(--otus-mm-text);
  background: transparent;
}

.otus-mm-filters-btn {
  flex: 0 0 auto;
  border: 1px solid var(--otus-mm-line);
  background: var(--otus-mm-ink-2);
}

.otus-mm-filters-btn:hover,
.otus-mm-filters-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
}

.otus-mm-cats {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: none;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}

.otus-mm-cats__list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 100%;
}

.otus-mm-cats__item {
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0;
}

.otus-mm-cats__btn:hover,
.otus-mm-cats__item.is-open > .otus-mm-cats__btn {
  background: rgba(255, 255, 255, 0.12);
}

.otus-mm-cats__chev {
  opacity: 0.85;
}

.otus-mm-cats__item.is-open > .otus-mm-cats__btn .otus-mm-cats__chev {
  transform: rotate(180deg);
}

/* Mega */
.otus-mm-mega[hidden],
.otus-mm-mega-backdrop[hidden],
.otus-mm-mega__panel[hidden] {
  display: none !important;
}

.otus-mm-mega-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(15, 23, 42, 0.45);
}

.otus-mm-mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 100;
  background: var(--otus-mm-panel);
  color: #161627;
  box-shadow: var(--otus-mm-shadow);
}

.otus-mm-mega__shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 320px;
  max-height: min(70vh, 560px);
}

.otus-mm-mega__mob-head {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e8e8ea;
  background: #fff;
}

.otus-mm-mega__rail {
  background: #f5f8fa;
  border-right: 1px solid #e8e8ea;
  overflow-y: auto;
}

.otus-mm-mega__rail-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.otus-mm-mega__rail-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: #161627;
  text-align: left;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.otus-mm-mega__rail-btn.is-active,
.otus-mm-mega__rail-btn:hover {
  background: #fff;
  border-left-color: var(--otus-mm-ink);
  color: var(--otus-mm-ink);
}

.otus-mm-mega__main {
  position: relative;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
}

.otus-mm-mega__close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  width: 36px;
  height: 36px;
}

.otus-mm-mega__close--desk {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
}

.otus-mm-mega__panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
  padding-right: 2rem;
}

.otus-mm-mega__panel-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #161627;
}

.otus-mm-mega__all {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--otus-mm-ink-2);
  text-decoration: none;
}

.otus-mm-mega__all:hover {
  color: var(--otus-mm-ink);
}

.otus-mm-mega__group-label {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.otus-mm-mega__columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem 1.25rem;
}

.otus-mm-mega__l2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #161627;
  text-decoration: none;
  margin-bottom: 0.35rem;
}

.otus-mm-mega__l2:hover {
  color: var(--otus-mm-ink);
}

.otus-mm-mega__count {
  font-weight: 500;
  font-size: 0.8rem;
  color: #6b7280;
}

.otus-mm-mega__l3 {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.otus-mm-mega__l3 a {
  font-size: 0.88rem;
  color: #374151;
  text-decoration: none;
}

.otus-mm-mega__l3 a:hover {
  color: var(--otus-mm-ink);
}

.otus-mm-mega__hint {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

.otus-mm-mega__hint a {
  color: var(--otus-mm-ink-2);
  font-weight: 600;
  text-decoration: none;
}

body.otus-mm-mega-open {
  overflow: hidden;
}

/* L1 Kawa/Środki/Tonery nie na belce — tylko mega */
.otus-mm-cats {
  display: none !important;
}

.otus-mm-quick {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.otus-mm-quick__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.otus-mm-quick__link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.otus-mm-quick__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
}

.otus-mm-quick__icon--tag svg {
  display: block;
}

.otus-mm-quick__label {
  display: inline;
}

.otus-mm-ship[hidden],
.otus-mm-ship.is-hidden {
  display: none !important;
}

.otus-mm-ship {
  margin-left: auto;
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  max-width: min(420px, 48%);
  padding-left: 8px;
  text-align: right;
  line-height: 1.2;
}

.otus-mm-ship__text {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.otus-mm-ship__timer {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: 0.02em;
}

.otus-mm-ship__timer[hidden] {
  display: none !important;
}

/* Telefon: Promocje / Outlet tylko piktogramy (aria-label) */
@media (max-width: 899px) {
  .otus-mm-quick__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .otus-mm-quick__link {
    width: 36px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .otus-mm-quick {
    flex: 0 0 auto;
    gap: 2px;
  }

  .otus-mm-ship {
    max-width: min(52vw, 220px);
  }

  .otus-mm-ship__text {
    font-size: 11px;
  }
}

@media (max-width: 899px) {
  body.otus-mm-mega-open .otus-header {
    z-index: 50;
  }

  .otus-mm-mega-backdrop {
    z-index: 310;
  }

  .otus-mm-mega {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: none;
    height: 100%;
    height: 100dvh;
    z-index: 330;
    /* nad sticky header + search — nie ucinaj Kawy */
  }

  .otus-mm-mega__shell {
    grid-template-columns: 1fr;
    max-height: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .otus-mm-mega__mob-head {
    display: flex;
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .otus-mm-mega__close--desk {
    display: none;
  }

  .otus-mm-mega__rail {
    border-right: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* pierwszy L1 (Kawa) zawsze w viewport od góry raila */
    padding-top: 0;
  }

  .otus-mm-mega__rail-list {
    padding-top: 0.35rem;
    padding-bottom: 1.5rem;
  }

  .otus-mm-mega__rail-btn:first-child,
  .otus-mm-mega__rail-list > li:first-child .otus-mm-mega__rail-btn {
    /* upewnij widoczność pierwszej pozycji */
    scroll-margin-top: 0;
  }

  .otus-mm-mega__main {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  .otus-mm-mega.is-l2 .otus-mm-mega__rail {
    display: none;
  }

  .otus-mm-mega.is-l2 .otus-mm-mega__main {
    display: block;
  }

  .otus-mm-mega.is-l2 [data-otus-mega-back] {
    display: inline-flex !important;
  }
}
