/* Bundle block on the product page (module prbundles). BEM prefix .prb; the font comes from the theme. */

.prb-wrap { margin-top: 30px; margin-bottom: 30px; }
.prb-wrap .prb + .prb { margin-top: 20px; }

.prb {
  background: #FCF2F7; /* the site's light pink panel colour (custom.css .set-add-to-cart, .filter-controller, ...) */
  border-radius: 12px;
  padding: 20px;
  margin: 0;
  color: #1f2430;
}
.prb__title { font-size: 20px; font-weight: 700; margin: 0 0 16px; }

/* ---- item cards ---------------------------------------------------------- */
.prb__items { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.prb__cell { position: relative; flex: 1 1 0; min-width: 0; display: flex; margin: 0; padding: 0; }
.prb__items--2 .prb__cell,
.prb__items--3 .prb__cell { flex: 0 1 260px; max-width: 260px; }

.prb-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  min-width: 0;
}
/* square box that clips: a missing image file must not stretch the card with its alt text */
.prb-card__img { display: block; margin-bottom: 10px; aspect-ratio: 1 / 1; overflow: hidden; }
.prb-card__info { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.prb-card__img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}
.prb-card__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  color: inherit;
  text-decoration: none;
}
.prb-card__name:hover { text-decoration: underline; }
.prb-card__attrs { min-height: 36px; margin-bottom: 8px; }
.prb-card__attrs .prb-select { font-size: 13px; height: 36px; margin-bottom: 6px; }
.prb-card__combo { display: block; font-size: 13px; color: #6b7280; }
.prb-card__warn { color: #b91c1c; font-size: 12px; margin-bottom: 6px; }
.prb-card__warn[hidden] { display: none; }
.prb-card__price { margin-top: auto; text-align: center; }
.prb-card--oos .prb-price { color: #6b7280; }

.prb-price { color: #e02424; font-weight: 700; font-size: 17px; }
.prb-old { color: #6b7280; font-size: 13px; text-decoration: line-through; margin-left: 4px; }
.prb-badge {
  display: block;
  width: -moz-fit-content;
  width: fit-content;
  margin: 4px auto 0;
  padding: 1px 8px;
  background: #1e8a3c;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
}
.prb-old[hidden], .prb-badge[hidden] { display: none; }
/* mobile-only parts (list layout like "Dažnai perkama kartu"): hidden on tablet/desktop */
.prb-card__current,
.prb-card__label,
.prb-summary__title { display: none; }

.prb-plus {
  position: absolute;
  top: 50%;
  right: -26px;
  z-index: 2;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border: 1px solid #e3e8f0;
  border-radius: 50%;
  background: #fff;
  color: #CF1778;
  font-size: 18px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
  pointer-events: none;
}

/* ---- summary bar --------------------------------------------------------- */
.prb-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 16px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 10px;
}
.prb-summary__prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.prb-total { color: #e02424; font-size: 26px; font-weight: 700; line-height: 1.1; }
.prb-total-old { color: #6b7280; font-size: 16px; text-decoration: line-through; margin: 0; }
.prb-total-old[hidden], .prb-save[hidden] { display: none; }
.prb-save {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid #1e8a3c;
  border-radius: 3px;
  color: #1e8a3c;
  font-size: 13px;
}

.prb-qty {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 98px;
  height: 44px;
  border: 1px solid #d7deea;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.prb-qty__btn {
  width: 34px;
  height: 100%;
  border: 0;
  background: transparent;
  color: #1f2430;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.prb-qty__btn[disabled] { opacity: .4; cursor: not-allowed; }
.prb-qty__input {
  width: 40px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 16px;
  -moz-appearance: textfield;
}

.prb .prb-add.btn-blue {
  /* colours come from the theme's .btn-blue (the site's add-to-cart colour); only shape/layout here.
     custom.css loads after us and repeats display/padding in `.btn-blue:active, .btn-blue:focus` (2 classes):
     3 classes here keep the button from jumping to inline-block while it is pressed or focused. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 28px;
  border-radius: 999px;
  width: auto;
  line-height: 1.2;
  white-space: nowrap;
}
.prb-add .add-to-cart-icon { width: 24px; min-width: 24px; height: 24px; }
.prb-add[disabled] { opacity: .5; cursor: not-allowed; }
.prb-add__short { display: none; }

.prb-summary__meta { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: #1e8a3c; text-align: right; }
.prb-msg { flex: 1 0 100%; margin: 0; }
.prb-msg[hidden] { display: none; }

/* ---- up to 3 items on desktop: summary to the right of the items, after "=" ---- */
.prb-equals { display: none; }
@media (min-width: 992px) {
  .prb--side .prb__body { display: flex; align-items: center; gap: 24px; }
  .prb--side .prb__items { flex: 0 1 auto; min-width: 0; }
  .prb--side .prb__items--2 .prb__cell,
  .prb--side .prb__items--3 .prb__cell { flex: 0 1 220px; max-width: 220px; }
  .prb--side .prb-equals {
    display: block;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 1px solid #e3e8f0;
    border-radius: 50%;
    background: #fff;
    color: #CF1778;
    font-size: 18px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
  }
  /* summary as a column: prices, savings, [qty + button], stock/delivery */
  .prb--side .prb-summary {
    flex: 1 1 300px;
    max-width: 380px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    padding: 0;
    background: transparent;
  }
  .prb--side .prb-summary__prices,
  .prb--side .prb-summary__meta,
  .prb--side .prb-msg { grid-column: 1 / -1; }
  .prb--side .prb-summary__meta { margin-left: 0; text-align: left; }
  .prb--side .prb-add.btn-blue { width: 100%; padding: 0 16px; }
  .prb--side .prb-add__long { display: none; }
  .prb--side .prb-add__short { display: inline; }
}

/* ---- states -------------------------------------------------------------- */
.prb-is-loading .prb-card__price,
.prb-is-loading .prb-summary__prices { opacity: .45; transition: opacity .15s; }
.prb-is-loading .prb-add { pointer-events: none; }

.prb a:focus-visible, .prb select:focus-visible, .prb button:focus-visible, .prb input:focus-visible {
  outline: 2px solid #CF1778;
  outline-offset: 2px;
}

/* ---- tablet: 3 per row ---------------------------------------------------- */
@media (min-width: 576px) and (max-width: 991.98px) {
  .prb__items { flex-wrap: wrap; row-gap: 24px; }
  .prb__cell,
  .prb__items--2 .prb__cell,
  .prb__items--3 .prb__cell { flex: 0 0 calc((100% - 48px) / 3); max-width: none; }
  .prb__items--2 .prb__cell { flex-basis: calc((100% - 24px) / 2); }
  .prb__cell:nth-child(3n) .prb-plus { display: none; }
}

/* ---- mobile: one white list, a row per item split by lines (client's "Dažnai perkama kartu" example) ---- */
@media (max-width: 575.98px) {
  .prb { padding: 14px; }
  .prb__title { font-size: 22px; }
  .prb__items,
  .prb__items--2,
  .prb__items--3 { flex-direction: column; gap: 0; padding: 0 14px; background: #fff; border-radius: 10px; }
  .prb__cell,
  .prb__items--2 .prb__cell,
  .prb__items--3 .prb__cell { flex: 0 0 auto; max-width: none; }
  .prb__cell + .prb__cell { border-top: 1px solid #e3e8f0; }
  .prb-card { flex-direction: row; align-items: flex-start; gap: 14px; padding: 16px 0; border: 0; border-radius: 0; background: transparent; text-align: left; }
  .prb-card__img { flex: 0 0 80px; width: 80px; margin: 0; }
  .prb-card__current { display: block; margin-bottom: 2px; font-size: 13px; color: #6b7280; }
  .prb-card__name { min-height: 0; margin-bottom: 8px; font-size: 15px; }
  .prb-card__attrs { min-height: 0; margin-bottom: 0; }
  .prb-card__attrs .prb-select { margin-bottom: 8px; }
  .prb-card__combo { margin-bottom: 8px; }
  /* labelled prices: "Rinkinio kaina" / price + badge, "Įprasta kaina" / old price */
  .prb-card__price { margin-top: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; justify-items: start; column-gap: 8px; text-align: left; }
  .prb-card__label { display: block; grid-column: 1 / -1; font-size: 13px; line-height: 1.4; color: #6b7280; }
  .prb-card__label[hidden] { display: none; }
  .prb-card__label--old { grid-row: 3; margin-top: 4px; }
  .prb-price { grid-row: 2; grid-column: 1; font-size: 18px; }
  .prb-badge { grid-row: 2; grid-column: 2; margin: 0; }
  .prb-old { grid-row: 4; grid-column: 1 / -1; margin-left: 0; font-size: 14px; }
  /* "+" sits on the line between two rows, under the image column (80px / 2 - 14px) */
  .prb-plus { top: auto; right: auto; bottom: -14px; left: 26px; margin-top: 0; }
  /* summary: title, prices row, then [qty + button], then meta */
  .prb-summary { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px; }
  .prb-summary__title { display: block; font-size: 15px; font-weight: 700; margin-bottom: -4px; }
  .prb-summary__title, .prb-summary__prices, .prb-summary__meta, .prb-msg { grid-column: 1 / -1; }
  .prb-summary__meta { margin-left: 0; text-align: left; order: 5; }
  .prb-add { width: 100%; }
  .prb-add__long { display: none; }
  .prb-add__short { display: inline; }
}

/* ---- cart, checkout, mini cart, add-to-cart modal -------------------------- */
/* custom.css loads after us and `.cart-table-title span` ties a bare class: body + element selector wins */
body span.prb-cart-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: #CF1778;
}
body span.prb-cart-price { color: #e02424; font-weight: 700; }
.prb-cart-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  background: #1e8a3c;
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 3px;
  white-space: nowrap;
}
.prb-cart-old { display: block; clear: both; text-align: right; font-size: 12px; }

/* side (mini) cart: custom.css colours every `#_desktop_cart .blockcart-content .col-info span`, so repeat that context */
#_desktop_cart .blockcart-content .col-info span.prb-cart-badge { color: #fff; }
#_desktop_cart .blockcart-content .col-info span.prb-cart-label { color: #CF1778; }
#_desktop_cart .blockcart-content .col-info span.prb-cart-price { color: #e02424; }
