.brat-footer {
  --brat-footer-background: #25272d;
  --brat-footer-text: #d9d9d9;
  --brat-footer-muted: #b6b6B6;
  --brat-footer-border: #4b4d52;
  --brat-footer-accent: #ff100b;

  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  color: var(--brat-footer-text);
  background: var(--brat-footer-background);
  border: 0;
  font-size: 16px;
  line-height: 1.35;
  overflow: hidden;
}

.brat-footer *,
.brat-footer *::before,
.brat-footer *::after {
  box-sizing: border-box;
}

.brat-footer__container {
  width: 100%;
  max-width: 1720px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 14px;
  padding-left: 14px;
}

.brat-footer__main {
  padding: 32px 0 22px;
  background: var(--brat-footer-background);
}

.brat-footer__content,
.brat-footer__information,
.brat-footer__details,
.brat-footer__contacts,
.brat-footer__company,
.brat-footer__links,
.brat-footer__branding,
.brat-footer__main-logo,
.brat-footer__partner-logos,
.brat-footer__partner-logo,
.brat-footer__socials {
  min-width: 0;
}

.brat-footer a {
  color: var(--brat-footer-muted);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.18s ease;
}

.brat-footer a:hover,
.brat-footer a:focus-visible {
  color: var(--brat-footer-text);
  text-decoration: none;
  outline: none;
}

/* =========================================================
   KONTAKTY I DANE FIRMY
   ========================================================= */

