/* ==========================================================================
   Menu - mieszkanie-komunalne.pl, motyw "Rejestr lokali" v1 (2026-10-20)
   Pelny plik modulu menu - zastepuje poprzedni w calosci.
   - progi zgodne ze skryptem menu: do 1024 px klik w "Mieszkania" otwiera
     podmenu, wiec do 1024 px jest przycisk "Menu", od 1025 px menu poziome,
   - kolory z motywu: swierkowa zielen #1f5641 / #143b2c, bursztyn #e5a823,
   - pola dotykowe min. 44 px, pole szukania 16 px (bez zoomu na iOS),
   - nazwa serwisu obok logo jako ::after (tekst dekoracyjny, nie tresc).
   ========================================================================== */

.toggler-25c0,
.exit-a025,
.pm56a0-bar {
  display: none;
}

#pm56a0 > ul > li.mi-sep {
  display: none;
}

/* przycisk szukania: ikona lupy rysowana w CSS (znak "o" ukryty, aria-label zostaje) */
#pm56a0 > ul > .msr56a0 button {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #1f5641;
  color: transparent;
  font-size: 0;
  cursor: pointer;
}

#pm56a0 > ul > .msr56a0 button::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

#pm56a0 > ul > .msr56a0 button::after {
  content: "";
  position: absolute;
  top: 27px;
  left: 26px;
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: #ffffff;
  transform: rotate(45deg);
  transform-origin: left center;
}

#pm56a0 > ul > .msr56a0 button:hover {
  background: #143b2c;
}

#pm56a0 > ul > .msr56a0 form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

#pm56a0 > ul > .msr56a0 input {
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid #aab6ae;
  border-radius: 999px;
  background: #f7f9f7;
  color: #1b2420;
  font-family: inherit;
  font-size: 16px;
}

#pm56a0 > ul > .msr56a0 input:focus {
  border-color: #1f5641;
  background: #ffffff;
  outline: 3px solid rgba(229, 168, 35, .55);
  outline-offset: 1px;
}

/* ---------- Telefon i tablet: przycisk "Menu" ---------- */

@media (max-width: 1024px) {
  .pm56a0-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 60;
    max-width: 100%;
    padding: 8px 16px;
  }

  .mlb56a0 {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    min-width: 0;
    line-height: 0;
    text-decoration: none;
  }

  .mlb56a0 img {
    display: block;
    width: 48px;
    height: 48px;
  }

  .mlb56a0::after {
    content: "mieszkanie-komunalne.pl";
    overflow: hidden;
    color: #143b2c;
    font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .toggler-25c0 {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: #1f5641;
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
  }

  .toggler-25c0[aria-expanded="true"] {
    background: #143b2c;
  }

  .toggler-25c0 .ic56a0 {
    font-size: 18px;
    line-height: 1;
  }

  .exit-a025 {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin: 0 0 8px;
    padding: 0 16px;
    border: 1px solid #1f5641;
    border-radius: 999px;
    background: transparent;
    color: #1f5641;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
  }

  #pm56a0 {
    display: none !important;
    margin: 0 16px 14px;
    padding: 14px 16px 16px;
    border: 1px solid #d8dfda;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(20, 59, 44, .16);
  }

  #pm56a0.on {
    display: block !important;
  }

  #pm56a0 > ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #pm56a0 > ul > li {
    position: relative;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #e3e8e4;
  }

  #pm56a0 > ul > li:last-child {
    border-bottom: 0;
  }

  #pm56a0 > ul > li > a {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 6px;
    color: #1b2420;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
  }

  #pm56a0 > ul > li.has-children > a::after {
    content: "";
    width: 9px;
    height: 9px;
    margin: -4px 4px 0 auto;
    border-right: 2px solid #1f5641;
    border-bottom: 2px solid #1f5641;
    transform: rotate(45deg);
    transition: transform .2s ease;
  }

  #pm56a0 > ul > li.has-children.open > a::after {
    margin-top: 4px;
    transform: rotate(-135deg);
  }

  #pm56a0 ul.sub {
    max-height: 0;
    margin: 0;
    padding: 0 0 0 12px;
    overflow: hidden;
    list-style: none;
    border-left: 3px solid #e5a823;
    transition: max-height .3s ease, margin .3s ease;
  }

  #pm56a0 > ul > li.open > ul.sub {
    max-height: 1000px;
    margin: 0 0 10px;
  }

  #pm56a0 ul.sub > li {
    margin: 0;
    padding: 0;
  }

  #pm56a0 ul.sub > li > a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 8px;
    color: #1f5641;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
  }

  /* logo w panelu dubluje logo z paska - ukryte */
  #pm56a0 > ul > .mlg56a0 {
    display: none;
  }

  #pm56a0 > ul > .msr56a0 {
    padding: 14px 0 2px;
  }

  #pm56a0 > ul > .msr56a0 input {
    flex: 1 1 auto;
  }
}

