/* MS Product Benefits - PrestaShop 8.x */

.mspb-old-logo-hidden {
  display: none !important;
}

.mspb-benefits {
  display: none;
  margin: 1rem 0 0;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: .85rem;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .06);
  box-sizing: border-box;
}

.mspb-benefits.mspb-ready {
  display: block;
}

.mspb-benefits * {
  box-sizing: border-box;
}

.mspb-benefits-title {
  display: block;
  width: 100%;
  margin-bottom: .75rem;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
}

.mspb-benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  width: 100%;
}

.mspb-benefit {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  min-width: 0;
  padding: .75rem;
  background: #f8f8f8;
  border: 1px solid #efefef;
  border-radius: .65rem;
}

.mspb-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: #ffffff;
  border-radius: 999px;
  font-size: 1.05rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.mspb-text {
  min-width: 0;
}

.mspb-text strong {
  display: block;
  font-size: .92rem;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

.mspb-text small {
  display: block;
  margin-top: .12rem;
  color: #666666;
  font-size: .78rem;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

.mspb-benefit-delivery strong {
  color: #1f9d8a;
}

.mspb-delivery-free .mspb-benefit-delivery strong {
  color: #178a26;
}

.mspb-loading-delivery [data-mspb-delivery-source="1"]::after {
  content: " · sprawdzam...";
}

/*
 * Desktop fix:
 * In some themes the product action area is a horizontal flex row.
 * The 1.0.0 insertion point was good, but the box was squeezed as one narrow flex item.
 * These rules keep the same position and only force the benefits box to start as a full-width row.
 */
@media (min-width: 768px) {
  .product-actions,
  .product-information .product-actions,
  .product-container .product-actions {
    flex-wrap: wrap !important;
  }

  .product-actions > .mspb-benefits,
  .product-add-to-cart + .mspb-benefits,
  #add-to-cart-or-refresh + .mspb-benefits,
  .mspb-benefits.mspb-ready {
    clear: both !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .mspb-benefits-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 991px) {
  .mspb-benefits-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .mspb-benefits {
    margin-top: .85rem;
    padding: .85rem;
  }

  .mspb-benefits-grid {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  .mspb-benefit {
    padding: .7rem;
  }
}


/*
 * Mobile title fix:
 * On some mobile themes the product action block keeps flex/float behavior around the price and buttons.
 * Keep the same insertion point, but force the benefits block and its title to start on a new full-width line.
 */
@media (max-width: 767px) {
  .product-actions,
  .product-information .product-actions,
  .product-container .product-actions,
  #add-to-cart-or-refresh {
    flex-wrap: wrap !important;
  }

  .product-actions > .mspb-benefits,
  .product-information .mspb-benefits,
  .product-container .mspb-benefits,
  #add-to-cart-or-refresh + .mspb-benefits,
  .mspb-benefits.mspb-ready {
    display: block !important;
    clear: both !important;
    float: none !important;
    flex: 0 0 100% !important;
    flex-basis: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .mspb-benefits::before {
    content: "";
    display: table;
    clear: both;
  }

  .mspb-benefits-title {
    display: block !important;
    clear: both !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 .75rem !important;
    padding: 0 !important;
    white-space: normal !important;
    text-align: left !important;
  }
}


/*
 * Final mobile/desktop polish:
 * Keep the benefits section in the old preferred place and prevent the title from jumping beside the price.
 */
.mspb-benefits.mspb-ready {
  display: block;
}

@media (max-width: 767px) {
  .mspb-benefits.mspb-ready {
    clear: both !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .mspb-benefits-title {
    display: block !important;
    clear: both !important;
    width: 100% !important;
    white-space: normal !important;
  }
}
