/* Mobile layer: isolated overrides to preserve desktop rendering. */

#mobileTopbar,
#mobileMenuToggle,
#mobileMenuBackdrop {
  display: none;
}

@media (max-width: 980px) {
  body {
    padding-top: 58px;
  }

  #mobileTopbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 99999985;
    height: 50px;
    padding: 4px 10px;
    background: #e6f1f5;
    border-bottom: 1px solid #c3d8e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  #mobileMenuToggle {
    display: block;
    position: static;
    padding: 8px 10px;
    border: 1px solid #a00000;
    background: #d40000;
    color: #fff;
    font: bold 13px/1.2 Tahoma, Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    cursor: pointer;
  }

  #mobileMenuToggle .mobile-menu-icon {
    font-size: 15px;
    line-height: 1;
    vertical-align: middle;
    margin-right: 2px;
  }

  #mobileTopbarBrand {
    display: block;
    width: 110px;
    height: 34px;
    background: url('../img/logo.png') no-repeat center center;
    background-size: contain;
    text-decoration: none;
    flex: 0 0 auto;
  }

  #mobileTopbarActions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
  }

  #mobileTopbarActions a {
    display: inline-block;
    padding: 6px 8px;
    font: bold 11px/1.2 Tahoma, Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    color: #fff;
    background: #0072bc;
    border: 1px solid #005f9d;
    text-decoration: none;
  }

  #mobileTopbarActions a:hover {
    background: #005f9d;
  }

  #mobileMenuBackdrop {
    display: block;
    position: fixed;
    inset: 50px 0 0 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999955;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease;
  }

  #mobileMenuBackdrop.is-open {
    opacity: 1;
    visibility: visible;
  }

  body.is-mobile-nav-open {
    overflow: hidden;
  }

  body.is-mobile-nav-open #poptavkaBtn {
    display: none;
  }

  #head {
    display: none !important;
  }

  #page {
    width: auto;
    max-width: 100%;
    padding: 0 10px;
  }

  #logo {
    display: none;
  }

  #content {
    width: auto;
    max-width: 100%;
    padding-top: 0;
    clear: both;
  }

  #lc {
    position: fixed;
    top: 50px;
    left: 0;
    height: calc(100vh - 50px);
    float: none;
    width: 280px;
    max-width: 86vw;
    margin: 0;
    background: #fff;
    box-shadow: 3px 0 18px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    z-index: 99999960;
    transform: translateX(-110%);
    transition: transform 0.24s ease;
  }

  #lc.is-open {
    transform: translateX(0);
  }

  #lc .menu .top,
  #lc .menu .down,
  #lc .box .top,
  #lc .box .down {
    display: none;
  }

  #menu,
  #lc .box .body {
    width: auto;
    background: none;
    padding: 0;
  }

  #menu li {
    margin: 0;
    border-bottom: 1px solid #e4edf4;
  }

  #menu li a {
    width: auto;
    border: 0;
    background: transparent;
    padding: 12px 14px;
  }

  #menu li a:hover {
    border: 0;
    background: #0072bc;
  }

  #lc .box {
    margin-top: 0;
    border-top: 1px solid #d7e6f0;
    padding: 10px 14px 18px 14px;
  }

  #lc .box .body table {
    display: table;
  }

  #text {
    float: none;
    width: auto;
    margin: 0;
    padding-top: 8px;
    clear: both;
  }

  #text h1 {
    margin-top: 0;
  }

  #text img,
  #text iframe {
    max-width: 100%;
    height: auto;
  }

  #text table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }

  #foot .copy {
    width: auto;
    padding: 8px 10px;
    line-height: 1.6;
  }
}

@media (max-width: 560px) {
  #mobileTopbar {
    height: 46px;
    padding: 3px 8px;
  }

  body {
    padding-top: 54px;
  }

  #mobileMenuToggle {
    padding: 7px 9px;
    font-size: 12px;
  }

  #mobileTopbarBrand {
    width: 92px;
    height: 30px;
  }

  #mobileTopbarActions a {
    padding: 5px 6px;
    font-size: 10px;
  }

  #mobileMenuBackdrop {
    inset: 46px 0 0 0;
  }

  #lc {
    top: 46px;
    height: calc(100vh - 46px);
  }
}