.brat-footer__heading {
  margin: 0 0 3px;
  color: var(--brat-footer-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.brat-footer__contact {
  min-width: 0;
}

.brat-footer__contact + .brat-footer__contact {
  margin-top: 23px;
}

.brat-footer__line {
  display: flex;
  min-width: 0;
  margin: 2px 0;
  gap: 5px;
  align-items: center;
  color: var(--brat-footer-muted);
}

.brat-footer__line-icon {
  display: block;
  width: 15px;
  min-width: 15px;
  height: 15px;
  color: var(--brat-footer-text);
  fill: currentColor;
}

.brat-footer__line a,
.brat-footer__line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.brat-footer__address {
  margin: 0 0 22px;
  color: var(--brat-footer-muted);
  font-style: normal;
}

.brat-footer__company-name {
  display: inline;
  margin: 0;
  font-weight: 400;
  color: var(--brat-footer-muted);
}

.brat-footer__company-id {
  margin: 1px 0;
  color: var(--brat-footer-muted);
}

.brat-footer__company-id span {
  font-weight: 400;
}

/* =========================================================
   LINKI
   ========================================================= */

.brat-footer__links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.brat-footer__links li {
  margin: 0;
  padding: 0;
}

.brat-footer__links li + li {
  margin-top: 2px;
}

/* =========================================================
   GRAFIKI
   Reset zabezpiecza przed stylami motywu
   ========================================================= */

.brat-footer__main-logo,
.brat-footer__partner-logos,
.brat-footer__partner-logo {
  position: static;
  float: none;
  inset: auto;
  transform: none;
}

.brat-footer__main-logo a,
.brat-footer__partner-logo a {
  position: static;
  display: flex;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  transform: none;
}

.brat-footer__main-logo img,
.brat-footer__partner-logo img {
  position: static;
  display: block;
  float: none;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  padding: 0;
  object-fit: contain;
  object-position: center;
  transform: none;
}

/* =========================================================
   MEDIA SPOŁECZNOŚCIOWE
   ========================================================= */

.brat-footer__socials {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.brat-footer__social-link {
  display: inline-flex;
  width: 31px;
  min-width: 31px;
  height: 31px;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--brat-footer-text) !important;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.brat-footer__social-link:hover,
.brat-footer__social-link:focus-visible {
  color: var(--brat-footer-accent) !important;
  outline: none;
}

.brat-footer__social-svg,
.brat-footer__social-custom-icon {
  display: block;
  width: 31px;
  height: 31px;
  object-fit: contain;
  fill: currentColor;
}

/* =========================================================
   DOLNY PASEK
   ========================================================= */

.brat-footer__bottom {
  position: relative;
  color: var(--brat-footer-muted);
  background: var(--brat-footer-background);
  font-size: 11px;
  line-height: 16px;
}

.brat-footer__bottom-content {
  position: relative;
  display: flex;
  width: calc(100% - 10.5%);
  max-width: 1510px;
  min-height: 34px;
  margin: 0 auto;
  padding: 7px 15px 8px;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  border-top: 1px solid var(--brat-footer-border);
}

.brat-footer__bottom-content > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.brat-footer__bottom-content > div:first-child {
  text-align: left;
}

.brat-footer__bottom-content > div:last-child {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

/* =========================================================
   PRZYCISK POWROTU NA GÓRĘ
   ========================================================= */

.brat-footer__back-to-top {
  position: absolute;
  right: 26px;
  bottom: 24px;
  z-index: 5;
  display: inline-flex;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--brat-footer-background);
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  transition:
    color 0.18s ease,
    background-color 0.18s ease;
}

.brat-footer__back-to-top svg {
  display: block;
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.brat-footer__back-to-top:hover,
.brat-footer__back-to-top:focus-visible {
  color: #ffffff;
  background: var(--brat-footer-accent);
  outline: none;
}

/* =========================================================
   DESKTOP OD 1200 PX
   ========================================================= */

@media (min-width: 1200px) {
  .brat-footer__main {
    min-height: 410px;
  }

  .brat-footer__content {
    display: grid;
    grid-template-columns:
      minmax(380px, 1.8fr)
      minmax(570px, 3.2fr);
    column-gap: clamp(32px, 4vw, 76px);
    width: 100%;
    min-height: 350px;
    align-items: stretch;
  }

  /* Lewa część */

  .brat-footer__information {
    display: grid;
    grid-template-columns:
      minmax(0, 1.08fr)
      minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: clamp(22px, 2vw, 38px);
    width: 100%;
    min-height: 350px;
    align-items: start;
  }

  .brat-footer__contacts {
    grid-column: 1;
    grid-row: 1;
    padding-right: 4px;
  }

  /*
   * Spłaszczenie dotyczy wyłącznie tekstowych danych.
   * Sekcja graficzna nie korzysta z display: contents.
   */
  .brat-footer__details {
    display: contents;
  }

  .brat-footer__company {
    grid-column: 2;
    grid-row: 1 / span 2;
    padding-right: 4px;
  }

  .brat-footer__links {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    padding: 26px 4px 22px 0;
  }

  /* Prawa część */

  .brat-footer__branding {
    position: relative;
    display: grid;
    grid-template-columns:
      minmax(300px, 2fr)
      minmax(145px, 0.9fr)
      minmax(115px, 0.65fr);
    grid-template-rows:
      126px
      105px
      minmax(70px, 1fr);
    column-gap: clamp(18px, 2vw, 34px);
    row-gap: 17px;
    width: 100%;
    min-height: 350px;
    align-items: start;
  }

  /* Główne logo BRAT */

  .brat-footer__main-logo {
    position: relative;
    z-index: 1;
    grid-column: 1;
    grid-row: 1;
    display: flex;
    width: 100%;
    height: 126px;
    margin: 0;
    padding: 4px 20px 0;
    align-items: flex-start;
    justify-content: center;
  }

  .brat-footer__main-logo img {
    max-width: 430px;
    max-height: 318px;
  }

  /*
   * Kontener partnerów leży na tej samej siatce,
   * ale każdy obraz ma wyznaczone osobne pole.
   */
  .brat-footer__partner-logos {
    position: relative;
    z-index: 2;
    grid-column: 1 / span 2;
    grid-row: 1 / -1;
    display: grid;
    grid-template-columns:
      minmax(300px, 2fr)
      minmax(145px, 0.9fr);
    grid-template-rows:
      126px
      105px
      minmax(70px, auto);
    grid-auto-rows: minmax(65px, auto);
    column-gap: clamp(18px, 2vw, 34px);
    row-gap: 17px;
    width: 100%;
    min-height: 350px;
    pointer-events: none;
  }

  .brat-footer__partner-logo {
    display: flex;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
  }

  /* Dobra Firma SOS */

  .brat-footer__partner-logo:nth-child(1) {
    grid-column: 2;
    grid-row: 1;
    padding: 0 10px;
  }

  .brat-footer__partner-logo:nth-child(1) img {
    max-width: 150px;
    max-height: 122px;
  }

  /* Bydgoszcz Industrial Cluster */

  .brat-footer__partner-logo:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    padding: 0 20px;
  }

  .brat-footer__partner-logo:nth-child(2) img {
    max-width: 355px;
    max-height: 90px;
  }

  /* Dodatkowe logotypy, każdy w osobnej komórce */

  .brat-footer__partner-logo:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
  }

  .brat-footer__partner-logo:nth-child(4) {
    grid-column: 2;
    grid-row: 3;
  }

  .brat-footer__partner-logo:nth-child(5) {
    grid-column: 1;
    grid-row: 4;
  }

  .brat-footer__partner-logo:nth-child(6) {
    grid-column: 2;
    grid-row: 4;
  }

  .brat-footer__partner-logo:nth-child(7) {
    grid-column: 1;
    grid-row: 5;
  }

  .brat-footer__partner-logo:nth-child(8) {
    grid-column: 2;
    grid-row: 5;
  }

  .brat-footer__partner-logo:nth-child(n + 3) {
    padding: 6px 12px;
  }

  .brat-footer__partner-logo:nth-child(n + 3) img {
    max-width: 145px;
    max-height: 62px;
  }

  /* Social media */

  .brat-footer__socials {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    justify-self: center;
    margin-top: 43px;
  }
}

/* =========================================================
   TABLET 768-1199 PX
   ========================================================= */

@media (min-width: 768px) and (max-width: 1199.98px) {
  .brat-footer__main {
    min-height: 0;
    padding: 30px 0 28px;
  }

  .brat-footer__container {
    padding-right: 28px;
    padding-left: 28px;
  }

  .brat-footer__content {
    display: flex;
    width: 100%;
    gap: 38px;
    flex-direction: column;
  }

  .brat-footer__information {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    column-gap: 46px;
    row-gap: 28px;
    width: 100%;
  }

  .brat-footer__contacts {
    grid-column: 1;
    grid-row: 1;
  }

  .brat-footer__details {
    display: contents;
  }

  .brat-footer__company {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .brat-footer__links {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
  }

  .brat-footer__branding {
    display: grid;
    grid-template-columns:
      minmax(0, 1.6fr)
      minmax(180px, 0.8fr);
    grid-template-rows: auto auto;
    column-gap: 32px;
    row-gap: 30px;
    width: 100%;
    padding-top: 30px;
    align-items: center;
    border-top: 1px solid var(--brat-footer-border);
  }

  .brat-footer__main-logo {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    width: 100%;
    min-height: 105px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
  }

  .brat-footer__main-logo img {
    max-width: 400px;
    max-height: 405px;
  }

  .brat-footer__socials {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: center;
  }

  .brat-footer__partner-logos {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 34px;
    width: 100%;
    align-items: center;
    justify-items: center;
  }

  .brat-footer__partner-logo {
    display: flex;
    width: 100%;
    min-height: 90px;
    margin: 0;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
  }

  .brat-footer__partner-logo:nth-child(1) img {
    max-width: 150px;
    max-height: 120px;
  }

  .brat-footer__partner-logo:nth-child(2) img {
    max-width: 320px;
    max-height: 88px;
  }

  .brat-footer__partner-logo:nth-child(n + 3) img {
    max-width: 190px;
    max-height: 74px;
  }

  .brat-footer__bottom-content {
    width: calc(100% - 56px);
    max-width: none;
    padding-right: 62px;
    padding-left: 0;
  }

  .brat-footer__back-to-top {
    right: 28px;
    bottom: 18px;
  }
}

/* =========================================================
   TELEFONY DO 767 PX
   ========================================================= */

@media (max-width: 767.98px) {
  .brat-footer {
    font-size: 15px;
  }

  .brat-footer__container {
    width: 100%;
    max-width: none;
    padding-right: 18px;
    padding-left: 18px;
  }

  .brat-footer__main {
    min-height: 0;
    padding: 28px 0 30px;
  }

  .brat-footer__content,
  .brat-footer__information,
  .brat-footer__details,
  .brat-footer__branding,
  .brat-footer__contacts,
  .brat-footer__partner-logos {
    position: static;
    display: flex;
    width: 100%;
    min-width: 0;
    height: auto;
    margin: 0;
    padding-right: 0;
    padding-left: 0;
    flex-direction: column;
    transform: none;
  }

  .brat-footer__content {
    gap: 30px;
  }

  .brat-footer__information {
    gap: 28px;
  }

  .brat-footer__contacts {
    gap: 22px;
  }

  .brat-footer__contact,
  .brat-footer__company,
  .brat-footer__links {
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: center;
  }

  .brat-footer__contact + .brat-footer__contact {
    margin-top: 0;
  }

  .brat-footer__heading {
    margin-bottom: 5px;
    text-align: center;
  }

  .brat-footer__line {
    width: 100%;
    margin: 3px 0;
    justify-content: center;
  }

  .brat-footer__details {
    gap: 26px;
  }

  .brat-footer__address {
    margin-bottom: 16px;
  }

  .brat-footer__branding {
    gap: 28px;
    align-items: center;
    padding-top: 30px;
    text-align: center;
    border-top: 1px solid var(--brat-footer-border);
  }

  .brat-footer__main-logo,
  .brat-footer__partner-logo,
  .brat-footer__socials {
    position: static;
    display: flex;
    float: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    transform: none;
  }

  .brat-footer__main-logo {
    order: 1;
  }

  .brat-footer__main-logo img {
    max-width: min(280px, 82vw);
    max-height: 105px;
  }

  .brat-footer__partner-logos {
    order: 2;
    gap: 24px;
    align-items: center;
  }

  .brat-footer__partner-logo:nth-child(1) img {
    max-width: min(155px, 52vw);
    max-height: 120px;
  }

  .brat-footer__partner-logo:nth-child(2) img {
    max-width: min(280px, 82vw);
    max-height: 90px;
  }

  .brat-footer__partner-logo:nth-child(n + 3) img {
    max-width: min(220px, 72vw);
    max-height: 78px;
  }

  .brat-footer__socials {
    order: 3;
    gap: 14px;
    padding-top: 2px;
  }

  .brat-footer__bottom-content {
    display: flex;
    width: calc(100% - 36px);
    max-width: none;
    min-height: 90px;
    margin: 0 auto;
    padding: 12px 58px 14px 0;
    gap: 4px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
  }

  .brat-footer__bottom-content > div,
  .brat-footer__bottom-content > div:first-child,
  .brat-footer__bottom-content > div:last-child {
    width: 100%;
    margin: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .brat-footer__back-to-top {
    right: 18px;
    bottom: 18px;
    width: 42px;
    height: 42px;
  }

  .brat-footer__back-to-top svg {
    width: 24px;
    height: 24px;
  }
}

/* =========================================================
   BARDZO MAŁE TELEFONY
   ========================================================= */

@media (max-width: 420px) {
  .brat-footer__container {
    padding-right: 14px;
    padding-left: 14px;
  }

  .brat-footer__main-logo img {
    max-width: min(250px, 82vw);
    max-height: 95px;
  }

  .brat-footer__partner-logo:nth-child(1) img {
    max-width: min(145px, 52vw);
    max-height: 110px;
  }

  .brat-footer__partner-logo:nth-child(2) img {
    max-width: min(245px, 80vw);
    max-height: 78px;
  }

  .brat-footer__bottom-content {
    width: calc(100% - 28px);
    padding-right: 52px;
    font-size: 10px;
    line-height: 15px;
  }

  .brat-footer__back-to-top {
    right: 14px;
    width: 40px;
    height: 40px;
  }
}