/* Liovela B2B V57 - komentarz pod podsumowaniem + bezpieczne wyrównanie stopki
   Autor: Modyfikator stworzony przez gumis */

/* 1) Komentarz ma być POD tabelą, nie obok niej */
body.lv-b2b-checkout-page .lv-summary-wrap {
  display: block !important;
  grid-template-columns: none !important;
}

body.lv-b2b-checkout-page .lv-order-summary-box,
body.lv-b2b-checkout-page .lv-comment-box {
  width: 100% !important;
  max-width: 100% !important;
}

body.lv-b2b-checkout-page .lv-comment-box {
  margin-top: 26px !important;
  padding-top: 22px !important;
  border-top: 1px solid rgba(195, 180, 144, .45) !important;
}

body.lv-b2b-checkout-page .lv-comment-box h2,
body.lv-b2b-checkout-page .lv-comment-box h3 {
  margin-bottom: 10px !important;
}

body.lv-b2b-checkout-page .lv-comment-box textarea {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 118px !important;
  resize: vertical !important;
}

/* Przycisk zostaje na dole po prawej, już pod komentarzem */
body.lv-b2b-checkout-page .lv-submit-area {
  display: flex !important;
  justify-content: flex-end !important;
  margin-top: 20px !important;
}

/* 2) Tabela podsumowania ma dostać pełną szerokość sekcji */
body.lv-b2b-checkout-page .lv56-summary,
body.lv-b2b-checkout-page .lv56-table {
  width: 100% !important;
  max-width: 100% !important;
}

/* 3) Bezpieczne wyrównanie stopki/mapy po checkout.
   Nie rozwalamy całego layoutu, tylko porządkujemy footer na stronie checkout. */
body.lv-b2b-checkout-page footer,
body.lv-b2b-checkout-page #footer,
body.lv-b2b-checkout-page .footer,
body.lv-b2b-checkout-page .liovela-footer,
body.lv-b2b-checkout-page .b2b-footer {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  margin-left: auto !important;
  margin-right: auto !important;
  transform: none !important;
  left: auto !important;
  right: auto !important;
}

body.lv-b2b-checkout-page footer .container,
body.lv-b2b-checkout-page #footer .container,
body.lv-b2b-checkout-page .footer .container,
body.lv-b2b-checkout-page .liovela-footer .container,
body.lv-b2b-checkout-page .b2b-footer .container {
  width: calc(100vw - 80px) !important;
  max-width: 1560px !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
  box-sizing: border-box !important;
}

/* Jeżeli stopka jest na flex/grid z motywu, wyrównujemy elementy do góry */
body.lv-b2b-checkout-page footer .row,
body.lv-b2b-checkout-page #footer .row,
body.lv-b2b-checkout-page .footer .row,
body.lv-b2b-checkout-page .liovela-footer .row,
body.lv-b2b-checkout-page .b2b-footer .row {
  align-items: flex-start !important;
}

/* Mapa i miniatury w stopce nie mogą wychodzić poza kolumnę */
body.lv-b2b-checkout-page footer img,
body.lv-b2b-checkout-page #footer img,
body.lv-b2b-checkout-page .footer img,
body.lv-b2b-checkout-page .liovela-footer img,
body.lv-b2b-checkout-page .b2b-footer img,
body.lv-b2b-checkout-page footer iframe,
body.lv-b2b-checkout-page #footer iframe,
body.lv-b2b-checkout-page .footer iframe,
body.lv-b2b-checkout-page .liovela-footer iframe,
body.lv-b2b-checkout-page .b2b-footer iframe {
  max-width: 100% !important;
  height: auto !important;
}

/* Box mapy w stopce */
body.lv-b2b-checkout-page [class*="map"],
body.lv-b2b-checkout-page [id*="map"] {
  max-width: 100% !important;
}

/* Na mniejszych ekranach mniej bocznego marginesu */
@media (max-width: 991px) {
  body.lv-b2b-checkout-page footer .container,
  body.lv-b2b-checkout-page #footer .container,
  body.lv-b2b-checkout-page .footer .container,
  body.lv-b2b-checkout-page .liovela-footer .container,
  body.lv-b2b-checkout-page .b2b-footer .container {
    width: calc(100vw - 30px) !important;
  }
}

@media (max-width: 575px) {
  body.lv-b2b-checkout-page footer .container,
  body.lv-b2b-checkout-page #footer .container,
  body.lv-b2b-checkout-page .footer .container,
  body.lv-b2b-checkout-page .liovela-footer .container,
  body.lv-b2b-checkout-page .b2b-footer .container {
    width: calc(100vw - 16px) !important;
  }
}
