/* Reguły z legacy: 9a392be8, 481084a0 i aktualny wcag.scss.
 * Źródło: ventispj/sidolux, origin/claude/vileda-sidolux-free-shipping-label-cda181.
 * Ścieżki grafik dostosowane do public/ Next.js. */

/* 4d1fa1d5: również natywne linki i hash przy otwarciu strony omijają nagłówek. */
html {
  scroll-behavior: smooth;
}

main [id] {
  scroll-margin-top: 130px;
}

body.basket main [id] {
  scroll-margin-top: 50px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* 35bc093c: stan wyznaczony też w SSR, zanim Header ustawi body.basket. */
body.basket header,
header.header--basket {
  position: static;
}

body.basket .site-container,
.site-container:has(> header.header--basket) {
  padding-top: 0;
}

@media (min-width: 992px) {
  .summary-container {
    top: 50px;
  }
}

/* newstyle.scss: wyszukiwarka jest osobnym elementem, prawa część nie ma 100% szerokości. */
@media (min-width: 768px) {
  header .header-flex-right {
    width: auto;
  }
}

@media (min-width: 992px) {
  header .header-flex-right {
    justify-content: end;
  }
}

/* Legacy używało id na div, Next ma dostępny link o tej samej klasie. */
.return-to-referer {
  margin-top: 20px;
  margin-bottom: 20px;
  cursor: pointer;
  display: inline-block;
  transition: all .5s;
  color: var(--contrast-yellow, #000);
  font-weight: 600;
}

.return-to-referer:hover {
  color: var(--contrast-yellow, #0a2479);
}

.checkout-option__hint {
  font-size: calc(.75rem * var(--font-size-scale));
  font-weight: normal;
  color: var(--contrast-yellow, #131313);
}

/* W checkout #summary jest jednocześnie wrapperem sticky. Obramowanie tylko raz. */
body.high-contrast .summary-container {
  border: 1px solid var(--contrast-yellow);
  border-radius: 0;
}

body.high-contrast .summary-container > #summary {
  border: 0;
}

/* oldstyle.scss: żółte wypełnienie pozostaje także po najechaniu i kliknięciu.
 * Po zmianie kroku kursor nadal może znajdować się nad tym samym przyciskiem. */
body.high-contrast #summary .goto-step,
body.high-contrast #order-button {
  background: var(--contrast-yellow) !important;
  color: var(--contrast-black) !important;
  text-shadow: none;
}

/* wcag.scss: obrys klawiatury musi wygrać z .btn:focus Bootstrapa. */
#summary .goto-step:focus-visible,
#order-button:focus-visible {
  outline: 3px solid red !important;
  outline-offset: 2px !important;
}

/* Zmienne formularzy i tooltipów nie mogą odziedziczyć żółtego na żółtym. */
body.high-contrast .radio > label.disabled > .radio-title {
  color: var(--contrast-yellow);
}

body.high-contrast #search input {
  background: var(--contrast-white) !important;
  color: var(--contrast-black) !important;
  border: 0 !important;
}

body.high-contrast #search input::placeholder {
  color: #555;
}

@media (max-width: 991px) {
  body.high-contrast .steps.steps--compact .no-gutters .step.active {
    background: none !important;
    color: var(--contrast-yellow) !important;
  }
}

section#main-products .main-product {
  height: 295px;
  position: relative;
  padding: 20px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #f6f6f6;
}

section#main-products .main-product h2 {
  font-size: calc(1.375rem*var(--font-size-scale));
  font-weight: 700;
  width: 50%;
  margin-top: 39px;
  color: var(--contrast-yellow, #1c1c1c);
}

section#main-products .main-product .price {
  position: absolute;
  bottom: 20px;
  left: 15px;
  font-size: calc(1.5rem*var(--font-size-scale));
  font-weight: 700;
}

section#main-products .main-product .product-label {
  top: 20px;
  left: 0;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

section#main-products .main-product .price .old-price {
  font-size: calc(0.9375rem*var(--font-size-scale));
  text-decoration: line-through;
}

section#main-products .main-product h2 {
  font-family: Lato,sans-serif;
  font-weight: bold;
}

section#main-products .main-product:not(.last) {
  margin-bottom: 20px;
}

.recommended-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 5px;
  margin: 0;
  font-size: calc(0.75rem*var(--font-size-scale));
  line-height: 1.3;
  color: var(--contrast-yellow, #545454);
}

.recommended-price__value {
  flex-shrink: 0;
  font-weight: bold;
  white-space: nowrap;
}

