/* Sam-Montuje checkout UX, 2026-10-31. */

/* Keep reopening consent in the footer; the consent dialog remains an overlay. */
.smcc-root:has(.smcc-reopen:not([hidden])) {
  position: static;
  inset: auto;
  display: flex;
  justify-content: center;
  padding: 16px;
}
.smcc-root .smcc-reopen {
  position: static;
  min-height: 44px;
  margin: 0;
}
.smcc-root .smcc-panel { z-index: 100000; }
body.modal-open .smwa-floating,
body.modal-open .pvcalc-fab { visibility: hidden; }

/* A static, compact checkout header cannot cover native validation targets. */
body:is(#checkout, #order-confirmation) #header,
body#order-confirmation #header {
  position: relative !important;
  top: auto !important;
}
body:is(#checkout, #order-confirmation) #header .header-top.sm-site-header,
body#order-confirmation #header .header-top.sm-site-header {
  position: static !important;
  animation: none !important;
  box-shadow: none;
}
body:is(#checkout, #order-confirmation) #header .sm-benefits,
body:is(#checkout, #order-confirmation) #header .sm-header-search,
body:is(#checkout, #order-confirmation) #header .sm-menu-toggle,
body:is(#checkout, #order-confirmation) #header .sm-account-action,
body:is(#checkout, #order-confirmation) #header .sm-list-action,
body#checkout #sm-category-menu,
body#checkout #wrapper > .breadcrumb,
body#checkout #sm-footer .smf-newsletter,
body#checkout .pvcalc-fab,
body#order-confirmation .pvcalc-fab { display: none !important; }
body:is(#checkout, #order-confirmation) #header .sm-header-main {
  grid-template-columns: minmax(120px, 1fr) 56px 68px;
  grid-template-areas: "logo help cart";
  min-height: 68px;
  padding-top: 8px;
  padding-bottom: 8px;
}
body:is(#checkout, #order-confirmation) #header .sm-help-action { display: flex; }
body#checkout #wrapper { padding-top: 16px; }
body#checkout .checkout-step,
body#checkout input,
body#checkout select,
body#checkout textarea { scroll-margin-top: 24px; }
body#checkout .smwa-floating,
body#order-confirmation .smwa-floating {
  position: static;
  width: auto;
  max-width: none;
  align-items: center;
  margin: 20px auto;
}
body#checkout .smwa-floating__copy,
body#checkout .smwa-floating__close,
body#order-confirmation .smwa-floating__copy,
body#order-confirmation .smwa-floating__close { display: none; }
body#checkout .smwa-floating__button span,
body#order-confirmation .smwa-floating__button span { display: inline; }

/* Keep thumbnails bounded in both final review and order confirmation. */
#order-items .order-line .image {
  display: block;
  width: 80px;
  max-width: 100%;
  margin: 0 auto;
}
#order-items .order-line .image img {
  width: 100%;
  height: 80px;
  object-fit: contain;
}
#order-items .order-line { margin-bottom: 16px; }
#order-items .order-confirmation-table { padding: 16px; }
#blockcart-modal .modal-dialog { max-height: calc(100vh - 24px); margin: 12px auto; }
#blockcart-modal .modal-content { max-height: calc(100vh - 24px); overflow-y: auto; }
#blockcart-modal .product-image { max-height: 160px; width: 100%; object-fit: contain; }
#blockcart-modal .cart-content-btn { display: flex; flex-wrap: wrap; gap: 8px; }
#blockcart-modal .cart-content .btn { margin: 0; min-height: 44px; white-space: normal; }

@media (max-width: 767px) {
  #blockcart-modal .modal-body { padding: 12px; }
  #blockcart-modal .product-image { max-height: 88px; max-width: 88px; margin-bottom: 8px; }
  #blockcart-modal .product-name { margin: 0 0 8px; font-size: 15px; }
  #blockcart-modal .cart-content-btn { flex-direction: column-reverse; }
  #blockcart-modal .cart-content-btn .btn { width: 100%; }
  #order-items > .row > ._desktop-title { display: none; }
  #order-items .order-line { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  #order-items .order-line > div { width: auto; padding: 0; }
  #order-items .order-line > .qty { grid-column: 1 / -1; }
  #order-items .order-line .image img { height: 72px; }
  #order-items .order-line .details { overflow-wrap: anywhere; }
  #order-items .order-line .qty > .row { display: flex; margin: 0; }
  #order-items .order-line .qty > .row > div { width: 33.333%; padding: 4px; }
  body#checkout #order-summary-content .order-confirmation-table { padding: 12px; }
  body#checkout .checkout-step .step-title { font-size: 18px; line-height: 1.4; }
  body#checkout section.checkout-step.-reachable.-complete h1 .step-edit { float: right; margin: 0; }
  body#checkout #payment-confirmation .btn { width: 100%; min-height: 48px; }
  body#product #wrapper > .breadcrumb { padding-top: 10px; padding-bottom: 10px; }
  body#product #wrapper > .breadcrumb ol { display: flex; overflow-x: auto; white-space: nowrap; }
  body#product .product-cover img { max-height: 240px; width: 100%; object-fit: contain; }
  .sm-search-results .sm-search-result__title { white-space: normal; }
}

.sm-account-option { border: 1px solid #dfe6e3; border-radius: 8px; padding: 12px; margin: 12px 0; }
.sm-account-option summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.sm-account-option[open] summary { margin-bottom: 12px; }
body#checkout .form-group label, body#checkout .custom-checkbox label { font-size: 14px; line-height: 1.6; }
.sm-stock-warning { scroll-margin-top: 200px; background: #fff4e5; color: #593611; border-left: 4px solid #bf7a12; padding: 12px; margin: 12px 0; font-size: 14px; }
.sm-stock-warning a { display: inline-block; text-decoration: underline; padding: 4px 0; }
.sm-stock-warning + .product-line-grid { border: 1px solid #bf7a12; padding: 12px; }
.sm-wire-title { font-size: 24px; line-height: 1.4; margin-bottom: 12px; }
.sm-wire-details { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 12px 20px; margin: 20px 0; }
.sm-wire-details dt, .sm-wire-details dd { margin: 0; padding: 0; width: auto; float: none; overflow-wrap: anywhere; }
.sm-wire-copy { margin: 6px 0 6px 12px; padding: 6px 12px; min-height: 40px; border: 1px solid #aeb9b5; border-radius: 6px; background: #fff; color: #17211f; font: inherit; font-size: 13px; cursor: pointer; }
.sm-copy-feedback { display: block; font-size: 13px; color: #176144; }
body#checkout #order-summary-content .card-block { padding: 12px; }
body#checkout .payment-option label { text-transform: none; }
body#checkout .btn, #blockcart-modal .btn, body#order-confirmation .btn { text-transform: none; }
body#checkout .smwa-floating__button, body#order-confirmation .smwa-floating__button { font-size: 14px; }
@media (max-width:767px) {
 .sm-wire-details { grid-template-columns: minmax(0, 1fr); gap: 4px; }
 .sm-wire-details dd { margin-bottom: 12px; }
 .sm-wire-copy { margin-left: 0; display: block; }
 .sm-wire-title { font-size: 21px; }
 #order-items .order-line .qty > .row > div::before { display: block; font-size: 11px; font-weight: 400; color: #5b625e; margin-bottom: 4px; }
 #order-items .order-line .qty > .row > div:nth-child(1)::before { content: 'Cena / szt.'; }
 #order-items .order-line .qty > .row > div:nth-child(2)::before { content: 'Ilość'; }
 #order-items .order-line .qty > .row > div:nth-child(3)::before { content: 'Wartość'; }
}

/* Reserve space for the close control and emphasize checkout. */
#blockcart-modal .modal-header { position: relative; padding: 16px 48px 16px 16px; }
#blockcart-modal .modal-header .close { position: absolute; top: 12px; right: 12px; margin: 0; }
#blockcart-modal .modal-title { line-height: 1.4; }
#blockcart-modal .cart-content-btn .btn-primary { background: #087c61; border-color: #087c61; color: #fff; }
#blockcart-modal .cart-content-btn .btn-secondary { background: #fff; border: 1px solid #8b9690; color: #25352c; }
body#product .sm-payment-methods img[alt="BLIK"] { display: none; }
body#product .sm-payment-methods::after { content: 'Dostępne metody wybierzesz podczas składania zamówienia.'; display: block; font-size: 13px; margin-top: 8px; }
@media (max-width: 767px) {
 #blockcart-modal .modal-dialog { width: calc(100% - 24px); max-width: calc(100% - 24px); }
 #blockcart-modal .modal-title { font-size: 15px; }
}
