:root {
  --mbb-gradient-left: #3354d8;
  --mbb-gradient-right: #18afef;
  --mbb-text: #ffffff;
  --mbb-title: #000000; /* czarny dla tytułów */
  --mbb-h-base: 60px;     /* bazowa wysokość paska (bez safe-area) */
  --mbb-h: var(--mbb-h-base);
  --mbb-gap: 10px;
}

/*
  Facebook In-App Browser na iOS dokleja własną belkę na dole,
  która potrafi nachodzić na nasz pasek. W tej konkretnej sytuacji
  zwiększamy wysokość paska o 13px (bez podnoszenia "bottom").
  Klasa jest dodawana JS-em tylko po scrollu i tylko w FB iOS.
*/
body.mbb-fb-ios-boost {
  --mbb-h: calc(var(--mbb-h-base) + 13px);
}

/* FB iOS (scroll w dół): podnieś tytuł o 7px (bez wpływu na wysokość elementów). */
body.mbb-fb-ios-boost .slider-title{
  position: relative;
  top: -7px;
}

/* FB iOS (scroll w dół): zachowaj fade, ale niech nie przykrywa tytułów */
body.mbb-fb-ios-boost .text-wrapper{
  position: relative;
  z-index: 3; /* nad overlayami fade */
}

/* Pasek: domyślnie ukryty (wjeżdża po scrollu) */
.mobile-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  /* chowamy cały pasek razem z bezpiecznym obszarem iOS */
  bottom: calc(-1 * (var(--mbb-h) + env(safe-area-inset-bottom)));
  z-index: 9999;

  height: calc(var(--mbb-h) + env(safe-area-inset-bottom));
  padding: 0;

  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;

  background: #ffd400; /* żółte tło paska */
  border-top: 0; /* bez obramowania u góry */
  box-shadow: 0 -8px 24px rgba(0,0,0,0.12);

  transition: bottom 0.4s ease-out;
  overflow: hidden; /* nic nie ma wystawać poza pasek */

  cursor: pointer;
}


/* Subtelny "shine" – przejazd jasnego refleksu co kilka sekund */
.mobile-bottom-bar::before{
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 60%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-18deg);
  animation: mbbShine 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes mbbShine{
  0%, 70% { transform: translateX(0) skewX(-18deg); opacity: 0; }
  75% { opacity: 1; }
  100% { transform: translateX(220%) skewX(-18deg); opacity: 0; }
}

.mobile-bottom-bar:focus-visible{
  outline: 2px solid rgba(0,0,0,0.55);
  outline-offset: -2px;
}


/* Etykieta UWAGA (pill) w lewym górnym rogu */
.mbb-alert {
  position: absolute;
  top: 7px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 5; /* nad sliderem i jego overlayami (żeby nic nie ucinało pigułki) */
  pointer-events: none; /* maksymalizujemy klikalność paska */
  user-select: none;
}

/* Klikalna pigułka UWAGA (link do /uwaga), mimo że reszta .mbb-alert ma pointer-events:none */
.mbb-badge-link{
  pointer-events: auto;
  display: inline-flex;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.mbb-badge-link:focus,
.mbb-badge-link:active{
  outline: none;
}

/* Małe logo w prawym górnym rogu (link do miejska.pl) */
.mbb-toplogo{
  position: absolute;
  top: 7px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  z-index: 5;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}
.mbb-toplogo img{
  height: 24px;
  width: auto;
  max-width: 140px;
  display: block;
}

.mbb-badge{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #000;
  color: #fff;
  border-radius: 999px;
  padding: 5px 10px; /* +1px w pionie, żeby nie „ucinało” dołu na iOS */
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.mbb-sub{
  color: #000;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2px;
}

.mbb-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff2d2d;
  position: relative;
}

.mbb-pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.65);
  transform: scale(0.6);
  opacity: 0.9;
  animation: mbbPulse 1.2s ease-out infinite;
}

@keyframes mbbPulse {
  0%   { transform: scale(0.6); opacity: 0.9; }
  70%  { transform: scale(1.2); opacity: 0.0; }
  100% { transform: scale(1.2); opacity: 0.0; }
}

.mobile-bottom-bar.visible-bar {
  bottom: 0;
}

.mobile-bottom-bar.bounce-bar {
  animation: mbbBounce 0.5s ease-out;
}

@keyframes mbbBounce {
  0% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

/* Slider tytułów – pełna szerokość paska */
.mbb-titles {
  flex: 1 1 auto;
  min-width: 0;            /* kluczowe dla ellipsis w flex */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  position: relative;
  z-index: 1;
  background: transparent;
  padding: 30px 12px 0 12px; /* miejsce na badge UWAGA */
}

.slider-mask {
  width: 100%;
  height: 30px;
  overflow: hidden;
  position: relative; /* potrzebne do fade overlays */
}

/* Subtelne wygaszanie tytułów przy znikaniu (góra/dół) */
.slider-mask::before,
.slider-mask::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  height: 10px;
  pointer-events:none;
  z-index: 2;
}
.slider-mask::before{
  top:0;
  background: linear-gradient(to bottom, #ffd400 0%, rgba(255,212,0,0) 100%);
}
.slider-mask::after{
  bottom:0;
  background: linear-gradient(to top, #ffd400 0%, rgba(255,212,0,0) 100%);
}

.text-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.text-wrapper > div {
  height: 30px;
  line-height: 30px;
  width: 100%;
}

.slider-title {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--mbb-title) !important;
  font-weight: 800 !important;
  font-size: 19px !important;
  text-decoration: none;
}

/* Mobile-only */
@media (min-width: 991px) {
  .mobile-bottom-bar { display: none !important; }
}

/* Żeby pasek nie zasłaniał treści na mobile */
@media (max-width: 990px) {
  body {
    padding-bottom: calc(var(--mbb-h) + env(safe-area-inset-bottom));
  }
}


/* Mini-znacznik przed tytułem (ułatwia zauważenie) */
.slider-title::before{
  content: "›";
  display: inline-block;
  margin-right: 8px;
  font-weight: 900;
}