.recommended-price__label {
  letter-spacing: -0.04em;
}

.product-description .recommended-price {
  font-size: calc(0.8125rem*var(--font-size-scale));
  line-height: 1.42;
  color: var(--contrast-yellow, #131313);
}

.product-description .recommended-price__value {
  flex-shrink: 0;
  font-weight: bold;
  white-space: nowrap;
  font-size: calc(0.8125rem*var(--font-size-scale));
  color: var(--contrast-yellow, #131313);
}

.product-description .recommended-price__label {
  letter-spacing: -0.01em;
}

.products-list .product.product--reference-price {
  display: flex;
  flex-direction: column;
  height: auto !important;
  min-height: 430px;
  max-width: none;
  overflow: visible;
}

.product.product--reference-price .product-price-footer {
  margin-top: auto;
  padding-top: 15px;
}

.product.product--reference-price .product-price-footer .price-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  font-family: 'Bliss2-Regular', sans-serif;
}

.product.product--reference-price .product-price-footer .price,
.product.product--reference-price .product-price-footer .to-cart,
.product.product--reference-price .product-price-footer .unavailable {
  position: static;
}

.product.product--reference-price .product-price-footer .to-cart {
  flex-shrink: 0;
}

.product.product--reference-price .product-price-footer .product-loader {
  top: 0;
  right: 0;
  bottom: auto;
}

.product.product--reference-price .product-price-footer .additional-price-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.product.product--reference-price .product-price-footer .cheapest_product_price {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  font-size: calc(0.75rem*var(--font-size-scale));
  line-height: 1.3;
}

.product.product--reference-price .product-price-footer .recommended-price__label {
  font-size: calc(0.6875rem*var(--font-size-scale));
}

#product-full .product-price-box .recommended-price {
  margin: 15px 0;
}

#product-full .product-price-box .recommended-price__value {
  font-size: calc(0.9375rem*var(--font-size-scale));
}

section#main-products .main-product.main-product--reference-price {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 295px;
}

section#main-products .main-product-price-footer {
  position: relative;
  margin-top: auto;
  padding-top: 5px;
}

section#main-products .main-product-price-footer .price {
  position: static;
  padding-right: 60px;
  min-height: 50px;
  font-family: 'Bliss2-Regular', sans-serif;
}

section#main-products .main-product-price-footer .to-cart,
section#main-products .main-product-price-footer .product-loader {
  top: 0;
  right: 0;
  bottom: auto;
}

article.GA4ProductsDetails .product>.product-link,
section#main-products .main-product>.main-product-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: static;
  min-width: 0;
  z-index: auto;
}

article.GA4ProductsDetails .product>.product_add,
section#main-products .main-product>.product_add {
  position: relative;
  align-self: flex-end;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  margin-top: 8px;
  z-index: 1;
}

article.GA4ProductsDetails .product_add .to-cart {
  display: block;
  position: static;
}

article.GA4ProductsDetails .product_add .product-loader {
  top: 0;
  right: 0;
  bottom: auto;
  z-index: 2;
}

@supports (grid-template-rows: subgrid) {
  .products-list article.GA4ProductsDetails .product.product--reference-price {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto auto;
  }
  
  article.GA4ProductsDetails .product>.product-link {
    display: grid;
    grid-column: 1;
    grid-row: 1/6;
    grid-template-rows: subgrid;
  }
  
  article.GA4ProductsDetails .product-link>.image-mid-box {
    grid-row: 1;
  }
  
  article.GA4ProductsDetails .product-link>h3 {
    grid-row: 2;
  }
  
  article.GA4ProductsDetails .product-link>.option {
    grid-row: 3;
    align-self: start;
  }
  
  article.GA4ProductsDetails .product .product-price-footer {
    display: grid;
    grid-row: 4/6;
    grid-template-rows: subgrid;
    margin-top: 0;
  }
  
  article.GA4ProductsDetails .product:has(>.product_add) .price-container {
    padding-right: 60px;
  }
  
  article.GA4ProductsDetails .product>.product_add {
    grid-column: 1;
    grid-row: 4;
    align-self: center;
    justify-self: end;
    margin-top: 15px;
  }
  
  section#main-products .main-product.main-product--reference-price {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto auto;
  }
  
  section#main-products .main-product>.main-product-link {
    display: grid;
    grid-column: 1;
    grid-row: 1/4;
    grid-template-rows: subgrid;
  }
  
  section#main-products .main-product-link>h2 {
    grid-row: 1;
    align-self: start;
  }
  
  section#main-products .main-product-price-footer {
    display: grid;
    grid-row: 2/4;
    grid-template-rows: subgrid;
    margin-top: 0;
  }
  
  section#main-products .main-product>.product_add {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    justify-self: end;
    margin-top: 5px;
  }
}