@media (max-width: 359px) {
  .mlb56a0::after {
    display: none;
  }
}

/* ---------- Komputer: menu poziome ---------- */

@media (min-width: 1025px) {
  .toggler-25c0,
  .exit-a025,
  .pm56a0-bar {
    display: none !important;
  }

  #pm56a0 {
    display: block !important;
    position: static !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    transform: none !important;
  }

  #pm56a0 > ul {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 12px 0;
    list-style: none;
  }

  #pm56a0 > ul > li {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0 !important;
  }

  #pm56a0 > ul > li > a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    color: #1b2420;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
  }

  #pm56a0 > ul > li > a:hover,
  #pm56a0 > ul > li.has-children:hover > a,
  #pm56a0 > ul > li.has-children:focus-within > a {
    background: #e2ede7;
    color: #143b2c;
  }

  #pm56a0 > ul > li.has-children > a::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 2px solid #1f5641;
    border-bottom: 2px solid #1f5641;
    transform: rotate(45deg);
  }

  #pm56a0 ul.sub {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 250px;
    margin: 0;
    padding: 8px;
    list-style: none;
    border: 1px solid #d8dfda;
    border-top: 4px solid #e5a823;
    border-radius: 0 0 14px 14px;
    background: #ffffff;
    box-shadow: 0 16px 32px rgba(20, 59, 44, .16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility 0s linear .25s;
  }

  #pm56a0 > ul > li.has-children:hover > ul.sub,
  #pm56a0 ul.sub:hover,
  #pm56a0 > ul > li.has-children:focus-within > ul.sub,
  #pm56a0 > ul > li.has-children.open > ul.sub {
    opacity: 1;
    visibility: visible;
    pointer-events: initial;
    transition: opacity .18s ease, visibility 0s linear 0s;
  }

  #pm56a0 ul.sub > li {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0 !important;
  }

  #pm56a0 ul.sub > li > a {
    display: block !important;
    padding: 12px 14px !important;
    border-radius: 8px !important;
    color: #1b2420 !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }

  #pm56a0 ul.sub > li > a:hover {
    background: #e2ede7;
    color: #143b2c !important;
  }

  /* logo + nazwa serwisu */
  #pm56a0 > ul > .mlg56a0 {
    display: flex;
    align-items: center;
    margin-right: 20px;
    padding: 0 !important;
  }

  #pm56a0 > ul > .mlg56a0 a {
    display: inline-flex !important;
    align-items: center;
    gap: 12px;
    min-height: 0;
    padding: 0 !important;
    background: transparent !important;
    line-height: 0;
  }

  #pm56a0 > ul > .mlg56a0 a:hover {
    background: transparent !important;
  }

  #pm56a0 > ul > .mlg56a0 img {
    display: block;
    width: 58px;
    height: 58px;
  }

  #pm56a0 > ul > .mlg56a0 a::after {
    content: "mieszkanie-komunalne.pl";
    color: #143b2c;
    font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
  }

  #pm56a0 > ul > .msr56a0 {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0 0 0 auto;
    padding: 0 !important;
  }

  #pm56a0 > ul > .msr56a0 input {
    width: 230px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #pm56a0 ul.sub,
  #pm56a0 > ul > li > a,
  #pm56a0 > ul > li.has-children > a::after {
    transition: none !important;
  }
}
