/* MASTERBAR Product 0.2.0 – lekki układ inspirowany dobrymi praktykami dużych sklepów, bez zewnętrznych bibliotek. */
body.masterbar-product-active {
  --mbp-navy: var(--masterbar-color-primary, #143b5d);
  --mbp-accent: var(--masterbar-color-accent, #0b63ce);
  --mbp-border: #e2e7ec;
  --mbp-muted: #687482;
  --mbp-soft: #f6f8fa;
  --mbp-radius: 12px;
}

.masterbar-product-active .site-main,
.masterbar-product-active .ast-container,
.masterbar-product-active .site-content .ast-container {
  max-width: var(--masterbar-content-width, 1500px);
}

.masterbar-product-active .woocommerce-breadcrumb {
  margin: 22px 0 26px;
  color: var(--mbp-muted);
  font-size: 13px;
}

.masterbar-product-active div.product {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr);
  column-gap: clamp(34px, 5vw, 78px);
  align-items: start;
}

.masterbar-product-active div.product div.images,
.masterbar-product-active div.product div.summary {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
}

.masterbar-product-active div.product div.images {
  position: sticky;
  top: 118px;
  min-width: 0;
}

.masterbar-product-active div.product div.images .woocommerce-product-gallery__wrapper {
  background: #fff;
  border: 1px solid var(--mbp-border);
  border-radius: var(--mbp-radius);
  overflow: hidden;
}

.masterbar-product-active div.product div.images .woocommerce-product-gallery__image a {
  display: flex;
  min-height: 540px;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.masterbar-product-active div.product div.images img {
  width: 100%;
  height: auto;
  max-height: 610px;
  object-fit: contain;
}

.masterbar-product-active .flex-control-thumbs {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 10px;
  margin-top: 12px !important;
}
.masterbar-product-active .flex-control-thumbs li { width:auto !important; float:none !important; }
.masterbar-product-active .flex-control-thumbs img {
  border: 1px solid var(--mbp-border);
  border-radius: 8px;
  padding: 5px;
  aspect-ratio: 1;
  object-fit: contain;
  background:#fff;
}
.masterbar-product-active .flex-control-thumbs img.flex-active { border-color: var(--mbp-navy); }

.masterbar-product-active div.product div.summary {
  border: 1px solid var(--mbp-border);
  border-radius: var(--mbp-radius);
  background: #fff;
  padding: clamp(24px,3vw,38px);
  box-shadow: 0 8px 30px rgba(13,39,63,.05);
}

.masterbar-product-active .product_title {
  margin: 0 0 10px !important;
  font-size: clamp(26px,2.1vw,38px) !important;
  line-height: 1.16;
  letter-spacing: -.02em;
}
.masterbar-product-active .woocommerce-product-rating { margin: 0 0 14px !important; }
.masterbar-product-active .summary .price {
  margin: 14px 0 8px !important;
  font-size: clamp(27px,2.2vw,38px) !important;
  font-weight: 750;
  color: #101820;
}
.masterbar-product-active .summary .price del { font-size:.65em; color:#7a828a; font-weight:500; }
.masterbar-product-active .summary .price ins { text-decoration:none; }
.masterbar-product-active .stock {
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin: 5px 0 18px !important;
  padding: 7px 11px;
  border-radius:999px;
  background:#eef8f0;
  color:#287a3d !important;
  font-weight:650;
  font-size:13px;
}
.masterbar-product-active .stock::before { content:'●'; font-size:10px; }
.masterbar-product-active .out-of-stock { background:#fff1f1; color:#a32929 !important; }
.masterbar-product-active .woocommerce-product-details__short-description {
  margin: 18px 0;
  color:#3e4852;
  line-height:1.65;
}

.masterbar-product-active form.cart {
  display:flex;
  gap:12px;
  align-items:stretch;
  margin: 22px 0 !important;
  padding-top: 20px;
  border-top:1px solid var(--mbp-border);
}
.masterbar-product-active form.cart .quantity { margin:0 !important; }
.masterbar-product-active form.cart .qty {
  min-height:52px;
  width:78px;
  border:1px solid #cad2da;
  border-radius:8px;
}
.masterbar-product-active form.cart .single_add_to_cart_button {
  flex:1;
  min-height:52px;
  border-radius:8px !important;
  background:var(--mbp-navy) !important;
  font-size:16px !important;
  font-weight:700 !important;
  transition: transform .15s ease, filter .15s ease;
}
.masterbar-product-active form.cart .single_add_to_cart_button:hover { filter:brightness(.9); transform:translateY(-1px); }

.masterbar-product-active .product_meta {
  display:flex;
  flex-wrap:wrap;
  gap:8px 18px;
  margin-top:18px;
  padding-top:18px;
  border-top:1px solid var(--mbp-border);
  color:var(--mbp-muted);
  font-size:12px;
}
.masterbar-product-active .product_meta > span { display:block; }

.masterbar-product-active .woocommerce-tabs,
.masterbar-product-active .related,
.masterbar-product-active .up-sells,
.masterbar-product-active .mbp-benefits {
  grid-column:1 / -1;
}

.mbp-benefits {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin:42px 0 26px;
}
.mbp-benefit {
  display:flex;
  align-items:flex-start;
  gap:13px;
  min-height:92px;
  padding:17px 18px;
  border:1px solid var(--mbp-border);
  border-radius:10px;
  background:#fff;
}
.mbp-benefit__icon {
  display:flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  flex:0 0 38px;
  border-radius:9px;
  background:#eef3f7;
  color:var(--mbp-navy);
}
.mbp-benefit__icon svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.mbp-benefit__copy { display:flex; flex-direction:column; gap:3px; }
.mbp-benefit__copy strong { font-size:14px; }
.mbp-benefit__copy small { color:var(--mbp-muted); line-height:1.45; font-size:12px; }

.masterbar-product-active .woocommerce-tabs { margin-top:12px; }
.masterbar-product-active .woocommerce-tabs ul.tabs {
  display:flex;
  gap:26px;
  margin:0 !important;
  padding:0 !important;
  border-bottom:1px solid var(--mbp-border);
}
.masterbar-product-active .woocommerce-tabs ul.tabs::before { display:none !important; }
.masterbar-product-active .woocommerce-tabs ul.tabs li {
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  background:none !important;
}
.masterbar-product-active .woocommerce-tabs ul.tabs li::before,
.masterbar-product-active .woocommerce-tabs ul.tabs li::after { display:none !important; }
.masterbar-product-active .woocommerce-tabs ul.tabs li a {
  padding:14px 0 !important;
  font-size:15px;
  font-weight:650 !important;
  color:#45505a !important;
  border-bottom:3px solid transparent;
}
.masterbar-product-active .woocommerce-tabs ul.tabs li.active a { color:#101820 !important; border-bottom-color:var(--mbp-navy); }
.masterbar-product-active .woocommerce-Tabs-panel {
  margin:0 !important;
  padding:30px 0 18px !important;
  max-width:1080px;
  line-height:1.75;
}
.masterbar-product-active .woocommerce-Tabs-panel h2 { font-size:25px; margin-bottom:18px; }
.masterbar-product-active table.shop_attributes { border:1px solid var(--mbp-border); border-radius:10px; overflow:hidden; }
.masterbar-product-active table.shop_attributes th,
.masterbar-product-active table.shop_attributes td { padding:12px 14px !important; border-color:var(--mbp-border) !important; }

.masterbar-product-active .related,
.masterbar-product-active .up-sells { margin-top:44px; }
.masterbar-product-active .related > h2,
.masterbar-product-active .up-sells > h2 { font-size:27px; margin-bottom:22px; }
.masterbar-product-active .related ul.products,
.masterbar-product-active .up-sells ul.products {
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}
.masterbar-product-active .related ul.products li.product,
.masterbar-product-active .up-sells ul.products li.product {
  width:auto !important;
  margin:0 !important;
  padding:14px !important;
  border:1px solid var(--mbp-border);
  border-radius:10px;
  background:#fff;
}
.masterbar-product-active .related ul.products li.product img,
.masterbar-product-active .up-sells ul.products li.product img { aspect-ratio:1; object-fit:contain; }

.mbp-mobile-buy { display:none; }

@media (max-width: 900px) {
  body.masterbar-product-active { padding-bottom:0; }
  .masterbar-product-active div.product { grid-template-columns:1fr; gap:20px; }
  .masterbar-product-active div.product div.images { position:static; }
  .masterbar-product-active div.product div.images .woocommerce-product-gallery__image a { min-height:auto; padding:12px; }
  .masterbar-product-active div.product div.summary { padding:20px 16px; border-radius:10px; }
  .masterbar-product-active .product_title { font-size:25px !important; }
  .masterbar-product-active .summary .price { font-size:27px !important; }
  .mbp-benefits { grid-template-columns:1fr; margin-top:25px; }
  .masterbar-product-active .related ul.products,
  .masterbar-product-active .up-sells ul.products {
    display:flex !important;
    overflow-x:auto;
    gap:12px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding-bottom:4px;
  }
  .masterbar-product-active .related ul.products::-webkit-scrollbar,
  .masterbar-product-active .up-sells ul.products::-webkit-scrollbar { display:none; }
  .masterbar-product-active .related ul.products li.product,
  .masterbar-product-active .up-sells ul.products li.product {
    flex:0 0 72%;
    scroll-snap-align:start;
  }
  .masterbar-product-active .woocommerce-tabs ul.tabs { overflow-x:auto; white-space:nowrap; }
  .mbp-mobile-buy {
    position:fixed;
    left:0; right:0; bottom:0;
    z-index:9998;
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background:rgba(255,255,255,.97);
    border-top:1px solid var(--mbp-border);
    box-shadow:0 -8px 24px rgba(10,25,40,.09);
    transition:transform .2s ease;
  }
  .mbp-mobile-buy.is-hidden-near-cart { transform:translateY(120%); }
  .mbp-mobile-buy__price { flex:0 0 auto; font-size:17px; font-weight:750; }
  .mbp-mobile-buy__price del { font-size:12px; color:#7c858e; }
  .mbp-mobile-buy__price ins { text-decoration:none; }
  .mbp-mobile-buy__button { flex:1; min-height:48px; border-radius:8px !important; background:var(--mbp-navy) !important; color:#fff !important; font-weight:700 !important; }
}

@media (max-width: 520px) {
  .masterbar-product-active form.cart { gap:8px; }
  .masterbar-product-active form.cart .qty { width:62px; }
  .masterbar-product-active .flex-control-thumbs { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .masterbar-product-active .related ul.products li.product,
  .masterbar-product-active .up-sells ul.products li.product { flex-basis:78%; }
}

/* 0.2.0 – bardziej zwarta góra, poprawione korzyści i sterowanie ilością */
@media (min-width: 901px) {
  .masterbar-product-active div.product { grid-template-columns:minmax(0,1.18fr) minmax(350px,.82fr); column-gap:clamp(28px,4vw,58px); }
  .masterbar-product-active div.product div.images .woocommerce-product-gallery__image a { min-height:440px; padding:22px; }
  .masterbar-product-active div.product div.images img { max-height:500px; }
  .masterbar-product-active div.product div.summary { padding:28px 30px; }
  .masterbar-product-active .product_title { font-size:clamp(25px,1.8vw,34px) !important; }
  .masterbar-product-active .summary .price { font-size:clamp(27px,1.9vw,34px) !important; }
  .masterbar-product-active .related ul.products,
  .masterbar-product-active .up-sells ul.products { grid-template-columns:repeat(5,minmax(0,1fr)); }
}
.masterbar-product-active .mbp-benefits { position:relative; z-index:2; clear:both; width:100%; }
.masterbar-product-active form.cart .quantity { display:flex !important; align-items:stretch; border:1px solid #cad2da; border-radius:8px; overflow:hidden; background:#fff; }
.masterbar-product-active form.cart .qty { width:52px; min-height:52px; padding:0 4px !important; border:0 !important; border-radius:0 !important; text-align:center; box-shadow:none !important; -moz-appearance:textfield; }
.masterbar-product-active form.cart .qty::-webkit-outer-spin-button,
.masterbar-product-active form.cart .qty::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.masterbar-product-active .mbp-qty-btn { width:38px; min-width:38px; padding:0 !important; border:0 !important; background:#f5f7f9 !important; color:#172433 !important; font-size:21px !important; line-height:1 !important; cursor:pointer; }
.masterbar-product-active .mbp-qty-btn:hover { background:#e9eef2 !important; }
.masterbar-product-active .mbp-qty-minus { border-right:1px solid #e0e5ea !important; }
.masterbar-product-active .mbp-qty-plus { border-left:1px solid #e0e5ea !important; }
.masterbar-product-active .related ul.products li.product .button,
.masterbar-product-active .up-sells ul.products li.product .button { width:100%; text-align:center; border-radius:7px; background:var(--mbp-navy); }
.masterbar-product-active .related ul.products li.product .woocommerce-loop-product__title,
.masterbar-product-active .up-sells ul.products li.product .woocommerce-loop-product__title { min-height:3.3em; }
@media (max-width:900px) {
  .masterbar-product-active div.product div.images img { max-height:430px; }
  .masterbar-product-active .mbp-benefits { gap:10px; }
  .masterbar-product-active form.cart .quantity { flex:0 0 auto; }
  .masterbar-product-active .related ul.products li.product,
  .masterbar-product-active .up-sells ul.products li.product { flex-basis:68%; }
}
@media (max-width:520px) {
  .masterbar-product-active form.cart .qty { width:42px; }
  .masterbar-product-active .mbp-qty-btn { width:34px; min-width:34px; }
  .masterbar-product-active .related ul.products li.product,
  .masterbar-product-active .up-sells ul.products li.product { flex-basis:72%; }
}

/* 0.3.0 – rozbudowana karta */
.masterbar-product-active .mbp-premium{max-width:1180px;margin:54px auto;padding:0 18px;box-sizing:border-box}.masterbar-product-active .mbp-premium h2{font-size:26px;line-height:1.2;margin:0 0 22px}.mbp-highlights__grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.mbp-highlight{border:1px solid #e1e6ec;border-radius:10px;padding:18px;background:#fff;display:flex;align-items:center;gap:11px;min-height:68px}.mbp-highlight span{width:28px;height:28px;border-radius:50%;background:#eef5fb;color:#0d3d63;display:grid;place-items:center;font-weight:800;flex:0 0 auto}.mbp-story{display:flex;flex-direction:column;gap:28px}.mbp-story__row{display:grid;grid-template-columns:1.08fr .92fr;align-items:center;gap:46px;background:#f6f8fa;border-radius:14px;overflow:hidden}.mbp-story__row--reverse .mbp-story__media{order:2}.mbp-story__media img{display:block;width:100%;height:100%;min-height:340px;max-height:520px;object-fit:cover}.mbp-story__copy{padding:38px}.mbp-story__copy p{font-size:16px;line-height:1.75;margin:0 0 14px}.mbp-spec__table{border:1px solid #e1e6ec;border-radius:10px;overflow:hidden}.mbp-spec__row{display:grid;grid-template-columns:minmax(180px,34%) 1fr}.mbp-spec__row>div{padding:14px 18px;border-bottom:1px solid #e8ebef}.mbp-spec__row:last-child>div{border-bottom:0}.mbp-spec__row>div:first-child{font-weight:700;background:#f6f8fa}.mbp-spec__row:nth-child(even)>div:last-child{background:#fbfcfd}@media(max-width:768px){.masterbar-product-active .mbp-premium{margin:34px auto;padding:0 16px}.masterbar-product-active .mbp-premium h2{font-size:22px}.mbp-highlights__grid{grid-template-columns:1fr 1fr}.mbp-highlight{padding:13px;min-height:58px}.mbp-story__row{grid-template-columns:1fr;gap:0}.mbp-story__row--reverse .mbp-story__media{order:0}.mbp-story__media img{min-height:0;max-height:none;aspect-ratio:4/3}.mbp-story__copy{padding:24px 20px}.mbp-spec__row{grid-template-columns:42% 58%}.mbp-spec__row>div{padding:12px 11px;font-size:14px}}@media(max-width:420px){.mbp-highlights__grid{grid-template-columns:1fr}}

/* 0.3.1 – rozbudowany opis na pełnej szerokości produktu */
.masterbar-product-active .mbp-premium {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 1360px;
}

.masterbar-product-active .mbp-highlights {
  margin-top: 50px;
  margin-bottom: 42px;
}

.masterbar-product-active .mbp-story {
  gap: 44px;
  margin-top: 42px;
  margin-bottom: 58px;
}

.masterbar-product-active .mbp-story__row {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  min-height: 430px;
  border: 1px solid var(--mbp-border);
  background: #f7f9fb;
  box-shadow: 0 10px 32px rgba(13,39,63,.035);
}

.masterbar-product-active .mbp-story__media {
  min-width: 0;
  height: 100%;
  background: #fff;
}

.masterbar-product-active .mbp-story__media img {
  width: 100%;
  height: 100%;
  min-height: 430px;
  max-height: 620px;
  object-fit: cover;
}

.masterbar-product-active .mbp-story__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(34px, 4vw, 64px);
}

.masterbar-product-active .mbp-story__copy h2 {
  font-size: clamp(28px, 2.2vw, 38px);
  margin-bottom: 20px;
}

.masterbar-product-active .mbp-story__copy p {
  max-width: 620px;
  font-size: 17px;
  line-height: 1.8;
  color: #35414c;
}

.masterbar-product-active .mbp-spec {
  max-width: 1180px;
  margin-top: 58px;
  margin-bottom: 62px;
}

.masterbar-product-active .mbp-spec__table {
  width: 100%;
  font-size: 15px;
}

.masterbar-product-active .mbp-spec__row {
  grid-template-columns: minmax(220px, 32%) 1fr;
}

.masterbar-product-active .mbp-spec__row > div {
  padding: 16px 20px;
}

@media (max-width: 900px) {
  .masterbar-product-active .mbp-premium {
    grid-column: 1;
    max-width: 100%;
  }

  .masterbar-product-active .mbp-story {
    gap: 24px;
    margin-top: 30px;
    margin-bottom: 40px;
  }

  .masterbar-product-active .mbp-story__row {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .masterbar-product-active .mbp-story__row--reverse .mbp-story__media {
    order: 0;
  }

  .masterbar-product-active .mbp-story__media,
  .masterbar-product-active .mbp-story__media img {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .masterbar-product-active .mbp-story__media img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .masterbar-product-active .mbp-story__copy {
    padding: 26px 22px 30px;
  }

  .masterbar-product-active .mbp-story__copy h2 {
    font-size: 25px;
  }

  .masterbar-product-active .mbp-story__copy p {
    font-size: 16px;
    line-height: 1.7;
  }

  .masterbar-product-active .mbp-spec {
    margin-top: 38px;
    margin-bottom: 44px;
  }
}

@media (max-width: 520px) {
  .masterbar-product-active .mbp-story__copy {
    padding: 22px 18px 26px;
  }

  .masterbar-product-active .mbp-story__copy h2 {
    font-size: 23px;
  }

  .masterbar-product-active .mbp-spec__row {
    grid-template-columns: 40% 60%;
  }

  .masterbar-product-active .mbp-spec__row > div {
    padding: 12px 10px;
    font-size: 13px;
  }
}

/* 0.3.2 – mobile: pokazuj całe zdjęcie sekcji bez kadrowania */
@media (max-width: 900px) {
  .masterbar-product-active .mbp-story__media {
    display: block;
    height: auto;
    min-height: 0;
    overflow: hidden;
    background: #fff;
  }

  .masterbar-product-active .mbp-story__media img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
  }
}

/* 0.3.3 – iOS/mobile overflow fix: strona produktu nie może poszerzać viewportu */
@media (max-width: 900px) {
  body.masterbar-product-active {
    overflow-x: clip;
    max-width: 100%;
  }

  .masterbar-product-active #page,
  .masterbar-product-active .site,
  .masterbar-product-active .site-content,
  .masterbar-product-active .site-main,
  .masterbar-product-active .ast-container,
  .masterbar-product-active .site-content .ast-container,
  .masterbar-product-active .woocommerce,
  .masterbar-product-active div.product,
  .masterbar-product-active div.product > *,
  .masterbar-product-active div.product div.images,
  .masterbar-product-active div.product div.summary,
  .masterbar-product-active .woocommerce-tabs,
  .masterbar-product-active .woocommerce-Tabs-panel,
  .masterbar-product-active .mbp-benefits,
  .masterbar-product-active .mbp-premium,
  .masterbar-product-active .mbp-story,
  .masterbar-product-active .mbp-story__row,
  .masterbar-product-active .mbp-story__media,
  .masterbar-product-active .mbp-story__copy,
  .masterbar-product-active .mbp-spec,
  .masterbar-product-active .related,
  .masterbar-product-active .up-sells {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .masterbar-product-active img,
  .masterbar-product-active svg,
  .masterbar-product-active video,
  .masterbar-product-active iframe {
    max-width: 100% !important;
  }

  /* Zakładki mogą przewijać się wewnątrz, ale nie poszerzają całej strony. */
  .masterbar-product-active .woocommerce-tabs ul.tabs {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overscroll-behavior-x: contain;
  }

  /* Karuzela produktów przewija się wyłącznie we własnym obszarze. */
  .masterbar-product-active .related ul.products,
  .masterbar-product-active .up-sells ul.products {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overscroll-behavior-x: contain;
  }

  /* Sticky CTA nie może zwiększać szerokości viewportu na Safari/iPhone. */
  .masterbar-product-active .mbp-mobile-buy {
    width: auto;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden;
  }

  .masterbar-product-active .mbp-mobile-buy__price,
  .masterbar-product-active .mbp-mobile-buy__button {
    min-width: 0;
  }
}

/* Fallback dla przeglądarek bez overflow: clip. */
@supports not (overflow: clip) {
  @media (max-width: 900px) {
    body.masterbar-product-active { overflow-x: hidden; }
  }
}


/* 0.3.5 – galeria: lista miniaturek ma być normalnym elementem układu. */
.masterbar-product-active div.product div.images .flex-control-thumbs {
  position: static !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  float: none !important;
  clear: both !important;
  width: 100% !important;
  height: auto !important;
  box-sizing: border-box !important;
  z-index: auto !important;
}

/* Rezerwa wysokości jest ustawiana także przez JS po inicjalizacji FlexSlidera.
   To rozwiązuje przypadek, gdy motyw/WooCommerce liczy wysokość galerii bez miniaturek. */
.masterbar-product-active div.product div.images {
  box-sizing: border-box !important;
}

@media (max-width: 900px) {
  .masterbar-product-active div.product div.images .flex-control-thumbs {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0 6px !important;
  }

  .masterbar-product-active div.product div.images .flex-control-thumbs::-webkit-scrollbar {
    display: none;
  }

  .masterbar-product-active div.product div.images .flex-control-thumbs li {
    flex: 0 0 72px !important;
    width: 72px !important;
  }

  .masterbar-product-active div.product div.images .flex-control-thumbs img {
    width: 72px !important;
    height: 72px !important;
    object-fit: contain !important;
  }
}


/* 0.3.6 – właściwa przyczyna problemu galerii.
   Galeria była position:sticky z top:118px. Podczas przewijania zatrzymywała się
   niżej od prawej kolumny i mogła wizualnie nachodzić na kolejne pełnoszerokie sekcje.
   W MASTERBAR Product obie kolumny mają pozostać w normalnym przepływie dokumentu. */
.masterbar-product-active div.product div.images,
.masterbar-product-active .woocommerce-product-gallery {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  align-self: start !important;
  margin-top: 0 !important;
  transform: none !important;
}

/* Miniatury pozostają bezpośrednio pod głównym zdjęciem i są częścią wysokości galerii. */
.masterbar-product-active div.product div.images .flex-control-thumbs {
  position: static !important;
  clear: both !important;
  margin-top: 12px !important;
  margin-bottom: 0 !important;
}

/* Nie wymuszamy sztucznej min-height z poprzedniego obejścia. */
.masterbar-product-active div.product div.images {
  min-height: 0 !important;
}


/* 0.3.9 – adaptacyjny dół mobilnego CTA.
   Domyślnie wszystkie przeglądarki mają tylko mały odstęp.
   Dodatkowe podniesienie stosujemy wyłącznie na iOS Safari, gdzie dolny pasek przeglądarki
   może zasłaniać obszar strony. */
@media (max-width: 900px) {
  .masterbar-product-active .mbp-mobile-buy {
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    padding-bottom: 10px !important;
  }

  .masterbar-product-active .mbp-mobile-buy.is-hidden-near-cart {
    transform: translateY(calc(120% + 24px));
  }

  html.mbp-ios-safari .masterbar-product-active .mbp-mobile-buy {
    bottom: max(54px, calc(env(safe-area-inset-bottom) + 18px)) !important;
  }

  html.mbp-ios-safari .masterbar-product-active .mbp-mobile-buy.is-hidden-near-cart {
    transform: translateY(calc(120% + 70px));
  }
}


/* 0.4.0 – mobile CTA ponownie przy samej dolnej krawędzi.
   Usuwamy specjalne podnoszenie dla Safari z 0.3.9.
   Safe-area jest obsługiwana wewnętrznym paddingiem, a nie odsuwaniem całego paska. */
@media (max-width: 900px) {
  .masterbar-product-active .mbp-mobile-buy,
  html.mbp-ios-safari .masterbar-product-active .mbp-mobile-buy {
    bottom: 0 !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }

  .masterbar-product-active .mbp-mobile-buy.is-hidden-near-cart,
  html.mbp-ios-safari .masterbar-product-active .mbp-mobile-buy.is-hidden-near-cart {
    transform: translateY(120%) !important;
  }

  /* Astra: przy stałym pasku zakupu przycisk "wróć do góry" jest zbędny
     i może nachodzić na CTA. Ukrywamy go wyłącznie na telefonach/tabletach. */
  #ast-scroll-top,
  .ast-scroll-top-icon,
  .ast-scroll-to-top-right,
  .ast-scroll-to-top-left,
  [class*="ast-scroll-top"] {
    display: none !important;
  }
}

/* 0.4.1 – bestsellery bieżącej kategorii */
@media (min-width: 901px) {
  .masterbar-product-active .mbp-category-bestsellers ul.products {
    grid-template-columns: repeat(var(--mbp-related-columns, 5), minmax(0, 1fr));
  }
}


/* 0.4.2 – mobile bez dolnego sticky CTA.
   Pasek nie zajmuje miejsca, a strzałka Astry pozostaje widoczna. */
@media (max-width: 900px) {
  body.masterbar-product-active { padding-bottom: 0 !important; }
  .masterbar-product-active .mbp-mobile-buy { display: none !important; }
  #ast-scroll-top,
  .ast-scroll-top-icon,
  .ast-scroll-to-top-right,
  .ast-scroll-to-top-left,
  [class*="ast-scroll-top"] {
    display: flex !important;
  }
}

/* ==========================================================
   MASTERBAR Product 0.4.3 – dyskretna mobilna strzałka powrotu do zakupu
   ========================================================== */
@media (max-width: 900px) {
  #ast-scroll-top,
  .ast-scroll-to-top-right,
  .ast-scroll-to-top-left,
  [class*="ast-scroll-top"] {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    right: 16px !important;
    left: auto !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
    padding: 0 !important;
    border: 1px solid rgba(19, 58, 92, .22) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .96) !important;
    color: var(--masterbar-primary, #133a5c) !important;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .14) !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #ast-scroll-top svg,
  #ast-scroll-top .ast-icon,
  .ast-scroll-top-icon svg,
  [class*="ast-scroll-top"] svg {
    width: 19px !important;
    height: 19px !important;
    fill: currentColor !important;
    color: currentColor !important;
  }
}


/* ==========================================================
   MASTERBAR Product 0.4.4 – SLIM PRODUCT / lekkie informacje zakupowe
   ========================================================== */
.masterbar-product-active .mbp-benefits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 !important;
  margin: 14px 0 0 !important;
  border-top: 1px solid var(--mbp-border);
  border-bottom: 1px solid var(--mbp-border);
  background: transparent !important;
}
.masterbar-product-active .mbp-benefit {
  min-height: 0 !important;
  padding: 11px 2px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--mbp-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: grid !important;
  grid-template-columns: 30px minmax(0,1fr);
  align-items: center;
  gap: 10px !important;
}
.masterbar-product-active .mbp-benefit:last-child { border-bottom: 0 !important; }
.masterbar-product-active .mbp-benefit__icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  background: #f3f7fa !important;
  color: var(--mbp-navy) !important;
}
.masterbar-product-active .mbp-benefit__icon svg { width: 16px !important; height: 16px !important; }
.masterbar-product-active .mbp-benefit__copy { gap: 1px !important; min-width:0; }
.masterbar-product-active .mbp-benefit__copy strong { font-size: 13px !important; line-height: 1.25 !important; }
.masterbar-product-active .mbp-benefit__copy small { font-size: 11px !important; line-height: 1.35 !important; }

@media (max-width: 900px) {
  /* Zwarta prawa część produktu – ta sama lekka hierarchia co nowe menu mobile. */
  .masterbar-product-active div.product { gap: 12px !important; }
  .masterbar-product-active div.product div.summary {
    padding: 16px 14px !important;
    border-radius: 9px !important;
  }
  .masterbar-product-active .product_title {
    font-size: 21px !important;
    line-height: 1.18 !important;
    margin-bottom: 10px !important;
  }
  .masterbar-product-active .summary .price {
    font-size: 24px !important;
    line-height: 1.1 !important;
    margin: 12px 0 !important;
  }
  .masterbar-product-active form.cart {
    gap: 8px !important;
    padding-top: 14px !important;
    margin-top: 14px !important;
  }
  .masterbar-product-active form.cart .quantity { border-radius: 7px !important; }
  .masterbar-product-active form.cart .qty { min-height: 46px !important; width: 38px !important; }
  .masterbar-product-active .mbp-qty-btn { width: 32px !important; min-width: 32px !important; font-size: 19px !important; }
  .masterbar-product-active form.cart .single_add_to_cart_button {
    min-height: 46px !important;
    border-radius: 7px !important;
    font-size: 15px !important;
  }
  .masterbar-product-active .mbp-benefits { margin-top: 12px !important; }
  .masterbar-product-active .mbp-benefit { padding: 9px 0 !important; grid-template-columns: 27px minmax(0,1fr); gap: 9px !important; }
  .masterbar-product-active .mbp-benefit__icon { width: 25px !important; height: 25px !important; border-radius: 7px !important; }
  .masterbar-product-active .mbp-benefit__icon svg { width: 14px !important; height: 14px !important; }
  .masterbar-product-active .mbp-benefit__copy strong { font-size: 12px !important; }
  .masterbar-product-active .mbp-benefit__copy small { font-size: 10.5px !important; }
  .masterbar-product-active .product_meta {
    gap: 5px 12px !important;
    margin-top: 13px !important;
    padding-top: 13px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
  }
  .masterbar-product-active div.product div.images .flex-control-thumbs { margin-top: 8px !important; }
}


/* ==========================================================
   MASTERBAR Product 0.4.5 – MODERN 7
   Lżejsza karta produktu: mniej ramek, mniej „klocków”, mocniejszy produkt.
   ========================================================== */
.masterbar-product-active .mbp-benefits { display:none !important; }

/* Główna karta: zamiast ciężkiego pudełka – czysta kolumna zakupowa. */
.masterbar-product-active div.product div.summary {
  border: 0 !important;
  border-radius: 0 !important;
  padding: 8px 0 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.masterbar-product-active .woocommerce-breadcrumb {
  margin: 10px 0 16px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.masterbar-product-active .product_title {
  font-size: clamp(24px,1.65vw,31px) !important;
  line-height: 1.14 !important;
  letter-spacing: -.025em !important;
  margin-bottom: 8px !important;
}
.masterbar-product-active .summary .price {
  font-size: clamp(27px,1.8vw,34px) !important;
  margin: 12px 0 7px !important;
}
.masterbar-product-active .stock {
  margin: 3px 0 12px !important;
  padding: 5px 9px !important;
  font-size: 12px !important;
}
.masterbar-product-active .woocommerce-product-details__short-description {
  margin: 12px 0 14px !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}
.masterbar-product-active form.cart {
  margin: 16px 0 12px !important;
  padding-top: 16px !important;
}
.masterbar-product-active .product_meta {
  margin-top: 12px !important;
  padding-top: 12px !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
}
/* Galeria też delikatniejsza. */
.masterbar-product-active div.product div.images .woocommerce-product-gallery__wrapper {
  border-color: #edf0f3 !important;
  border-radius: 10px !important;
}
.masterbar-product-active .flex-control-thumbs img {
  border-color: #edf0f3 !important;
  border-radius: 7px !important;
}
.masterbar-product-active .flex-control-thumbs img.flex-active {
  border-color: var(--mbp-navy) !important;
  box-shadow: inset 0 0 0 1px var(--mbp-navy);
}

@media (min-width: 901px) {
  .masterbar-product-active div.product {
    grid-template-columns: minmax(0,1.22fr) minmax(330px,.78fr) !important;
    column-gap: clamp(38px,5vw,76px) !important;
  }
  .masterbar-product-active div.product div.images .woocommerce-product-gallery__image a {
    min-height: 470px !important;
    padding: 18px !important;
  }
  .masterbar-product-active div.product div.images img { max-height: 540px !important; }
}

@media (max-width: 900px) {
  .masterbar-product-active .woocommerce-breadcrumb {
    margin: 8px 0 10px !important;
    font-size: 11px !important;
  }
  .masterbar-product-active div.product { gap: 10px !important; }
  .masterbar-product-active div.product div.summary {
    padding: 4px 14px 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  .masterbar-product-active .product_title {
    font-size: 20px !important;
    line-height: 1.16 !important;
    margin-bottom: 7px !important;
  }
  .masterbar-product-active .summary .price {
    font-size: 25px !important;
    margin: 10px 0 6px !important;
  }
  .masterbar-product-active .stock {
    margin-bottom: 10px !important;
    padding: 5px 9px !important;
  }
  .masterbar-product-active form.cart {
    margin: 13px 0 10px !important;
    padding-top: 13px !important;
  }
  .masterbar-product-active .product_meta {
    margin-top: 10px !important;
    padding-top: 10px !important;
  }
  .masterbar-product-active div.product div.images .woocommerce-product-gallery__wrapper {
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
  }
}


/* ==========================================================
   MASTERBAR Product 0.4.7 – OWNERSHIP FIX
   Product owns the single-product presentation. Keep Woo meta light and
   keep the navigation path compact without depending on MASTERBAR UI CSS.
   ========================================================== */
.masterbar-product-active .product_meta .posted_in,
.masterbar-product-active .product_meta .tagged_as {
  display: none !important;
}

.masterbar-product-active .mbp-product-path {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin: 0 0 10px !important;
  white-space: nowrap;
  overflow: hidden;
  color: #667085;
  font-size: 11px;
  line-height: 1.35;
}
.masterbar-product-active .mbp-product-path__label {
  flex: 0 0 auto;
  color: #667085;
  font-weight: 500;
}
.masterbar-product-active .mbp-product-path__links {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.masterbar-product-active .mbp-product-path a {
  color: #0b6fd3;
  text-decoration: none;
  font-weight: 500;
}
.masterbar-product-active .mbp-product-path__sep {
  margin: 0 2px;
  color: #98a2b3;
}
.masterbar-product-active .product_meta > span {
  margin-bottom: 4px !important;
}

/* MASTERBAR UI used to inject its own mobile path. If an old cached copy
   survives for a request, it must never duplicate the Product path. */
.masterbar-product-active .masterbar-mobile-product-path,
.masterbar-product-active .masterbar-product-tiles {
  display: none !important;
}

@media (max-width: 900px) {
  .masterbar-product-active .mbp-product-path {
    margin-bottom: 8px !important;
    font-size: 10.5px;
  }
}

/* ==========================================================
   MASTERBAR Product 0.4.8 – PURCHASE PANEL POLISH
   Delikatniejsza ścieżka, spokojniejsze SKU i ciaśniejszy blok zakupu.
   Zestawy promocyjne pozostają bez zmian.
   ========================================================== */
.masterbar-product-active .mbp-product-path {
  margin: 0 0 8px !important;
  gap: 5px;
  color: #98a2b3;
  font-size: 10.5px;
  font-weight: 400;
}
.masterbar-product-active .mbp-product-path__label {
  color: #98a2b3;
  font-weight: 400;
}
.masterbar-product-active .mbp-product-path a {
  color: #667085;
  font-weight: 500;
}
.masterbar-product-active .mbp-product-path a:hover {
  color: var(--mbp-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.masterbar-product-active .mbp-product-path__sep {
  margin: 0 1px;
  color: #c2c8d0;
}

/* Zakup: cena -> dostępność -> ilość/CTA tworzą jeden zwarty blok. */
.masterbar-product-active .summary .price {
  margin: 10px 0 5px !important;
}
.masterbar-product-active .stock {
  margin: 2px 0 9px !important;
}
.masterbar-product-active form.cart {
  margin: 10px 0 8px !important;
  padding-top: 11px !important;
}
.masterbar-product-active form.cart .quantity,
.masterbar-product-active form.cart .single_add_to_cart_button {
  min-height: 46px !important;
}

/* SKU ma zostać informacją techniczną, a nie elementem konkurującym z zakupem. */
.masterbar-product-active .product_meta {
  margin-top: 14px !important;
  padding-top: 9px !important;
  border-top-color: #edf0f3 !important;
  color: #98a2b3 !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
}
.masterbar-product-active .product_meta .sku_wrapper {
  color: #98a2b3 !important;
  font-weight: 400 !important;
}
.masterbar-product-active .product_meta .sku {
  color: #7b8794 !important;
  font-weight: 500 !important;
  letter-spacing: .01em;
}

@media (max-width: 900px) {
  .masterbar-product-active .mbp-product-path {
    margin-bottom: 7px !important;
    font-size: 10px;
  }
  .masterbar-product-active .summary .price {
    margin: 8px 0 4px !important;
  }
  .masterbar-product-active .stock {
    margin: 2px 0 8px !important;
  }
  .masterbar-product-active form.cart {
    margin: 9px 0 7px !important;
    padding-top: 10px !important;
  }
  .masterbar-product-active .product_meta {
    margin-top: 12px !important;
    padding-top: 8px !important;
    font-size: 9.5px !important;
  }
}


/* ==========================================================
   MASTERBAR Product 0.4.9 – MOBILE PRODUCT POLISH
   Mobile follows the same slim hierarchy as the refreshed navigation.
   ========================================================== */
@media (max-width: 900px) {
  .masterbar-product-active div.product div.summary {
    padding: 2px 12px 0 !important;
  }
  .masterbar-product-active .mbp-product-path {
    margin: 0 0 6px !important;
    font-size: 9.5px !important;
    line-height: 1.25 !important;
  }
  .masterbar-product-active .product_title {
    font-size: 18px !important;
    line-height: 1.15 !important;
    letter-spacing: -.018em !important;
    margin: 0 0 7px !important;
  }
  .masterbar-product-active .summary .price {
    font-size: 23px !important;
    line-height: 1.05 !important;
    margin: 7px 0 5px !important;
  }
  .masterbar-product-active .stock {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 28px !important;
    padding: 4px 9px !important;
    margin: 0 0 8px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
  }
  .masterbar-product-active .summary .stock::before {
    width: 7px !important;
    height: 7px !important;
    margin-right: 6px !important;
  }
  .masterbar-product-active form.cart {
    display: grid !important;
    grid-template-columns: 104px minmax(0,1fr) !important;
    gap: 8px !important;
    align-items: stretch !important;
    margin: 8px 0 7px !important;
    padding-top: 9px !important;
  }
  .masterbar-product-active form.cart .quantity {
    width: 104px !important;
    min-width: 104px !important;
    min-height: 42px !important;
    border-radius: 7px !important;
  }
  .masterbar-product-active form.cart .qty {
    display: block !important;
    width: 36px !important;
    min-width: 36px !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    font-size: 14px !important;
    color: #243247 !important;
    background: #fff !important;
  }
  .masterbar-product-active .mbp-qty-btn {
    width: 34px !important;
    min-width: 34px !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    font-size: 18px !important;
  }
  .masterbar-product-active form.cart .single_add_to_cart_button {
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 14px !important;
    border-radius: 7px !important;
    font-size: 14px !important;
    line-height: 42px !important;
  }
  .masterbar-product-active .product_meta {
    margin: 7px 0 0 !important;
    padding-top: 7px !important;
    font-size: 9px !important;
    line-height: 1.3 !important;
  }
  .masterbar-product-active .product_meta .sku_wrapper {
    opacity: .78;
  }
  .masterbar-product-active .mbp-wishlist,
  .masterbar-product-active .yith-wcwl-add-to-wishlist {
    transform: scale(.92);
    transform-origin: left top;
  }
  .masterbar-product-active .woocommerce-tabs {
    margin-top: 12px !important;
  }
  .masterbar-product-active .woocommerce-tabs ul.tabs {
    gap: 18px !important;
    padding: 0 12px !important;
  }
  .masterbar-product-active .woocommerce-tabs ul.tabs li a {
    padding: 10px 0 9px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
  }
}


/* ==========================================================
   MASTERBAR Product 0.5.0 – MOBILE QUANTITY / CTA FIX
   Final mobile ownership rules: keep the quantity value visible
   and make the purchase CTA genuinely compact.
   ========================================================== */
@media (max-width: 900px) {
  body.single-product.masterbar-product-active form.cart {
    display: grid !important;
    grid-template-columns: 102px minmax(0, 1fr) !important;
    column-gap: 8px !important;
    align-items: center !important;
  }

  body.single-product.masterbar-product-active form.cart .quantity {
    display: grid !important;
    grid-template-columns: 33px 36px 33px !important;
    width: 102px !important;
    min-width: 102px !important;
    max-width: 102px !important;
    height: 40px !important;
    min-height: 40px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: 1px solid #d5dce4 !important;
    border-radius: 7px !important;
    background: #fff !important;
  }

  body.single-product.masterbar-product-active form.cart .quantity .mbp-qty-btn,
  body.single-product.masterbar-product-active form.cart .quantity input.qty {
    position: static !important;
    float: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body.single-product.masterbar-product-active form.cart .quantity input.qty {
    appearance: textfield !important;
    -webkit-appearance: none !important;
    border: 0 !important;
    border-left: 1px solid #e5e9ee !important;
    border-right: 1px solid #e5e9ee !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #243247 !important;
    -webkit-text-fill-color: #243247 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 38px !important;
    text-align: center !important;
    box-shadow: none !important;
  }

  body.single-product.masterbar-product-active form.cart .quantity .mbp-qty-btn {
    border: 0 !important;
    background: #f7f9fb !important;
    color: #172433 !important;
    font-size: 18px !important;
    line-height: 1 !important;
  }

  body.single-product.masterbar-product-active form.cart .single_add_to_cart_button {
    width: 100% !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 12px !important;
    border-radius: 7px !important;
    font-size: 13.5px !important;
    line-height: 40px !important;
    font-weight: 700 !important;
  }
}

@media (max-width: 420px) {
  body.single-product.masterbar-product-active form.cart {
    grid-template-columns: 96px minmax(0, 1fr) !important;
    column-gap: 7px !important;
  }
  body.single-product.masterbar-product-active form.cart .quantity {
    grid-template-columns: 31px 34px 31px !important;
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
  }
}

/* ==========================================================
   MASTERBAR Product 0.5.1 – MOBILE CROSS-BROWSER + TABLE FIX
   Safari/Chrome safe quantity/CTA layout and responsive
   tables inside product descriptions.
   ========================================================== */
@media (max-width: 900px) {
  body.single-product.masterbar-product-active form.cart {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.single-product.masterbar-product-active form.cart .quantity {
    display: flex !important;
    flex: 0 0 106px !important;
    width: 106px !important;
    min-width: 106px !important;
    max-width: 106px !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: 1px solid #d5dce4 !important;
    border-radius: 7px !important;
    background: #fff !important;
  }

  body.single-product.masterbar-product-active form.cart .quantity .mbp-qty-btn {
    display: flex !important;
    flex: 0 0 34px !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #f7f9fb !important;
    color: #172433 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  body.single-product.masterbar-product-active form.cart .quantity input.qty {
    display: block !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-left: 1px solid #e5e9ee !important;
    border-right: 1px solid #e5e9ee !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #243247 !important;
    -webkit-text-fill-color: #243247 !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 38px !important;
    text-align: center !important;
    text-indent: 0 !important;
    box-shadow: none !important;
    -moz-appearance: textfield !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  body.single-product.masterbar-product-active form.cart .quantity input.qty::-webkit-outer-spin-button,
  body.single-product.masterbar-product-active form.cart .quantity input.qty::-webkit-inner-spin-button {
    margin: 0 !important;
    -webkit-appearance: none !important;
  }

  body.single-product.masterbar-product-active form.cart .single_add_to_cart_button {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  /* Product-description tables: never force the whole page wider than viewport. */
  body.single-product.masterbar-product-active .woocommerce-Tabs-panel,
  body.single-product.masterbar-product-active .woocommerce-Tabs-panel--description {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  body.single-product.masterbar-product-active .woocommerce-Tabs-panel table:not(.shop_attributes),
  body.single-product.masterbar-product-active .woocommerce-product-details__short-description table,
  body.single-product.masterbar-product-active .entry-content table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  body.single-product.masterbar-product-active .woocommerce-Tabs-panel table:not(.shop_attributes) th,
  body.single-product.masterbar-product-active .woocommerce-Tabs-panel table:not(.shop_attributes) td,
  body.single-product.masterbar-product-active .entry-content table th,
  body.single-product.masterbar-product-active .entry-content table td {
    min-width: 110px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    vertical-align: middle !important;
  }

  body.single-product.masterbar-product-active .woocommerce-Tabs-panel img,
  body.single-product.masterbar-product-active .entry-content img,
  body.single-product.masterbar-product-active .woocommerce-Tabs-panel iframe,
  body.single-product.masterbar-product-active .entry-content iframe {
    max-width: 100% !important;
  }
}

@media (max-width: 420px) {
  body.single-product.masterbar-product-active form.cart {
    gap: 7px !important;
  }
  body.single-product.masterbar-product-active form.cart .quantity {
    flex-basis: 100px !important;
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
  }
  body.single-product.masterbar-product-active form.cart .quantity .mbp-qty-btn {
    flex-basis: 32px !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
  }
  body.single-product.masterbar-product-active form.cart .quantity input.qty {
    flex-basis: 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
  }
  body.single-product.masterbar-product-active form.cart .single_add_to_cart_button {
    padding-left: 9px !important;
    padding-right: 9px !important;
    font-size: 12.5px !important;
  }
}


/* ==========================================================
   MASTERBAR Product 0.5.3 – iOS SAFARI NATIVE QTY FIX
   Safari iOS dostaje input tekstowy z klawiaturą numeryczną,
   bez nakładek/mirrorów. To zachowuje prawdziwe value WooCommerce.
   ========================================================== */
@media (max-width: 900px) {
  html.mbp-ios-safari body.single-product.masterbar-product-active form.cart .quantity input.qty.mbp-ios-qty-text {
    display: block !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-left: 1px solid #e5e9ee !important;
    border-right: 1px solid #e5e9ee !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #243247 !important;
    -webkit-text-fill-color: #243247 !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 38px !important;
    text-align: center !important;
    text-indent: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }
  html.mbp-ios-safari body.single-product.masterbar-product-active form.cart .quantity .mbp-qty-value {
    display: none !important;
  }
}


/* ==========================================================
   MASTERBAR Product 0.5.4 – FIXED QUANTITY VISIBILITY
   WooCommerce może renderować input ilości jako hidden, gdy
   dozwolona ilość jest stała (np. 1). JS ujawnia ten sam input,
   dzięki czemu zawsze mamy czytelne: − | 1 | +.
   ========================================================== */
body.single-product.masterbar-product-active form.cart .quantity input.qty.mbp-fixed-qty-visible {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  color: #243247 !important;
  -webkit-text-fill-color: #243247 !important;
  text-align: center !important;
}
body.single-product.masterbar-product-active form.cart .quantity.mbp-qty-fixed .mbp-qty-btn {
  cursor: default !important;
  opacity: .58 !important;
}
body.single-product.masterbar-product-active form.cart .quantity.mbp-qty-fixed .mbp-qty-btn:hover {
  background: #f7f9fb !important;
}


/* 0.5.5 – dyskretna zachęta do konta dla niezalogowanego klienta. */
.masterbar-product-active .mbp-guest-loyalty-hint {
  display:flex;
  flex-direction:column;
  gap:2px;
  margin:2px 0 10px;
  padding:9px 11px;
  border:1px solid #dce7f1;
  border-radius:8px;
  background:#f7fbff;
  color:#173b5c;
  font-size:12px;
  line-height:1.4;
}
.masterbar-product-active .mbp-guest-loyalty-hint strong {
  font-size:12px;
  font-weight:700;
}
.masterbar-product-active .mbp-guest-loyalty-hint span {
  color:var(--mbp-muted);
  font-size:11px;
}
@media (max-width: 900px) {
  .masterbar-product-active .mbp-guest-loyalty-hint {
    margin-top:0;
    padding:8px 10px;
  }
}


/* MASTERBAR Product 0.5.7 – CENTRAL PALETTE ADAPTER */
body.masterbar-product-active{
  --mbp-navy:var(--mb-color-primary,#0D2F55);
  --mbp-accent:var(--mb-color-primary,#0D2F55);
  --mbp-border:var(--mb-color-border,#DFE5EC);
  --mbp-muted:var(--mb-color-muted,#667085);
  --mbp-soft:var(--mb-color-soft,#F5F7FA);
}
.masterbar-product-active form.cart .single_add_to_cart_button{
  background:var(--mb-color-primary,#0D2F55)!important;
  border-color:var(--mb-color-primary,#0D2F55)!important;
  color:var(--mb-color-contrast,#FFFFFF)!important;
}
.masterbar-product-active form.cart .single_add_to_cart_button:hover{
  background:var(--mb-color-primary-hover,#1F4E8C)!important;
  border-color:var(--mb-color-primary-hover,#1F4E8C)!important;
  filter:none!important;
}
.masterbar-product-active .flex-control-thumbs img.flex-active,
.masterbar-product-active .woocommerce-tabs ul.tabs li.active a{
  border-color:var(--mb-color-primary,#0D2F55)!important;
}
.masterbar-product-active .mbp-benefit__icon{
  background:var(--mb-color-primary-soft,#E9F1FB)!important;
  color:var(--mb-color-primary,#0D2F55)!important;
}


/* ==========================================================
   MASTERBAR Product 0.5.9 – SKU / EAN / MARKA
   ========================================================== */
.masterbar-product-active .product_meta {
  gap: 5px 18px !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}
.masterbar-product-active .product_meta .sku_wrapper,
.masterbar-product-active .product_meta .mbp-ean-wrapper,
.masterbar-product-active .product_meta .mbp-brand-wrapper {
  color: #667085 !important;
  font-weight: 500 !important;
  opacity: 1 !important;
}
.masterbar-product-active .product_meta .sku,
.masterbar-product-active .product_meta .mbp-ean,
.masterbar-product-active .product_meta .mbp-brand {
  color: #344054 !important;
  font-weight: 600 !important;
  letter-spacing: .01em;
}
.masterbar-product-active .product_meta a.mbp-brand:hover {
  color: var(--mbp-navy) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (max-width: 900px) {
  .masterbar-product-active .product_meta {
    font-size: 11px !important;
    gap: 4px 14px !important;
  }
}

/* 0.6.9: opcjonalny mobilny pasek zakupu */
@media(max-width:900px){
  body.masterbar-product-active .mbp-mobile-buy:not([hidden]){
    display:flex!important;position:fixed;left:0;right:0;bottom:0;z-index:9998;
    align-items:center;gap:14px;padding:12px 16px calc(12px + env(safe-area-inset-bottom));
    background:#fff;box-shadow:0 -5px 24px rgba(15,23,42,.14);border-top:1px solid #e2e8f0;
    box-sizing:border-box;max-width:100vw;
  }
  body.masterbar-product-active .mbp-mobile-buy[hidden]{display:none!important}
  .mbp-mobile-buy-price{flex:1;min-width:0;font-weight:750;font-size:19px;color:#15243b;line-height:1.25}
  .mbp-mobile-buy-price del{font-size:13px;color:#777;display:block}
  .mbp-mobile-buy-button{flex-shrink:0;max-width:55%;border:0;border-radius:10px;background:#12345a;color:#fff;padding:14px 19px;font-size:16px;font-weight:700;cursor:pointer}
  body.masterbar-product-active.mbp-has-sticky-buy{padding-bottom:calc(85px + env(safe-area-inset-bottom))!important}
  body.masterbar-product-active.mbp-has-sticky-buy #ast-scroll-top{bottom:calc(100px + env(safe-area-inset-bottom))!important}
}