.info-tip {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  --info-tip-size: calc(1rem * var(--font-size-scale));
}

@media (max-width: 991px) {
  .info-tip {
    --info-tip-size: calc(1.375rem * var(--font-size-scale));
  }
}

.info-tip img {
  width: var(--info-tip-size);
  height: var(--info-tip-size);
}

.info-tip .info-tip__btn {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
  cursor: pointer;
}

.high-contrast .info-tip .info-tip__btn {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='11' fill='%23ff0'/%3E%3Crect x='10' y='5.5' width='2' height='2.5' rx='.5'/%3E%3Crect x='10' y='9.5' width='2' height='7' rx='.5'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}

.high-contrast .info-tip .info-tip__btn img {
  visibility: hidden;
}

.info-tip .info-tip__bubble {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  left: -10px;
  width: max-content;
  max-width: 300px;
  padding: 12px 16px;
  background: var(--contrast-black, #eef0f0);
  border: 1px solid var(--contrast-yellow, #e1e1e1);
  border-radius: 4px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
  color: var(--contrast-yellow, #333);
  font-size: calc(0.75rem*var(--font-size-scale));
  line-height: 1.4;
  text-align: left;
  cursor: default;
}

@media (max-width: 991px) {
  .info-tip .info-tip__bubble {
    font-size: calc(0.8125rem*var(--font-size-scale));
  }
}

.info-tip .info-tip__bubble:before,
.info-tip .info-tip__bubble:after {
  content: "";
  position: absolute;
  border-style: solid;
  border-color: rgba(0,0,0,0);
}

.info-tip .info-tip__bubble:before {
  top: -7px;
  left: calc(var(--info-tip-size)/2 + 2px);
  border-width: 0 7px 7px;
  border-bottom-color: var(--contrast-yellow, #e1e1e1);
}

.info-tip .info-tip__bubble:after {
  top: -6px;
  left: calc(var(--info-tip-size)/2 + 3px);
  border-width: 0 6px 6px;
  border-bottom-color: var(--contrast-black, #eef0f0);
}

.info-tip.is-open .info-tip__bubble,
.info-tip .info-tip__btn:focus-visible+.info-tip__bubble {
  display: block;
}

@media (hover: hover) {
  .info-tip:hover .info-tip__bubble {
    display: block;
  }
}

@media (max-width: 767px) {
  .info-tip {
    position: static;
  }
  
  .info-tip .info-tip__bubble {
    left: 0;
    right: 0;
    top: 84%;
    width: auto;
    max-width: none;
  }
  
  .info-tip .info-tip__bubble:before {
    display: none;
  }
  
  .info-tip .info-tip__bubble:after {
    display: none;
  }
}

@media all and (max-width: 767px) {
  section#main-products .main-product {
    height: 265px;
  }
}

.user-is-tabbing a.product-link:focus-visible {
  outline-offset: 0;
  display: inline-block;
}

.high-contrast a.product-link:hover h3 {
  text-decoration: underline;
}

.high-contrast .npc-card {
  background-color: var(--contrast-black) !important;
  border: 1px solid var(--contrast-yellow) !important;
}

.high-contrast .npc-card * {
  color: var(--contrast-yellow) !important;
}

.high-contrast .npc-card a {
  text-decoration: underline !important;
}

.high-contrast .product .image-mid-box .image-mid {
  z-index: 0;
}

/* Uzupełnienia typografii i stanów błędów z aktualnego SCSS legacy. */

#product-full h1 {
  margin-top: 0;
  color: var(--contrast-yellow, #1c1c1c);
  font-size: calc(2.25rem*var(--font-size-scale));
  font-family: Lato,sans-serif;
  font-weight: bold;
  margin-bottom: 0;
}

#product-full h2 {
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--contrast-yellow, #1c1c1c);
  font-size: calc(1.75rem*var(--font-size-scale));
}

#product-full .product-description-full .img-box {
  margin-top: 16px;
}

/* Bootstrap legacy: wysokość informacji nad pełnym opisem produktu. */
#product-full .product-description {
  line-height: 1.42857143;
}

#product-full .product-description-full p,
#product-full .product-description-full span {
  color: inherit;
  font-family: inherit;
  line-height: 1.5;
}

