/* Mobile layout shared by the OctoberCMS pages. Loaded after the legacy styles. */
@media (max-width: 767px) {
  html {
    background: #080808;
    overflow-x: clip;
    overscroll-behavior-y: none;
  }
  body.wrapper {
    background: #080808 !important;
    width: 100%;
    min-height: 100svh;
    overflow-x: clip;
    overscroll-behavior-x: none;
    overscroll-behavior-y: none;
  }
  body.wrapper main#panel {
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-x: clip;
  }
  body.wrapper main#panel p,
  body.wrapper main#panel h1,
  body.wrapper main#panel h2,
  body.wrapper main#panel h3,
  body.wrapper main#panel li {
    max-width: 100%;
    overflow-wrap: break-word;
  }
  body.wrapper main#panel .container,
  body.wrapper main#panel .container-fluid { max-width: 100%; }

  /* The Bootstrap collapse is the only mobile navigation. */
  body.wrapper nav.navbar.navbar-default,
  body.wrapper nav.navbar.navbar-default.fixed {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    width: 100% !important;
    height: var(--av-fixed-header-height, 70px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    box-sizing: border-box !important;
    background: linear-gradient(180deg, #14120e, #080808 90%) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    transform: none !important;
    transition: none !important;
  }
  body.wrapper nav.navbar.navbar-default .container-fluid { height: 100%; }
  body.wrapper nav.navbar.navbar-default .navbar-header {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
  }
  body.wrapper nav.navbar.navbar-default .navbar-toggle {
    position: absolute !important;
    top: 50% !important;
    right: calc(env(safe-area-inset-right, 0px) - 12px) !important;
    left: auto !important;
    z-index: 3 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: translateY(-50%) !important;
  }
  body.wrapper nav.navbar.navbar-default .navbar-toggle:hover,
  body.wrapper nav.navbar.navbar-default .navbar-toggle:focus {
    border: 0 !important;
    background: transparent !important;
    outline: none;
  }
  body.wrapper nav.navbar.navbar-default .navbar-toggle:focus-visible { outline: 1px solid #c5a76b !important; }
  body.wrapper nav.navbar.navbar-default .navbar-toggle .icon-bar {
    display: block !important;
    width: 26px !important;
    height: 2px !important;
    margin: 3px 0 !important;
    border-radius: 0 !important;
    background: #d8bc82 !important;
  }
  body.wrapper nav.navbar.navbar-default .navbar-collapse.collapsing,
  body.wrapper nav.navbar.navbar-default .navbar-collapse.collapse.in,
  body.wrapper nav.navbar.navbar-default #bs-example-navbar-collapse-1.collapsing,
  body.wrapper nav.navbar.navbar-default #bs-example-navbar-collapse-1.collapse.in {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: calc(100dvh - var(--av-fixed-header-height, 70px)) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 4px 0 8px !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(197, 167, 107, .55) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    background: #0c0c0b !important;
    box-shadow: 0 18px 35px rgba(0, 0, 0, .35) !important;
  }
  body.wrapper nav.navbar.navbar-default #bs-example-navbar-collapse-1.collapsing {
    animation: av-mobile-menu-down .32s ease-out both !important;
  }
  body.wrapper nav.navbar.navbar-default:has(.navbar-toggle[aria-expanded="false"]) #bs-example-navbar-collapse-1.collapsing {
    animation: av-mobile-menu-up .32s ease-in both !important;
  }
  body.wrapper nav.navbar.navbar-default .navbar-collapse .navbar-nav,
  body.wrapper nav.navbar.navbar-default .navbar-collapse .navbar-nav.navbar-right {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.wrapper nav.navbar.navbar-default .navbar-collapse .navbar-nav > li {
    width: 100% !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(197, 167, 107, .28) !important;
  }
  body.wrapper nav.navbar.navbar-default .navbar-collapse .navbar-nav > li > a {
    padding: 12px 20px !important;
    line-height: 1.35 !important;
  }
  body.page-aktualnosci main#panel .news-heading {
    min-height: 0 !important;
    padding: 25px 16px 18px !important;
  }
  body.page-aktualnosci main#panel .news-heading h1 {
    margin: 0 !important;
    font-size: clamp(35px, 10vw, 46px) !important;
    line-height: 1.1 !important;
  }
  body.wrapper #menu,
  body.wrapper .header-mobile { display: none !important; }

  /* Realization listing: one column and four non-overlapping rows. */
  body.page-realizacje .manufacturers-content { width: calc(100% - 28px) !important; }
  body.page-realizacje .manufacturer-item,
  body.page-realizacje .manufacturer-item:nth-child(even) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: clamp(210px, 62vw, 320px) auto auto auto !important;
    grid-auto-rows: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 20px 0 34px !important;
    overflow: hidden !important;
  }
  body.page-realizacje .manufacturer-item .manufacturer-item-img {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    background-position: center !important;
  }
  body.page-realizacje .manufacturer-item .manufacturer-item-brand,
  body.page-realizacje .manufacturer-item .manufacturer-item-brand-link { display: contents !important; }
  body.page-realizacje .manufacturer-item .title_real {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 24px 22px 8px !important;
    font-size: clamp(26px, 7vw, 34px) !important;
    overflow-wrap: break-word;
  }
  body.page-realizacje .manufacturer-item .manufacturer-item-text {
    grid-column: 1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    padding: 0 22px 16px !important;
  }
  body.page-realizacje .manufacturer-item .manufacturer-item-text p {
    font-size: 15px !important;
    line-height: 1.65 !important;
  }
  body.page-realizacje .manufacturer-item .manufacturer-item-text p:has(> br:only-child) { display: none !important; }
  body.page-realizacje .manufacturer-item .manufacturer-item-brand a.link {
    grid-column: 1 !important;
    grid-row: 4 !important;
    justify-self: start !important;
    width: auto !important;
    max-width: calc(100% - 44px) !important;
    height: auto !important;
    margin: 0 22px 24px !important;
    padding: 12px 16px !important;
  }
  html.has-layout-reveal body.page-realizacje .manufacturer-item.layout-reveal,
  html.has-layout-reveal body.page-realizacje .manufacturer-item .layout-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  body.page-realizacje ul.pagination { padding: 0 14px !important; }

  /* Project gallery: the image and its caption both fit the phone viewport. */
  body.page-realizacja .realization-showcase {
    height: calc(100svh - var(--av-fixed-header-height, 70px)) !important;
    min-height: 0 !important;
  }
  body.page-realizacja .realization-slide-caption,
  body.page-realizacja .realization-slide-caption-title {
    top: auto !important;
    right: 16px !important;
    bottom: 76px !important;
    left: 16px !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(44%, 340px) !important;
    padding: 17px 19px !important;
    overflow-y: auto !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(15, 15, 14, .88) !important;
  }
  body.page-realizacja .realization-slide-caption h1,
  body.page-realizacja .realization-slide-caption h2 { font-size: clamp(27px, 7vw, 36px) !important; }
  body.page-realizacja .realization-slide-copy p { font-size: 14px !important; line-height: 1.55 !important; }
  body.page-realizacja .realization-carousel-prev { left: 10px !important; }
  body.page-realizacja .realization-carousel-next { right: 10px !important; }
  body.page-realizacja .realization-carousel-arrow { top: 34% !important; }
  body.page-realizacja .realization-carousel-footer { bottom: 24px !important; }
  body.page-realizacja .control-dark-box .distributors > .row > div:last-child > .row {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
  }
  body.page-realizacja .control-dark-box .distributors ul,
  body.page-realizacja .control-dark-box .technologies ul {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* CMS text and images must stay within their cards. */
  body.page-firma .our-story-content .our-story-item { width: calc(100% - 28px) !important; }
  body.page-firma .our-story-item .our-story-text,
  body.page-rozwiazania .solution-category-copy,
  body.page-rozwiazania-indywidualne .manufacturer-item-white,
  body.page-rozwiazania-indywidualne .manufacturer-item-black,
  body.page-aktualnosci .news-item,
  body.page-aktualnosc .news-header-text,
  body.page-kontakt .av-contact-details { min-width: 0 !important; max-width: 100% !important; }
  body.page-firma .our-story-item .our-story-text { width: 100% !important; padding: 20px 4px !important; }
  body.page-rozwiazania .manufacturers-container .solution-category-copy,
  body.page-rozwiazania .manufacturers-container-black .solution-category-copy { padding: 24px 20px !important; }
  body.page-rozwiazania-indywidualne .manufacturer-item-white,
  body.page-rozwiazania-indywidualne .manufacturer-item-black { padding-right: 20px !important; padding-left: 20px !important; }
  body.wrapper main#panel .our-story-text img,
  body.wrapper main#panel .manufacturer-item-text img,
  body.wrapper main#panel .solution-category-copy img,
  body.wrapper main#panel .news-description img { max-width: 100% !important; height: auto !important; }

  .cookiesEU-inner { padding: 10px 38px 10px 12px !important; }
  .cookiesEU-inner .cookiesEU-text { padding-right: 0 !important; }
  .cookiesEU-inner p { margin: 0 !important; font-size: 12px !important; line-height: 1.35 !important; }
}

@keyframes av-mobile-menu-down {
  from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(-8px); }
  to { opacity: 1; clip-path: inset(0 0 0 0); transform: translateY(0); }
}
@keyframes av-mobile-menu-up {
  from { opacity: 1; clip-path: inset(0 0 0 0); transform: translateY(0); }
  to { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(-8px); }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  body.wrapper nav.navbar.navbar-default #bs-example-navbar-collapse-1.collapsing {
    animation: none !important;
  }
}