.agreement-fields .required-fields-info {
  color: var(--contrast-yellow, #6B7280);
  margin-left: 30px;
  margin-bottom: 25px;
  margin-top: 20px;
}

.agreement-fields {
  font-weight: 400;
  font-size: calc(0.75rem*var(--font-size-scale));
  vertical-align: middle;
  color: var(--contrast-yellow, #555);
}

.agreement-fields label {
  font-weight: 400;
  font-size: calc(0.75rem*var(--font-size-scale));
  vertical-align: middle;
  color: var(--contrast-yellow, #555);
}

label.checkbox.error input[type=checkbox],
.checkbox input[type=checkbox][aria-invalid=true] {
  outline: 2px solid var(--contrast-yellow, #dc4c64);
  outline-offset: -2px;
}

.input-fields .form-group.error .error-description {
  padding-left: 10px;
}

.input-fields .form-group.error .error-description {
  color: var(--contrast-yellow, #DC4C64);
  font-size: 12px;
}

.form-group>.error {
  color: var(--contrast-yellow, #DC4C64);
}

.product-description-full .description-start h3 {
  font-size: calc(1.875rem*var(--font-size-scale));
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--contrast-yellow, #0a2479);
}

.product-description-full .description-section {
  margin-bottom: 28px;
}

.machine-error {
  color: var(--contrast-yellow, #DC4C64);
  font-size: .75rem;
}

.agreement-fields a:hover {
  text-decoration: underline !important;
}

/* newstyle.scss / oldstyle.scss: rozmiary, kolejność i etykiety formularza legacy. */
.checkout-address-form .order-as {
  margin-top: -15px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.checkout-address-form .order-as .radio-buttons {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.checkout-address-form .order-as .checked {
  font-weight: 600;
}

.checkout-address-form .checkout-address-fields .group-phone,
.checkout-address-form .checkout-address-fields .group-company,
.checkout-address-form #delivery-fields .group-deliveryCity {
  margin-bottom: 32px;
}

.checkout-address-form .checkout-address-country[hidden] {
  display: none !important;
}

.checkout-address-form .checkout-address-options {
  margin-top: 64px;
}

.checkout-address-form .checkout-address-options .form-group,
.checkout-address-form .checkout-address-options label.checkbox {
  margin-bottom: 0;
}

.checkout-address-form .checkout-address-notes-container {
  margin-top: 28px;
}

.checkout-address-form .checkout-address-agreements {
  max-width: none;
  margin-top: 36px;
}

.checkout-address-form .checkout-address-agreements .form-group {
  margin-bottom: 0;
}

.checkout-address-form .checkout-address-agreements .form-group + .form-group {
  margin-top: 15px;
}

.checkout-address-form .required-fields-info {
  margin-bottom: 25px;
}

.checkout-address-form .checkout-address-options label.checkbox {
  font-family: 'Bliss2-Regular', sans-serif;
  font-size: calc(.875rem * var(--font-size-scale));
  color: var(--contrast-yellow, #5e5e5e);
}

.checkout-address-form .checkout-address-notes > button,
.checkout-address-form .checkout-address-country button {
  color: var(--contrast-yellow, #374151);
  text-decoration: none;
}

.checkout-address-form .checkout-address-notes > button:hover {
  text-decoration: underline;
}

.checkout-address-input-label {
  display: block;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

/* newstyle.scss: etykieta przechodzi między tymi samymi wymiarami co w legacy. */
.checkout-address-input-caption {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  left: 0;
  bottom: 0;
  top: 0;
  margin: 3px 12px;
  transform: none;
  padding: 0;
  font-size: calc(.875rem * var(--font-size-scale));
  font-family: 'Bliss2-Regular', sans-serif;
  font-weight: 400;
  color: var(--contrast-black, #555);
  background-color: var(--contrast-yellow, white) !important;
  pointer-events: none;
  transition: all 200ms ease;
}

.checkout-address-input-label.has-value .checkout-address-input-caption,
.checkout-address-input-label:focus-within .checkout-address-input-caption,
.checkout-address-input-label:has(:is(input, textarea):autofill) .checkout-address-input-caption {
  align-items: flex-start;
  justify-content: flex-start;
  font-size: calc(.75rem * var(--font-size-scale));
  top: -.75rem;
  height: fit-content;
  padding-left: 4px;
  padding-right: 4px;
}

.checkout-address-input-label input.form-control:focus {
  border: 2px solid var(--contrast-yellow, #33841D) !important;
}

.checkout-address-input-label:not(:focus-within):not(.has-value) input::placeholder {
  color: transparent;
}

.checkout-address-country .country-select {
  height: 50px;
  min-height: 50px;
  font-family: 'Bliss2-Regular', sans-serif;
}

.checkout-address-notes .form-control {
  height: 48px;
  min-height: 48px;
}

.checkout-address-input-label .form-control {
  font-size: calc(1rem * var(--font-size-scale));
  padding: 6px 25px 6px 12px !important;
}

.checkout-address-form .checkout-address-input-label :is(select, textarea).form-control {
  color: var(--contrast-black, #555);
  border-color: var(--contrast-yellow, #D1D5DB);
  border-radius: 4px;
}

body.high-contrast .checkout-address-input-label .form-control,
body.high-contrast .checkout-address-notes .form-control {
  background: #fff !important;
  color: #000 !important;
}

@media (max-width: 575px) {
  .checkout-address-fields .group-zip,
  .checkout-address-fields .group-city,
  #delivery-fields .group-deliveryZip,
  #delivery-fields .group-deliveryCity {
    flex-basis: calc(50% - 6px);
  }
}

/* Tooltip produktu zachowuje paletę .tooltip-inner z wcag.scss. */
body.high-contrast .tooltip-trigger .tooltip-bubble {
  background-color: var(--contrast-black);
  color: var(--contrast-yellow);
  border-color: #cfd5d9;
}

@media (max-width: 767px) {
  /* Zamknięta wyszukiwarka nie może poszerzać dokumentu poza ekran telefonu. */
  header #search {
    left: 0;
  }

  /* Kontener main ma gutter 10px; bannery zajmują pełną szerokość jak w legacy. */
  body.basket section#bonuses:not(.home-bonuses) {
    width: calc(100% + 20px);
    max-width: none;
    flex-basis: calc(100% + 20px);
    margin-left: -10px;
    margin-right: -10px;
  }

  /* Stacktable legacy układa etykietę i wartość w dwóch równych kolumnach. */
  .checkout-flow #products-table tbody td:nth-child(3),
  .checkout-flow #products-table tbody td:nth-child(4) {
    width: 100%;
    min-height: 0;
    padding: 0 !important;
    margin-bottom: 0;
    justify-content: flex-start;
  }

  .checkout-flow #products-table tbody td:nth-child(3)::before,
  .checkout-flow #products-table tbody td:nth-child(4)::before {
    flex: 0 0 49%;
  }
}

/* Podsumowanie: zagnieżdżenie wiersza jak w module_template_32.podsumowanie.tpl. */
.checkout-flow #order-summary > .row {
  margin-left: -10px;
  margin-right: -10px;
}

.checkout-flow #order-summary > .row > [class*="col-"] {
  padding-left: 10px;
  padding-right: 10px;
}

.checkout-flow #products-table .name {
  font-size: calc(1rem * var(--font-size-scale));
}

/* newstyle.scss: podpis Zamawiam jako i oldstyle.scss: statyczny panel. */
.checkout-address-form .order-as .cart-header {
  display: inline-block;
  flex: 0 0 auto;
  font-size: calc(.93rem * var(--font-size-scale));
  font-weight: 600;
}

body.high-contrast .checkout-address-input-caption {
  color: var(--contrast-black) !important;
}

body.high-contrast #summary.summary-container {
  border-radius: 0;
}

/* Jak w legacy: na tablecie dymek dostawy otwiera się w lewo, w stronę środka ekranu. */
@media (min-width: 768px) and (max-width: 991px) {
  .box-delivery .info-tip .info-tip__bubble {
    left: auto;
    right: -10px;
  }

  .box-delivery .info-tip .info-tip__bubble:before {
    left: auto;
    right: calc(var(--info-tip-size) / 2 + 2px);
  }

  .box-delivery .info-tip .info-tip__bubble:after {
    left: auto;
    right: calc(var(--info-tip-size) / 2 + 3px);
  }
}

/* oldstyle.scss: na mobile/tablecie miejsce radia zajmuje 24 px, na desktopie 30 px. */
@media (max-width: 991px) {
  .box-payment .radio-buttons .radio label,
  .box-delivery .radio-buttons .radio label {
    padding-left: 24px;
  }

  /* Przezroczyste kroki odsłaniają linię łączącą koła także w wysokim kontraście. */
  body.high-contrast .steps.steps--compact .no-gutters .step {
    background: none !important;
  }
}
