.kbd-bundle {
  margin-top: 25px;
  margin-bottom: 25px;
}

.kbd-bundle h3 {
  font-size: 13px;
  line-height: 18px;
  font-weight: bold;
  color: #000000;
  margin: 0px;
  margin-bottom: 10px;

}

/* --- SWIPER --- */
.kbd-swiper {
  position: relative;
}

.kbd-footer-box {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
}

.kbd-footer-box p {
  font-size: 12px;
  line-height: 15px;
  color: #5C5C5C;
  font-weight: 500;
  font-style: italic;
  margin: 0px;
}

.kbd-slider-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}


.kbd-swiper-pagination {
  width: auto !important;
}

.kbd-swiper-nav-btn {
  display: flex;
  appearance: none;
  cursor: pointer;
  padding: 0px;
  margin: 0px;
  border: 0px;
  background-color: transparent;
}

.kbd-swiper-nav-btn svg {
  width: 21px;
  height: auto;
  flex: 0 0 21px;
  fill: #5C5C5C;
  transition: all 0.2s;
}

.kbd-swiper-prev svg {
  transform: rotate(180deg);
}


.kbd-swiper-nav-btn:hover svg {
  fill: #FFC207;
}



.kbd-swiper-nav-btn.swiper-button-disabled svg {
  fill: #DBDBDB;
}

.kbd-swiper-pagination {
  --dot: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kbd-swiper-pagination .swiper-pagination-bullet {
  width: var(--dot);
  height: var(--dot);
  border-radius: 8px;
  background: #EAEAEA;
  opacity: 1;
}

.kbd-swiper-pagination .swiper-pagination-bullet-active {
  background: #7C7C7C;
}

/* --- KAFEL --- */
.single-kbd-el {

  position: relative;
}

.kbd-item {
  /* background: #fafafa; */
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  position: relative;
  height: 100%;
  /* sensowna szerokość slajdu */
}

.single-kbd-el {
  border: 1px solid #DBDBDB;
  border-radius: 10px;
  overflow: hidden;
  height: 100%;
}

/* ukryj natywny checkbox */
.kbd-item .kbd-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.kbd-item-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* custom checkbox w PRAWYM GÓRNYM rogu */
.kbd-checkbox {
  position: absolute;
  top: 0px;
  right: 0px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.kbd-checkbox .kbd-checkbox-ui {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background-color: #DBDBDB;
  display: inline-block;
  position: relative;
}

.kbd-checkbox .kbd-checkbox-ui::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 10px;
  height: 6px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.kbd-checkbox input.kbd-check:checked~.kbd-checkbox-ui {
  background-color: #FFC207;
}

.kbd-checkbox input.kbd-check:checked~.kbd-checkbox-ui::after {
  border-left-color: #fff;
  border-bottom-color: #fff;
}


.kbd-item img {
  width: 100%;
  aspect-ratio: 1/1;
    object-fit: contain;
  height: auto;
  display: block;
}

.single-kbd-el-content {
  padding: 10px;
  border-top: 1px solid #DBDBDB;

  /* min-height: 95px; */
}

.kbd-name {
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
}

/* układ ceny w kafelku */
.kbd-price {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.kbd-price-new {
  background-color: transparent;
  font-size: 13px;
  line-height: 22px;
  font-weight: bold;
  color: #000000;
  display: flex;
  align-items: center;
}

.kbd-price-new span {
  font-size: 13px;
  line-height: 16px;
  font-weight: bold;
}

.kbd-price-top del {
  color: #5C5C5C;
  display: block;
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
}

.kbd-price-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* badge: kwota oszczędności w prawym górnym rogu */
.kbd-badge {
  font-size: 11px;
  line-height: 16px;
  border-radius: 4px;
  padding: 2px 4px;
  border-radius: 2px;
  background-color: #DCF0D8;
}

.kbd-badge-saved {


  z-index: 1;
  background: #DCF0D8;
  color: #4B7620;
}




.kbd-s2-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kbd-s2-thumb img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.kbd-s2-main {
  display: flex;
  flex-direction: column;
}

.kbd-s2-text {
  font-weight: 600;
}

.kbd-s2-meta {
  font-size: 11px;
  opacity: .8;
  display: flex;
  gap: 8px;
}

.kbd-s2-price {
  white-space: nowrap;
}

.kbd-s2-type {
  text-transform: uppercase;
}

/*
 * Awaryjne, wasko ograniczone style dla SelectWoo w panelu KBD. Część
 * konfiguracji optymalizujących panel potrafi pominąć bazowy arkusz Select2;
 * własna klasa dropdownu zapobiega przezroczystej i nieograniczonej liście,
 * nie wpływając na pozostałe selecty WooCommerce.
 */
.kbd-product-select-cell {
  position: relative;
}

.kbd-selectwoo-container.select2-container {
  box-sizing: border-box;
  display: inline-block;
  position: relative;
  width: 100% !important;
  max-width: 100%;
  vertical-align: middle;
}

.select2-container--open .select2-dropdown.kbd-selectwoo-dropdown,
.kbd-selectwoo-dropdown.select2-dropdown {
  box-sizing: border-box;
  position: absolute;
  left: 0;
  z-index: 100100;
  width: 100%;
  border: 1px solid #8c8f94;
  background: #fff;
  color: #2c3338;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .14);
}

.kbd-selectwoo-container .select2-selection--single {
  box-sizing: border-box;
  display: block;
  min-height: 30px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  background: #fff;
}

.kbd-selectwoo-container .select2-selection__rendered {
  display: block;
  padding: 0 28px 0 8px;
  line-height: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kbd-selectwoo-container .select2-selection__arrow {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 24px;
  height: 28px;
}

.kbd-selectwoo-dropdown .select2-search--dropdown {
  display: block;
  padding: 8px;
  background: #fff;
}

.kbd-selectwoo-dropdown .select2-search__field {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
}

.kbd-selectwoo-dropdown .select2-results {
  display: block;
  background: #fff;
}

.kbd-selectwoo-dropdown .select2-results__options {
  max-height: 320px !important;
  overflow-x: hidden;
  overflow-y: auto;
}

.kbd-selectwoo-dropdown .select2-results__option {
  box-sizing: border-box;
  margin: 0;
  padding: 8px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.kbd-selectwoo-dropdown .select2-results__option--highlighted[aria-selected],
.kbd-selectwoo-dropdown .select2-results__option--highlighted[data-selected] {
  background: #2271b1;
  color: #fff;
}

.kbd-selectwoo-dropdown .kbd-s2-main {
  min-width: 0;
}

.kbd-selectwoo-dropdown .kbd-s2-meta {
  flex-wrap: wrap;
}

/* Modal */


.kbd-modal-close {
  background-color: transparent;
  position: absolute;
  right: 26px;
  top: 30px;
  width: 30px;
  height: 30px;
  padding: 0px;
  cursor: pointer;
  border: 0px;
}

.kbd-modal-close svg {
  width: 16px;
  height: auto;
  transition: all 0.2s;
}

.kbd-modal-close:hover svg {
  fill: #FFC207;
}

.kbd-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.kbd-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
}

.kbd-modal-inner {
  position: relative;
  background: #fff;
  max-width: 985px;
  width: 100%;
  margin: 40px auto;
  padding: 30px;
  max-height: calc(100vh - 80px);
  /* height: 100%; */
  overflow: auto;
  border-radius: 16px;
  box-shadow: 0px 10px 50px #0000001F;
}

.kbd-modal-actions {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 17px;
}

.kbd-modal-actions button {
  flex: 1;
  text-transform: uppercase;
  font-size: 16px;
  line-height: 24px;
  color: black;
  font-weight: bold;
  padding: 18px;
  border-radius: 31px;
}

.kbd-modal-product {
  display: flex;
  align-items: center;
  /* align-items: flex-start; */
  gap: 15px;
  padding: 8px;
  padding-right: 40px;
  border-radius: 16px;
  background: #F4F4F4;
}

.kbd-modal-product img {
  width: 90px;
  height: 90px;
  border-radius: 10px;
  object-fit: contain;
}

.kbd-modal-inner-title {
  display: flex;
  gap: 10px;
  font-size: 16px;
  line-height: 20px;
  color: black;
  margin: 0px;
  margin-bottom: 15px;
  font-weight: 600;
  padding-right: 35px;
}

.kbd-modal-inner-title svg {
  fill: #FFC207;
  width: 20px;
  height: auto;

}


.kbd-modal-inner .kbd-bundle h3 {
  font-size: 18px;
  line-height: 20px;
  font-weight: 500;
  color: black;
  margin: 0px;
  margin-bottom: 20px;
  text-align: center;
}

.kbd-modal-inner .modal-product-content {

  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

.kbd-modal-inner .modal-product-content .kbd-modal-product-title {
  font-size: 16px;
  line-height: 22px;
  color: black;
  font-weight: 500;
}

@media only screen and (max-width: 768px) {
  .kbd-modal-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }
  .kbd-modal-inner{
    padding-bottom: 95px;
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    max-height: 100%;
  }
  .kbd-modal-inner .modal-product-content {
          flex-direction: column;
        align-items: flex-start;
        gap: 10px;
  }
    .kbd-modal-product{
      padding-right: 8px;
      gap: 8px;
      align-items: flex-start;
  }
  .kbd-modal-inner .modal-product-content .kbd-modal-product-title{
    font-size: 14px;
    line-height: 20px;
  }
  .kbd-modal-close{
        right: 20px;
    top: 25px;
  }
  .kbd-bundle{
    margin-top: 20px;
  }
}


.kbd-modal-inner .modal-product-content .product-price-wrapper .discount-badge {
  display: none;
}

.kbd-modal-product-saving-wrapper {
  display: flex;
  margin-bottom: 8px;
}

.kbd-modal-product-saving {
  background-color: #DCF0D8;
  border-radius: 2px;
  padding: 2px;
  padding-left: 4px;
  padding-right: 4px;
}

.kbd-modal-product-saving,
.kbd-modal-product-saving * {
  font-size: 14px;
  line-height: 16px;
  font-weight: 600;
  color: #4B7620;
}

.kbd-modal-inner .modal-product-content .product-price-wrapper .product-old-price-wrapper,
.kbd-modal-inner .modal-product-content .product-price-wrapper .product-old-price-wrapper * {
  color: #5C5C5C;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.kbd-modal-inner .modal-product-content .product-price-wrapper .current-price,
.kbd-modal-inner .modal-product-content .product-price-wrapper .current-price * {
  font-size: 16px;
  line-height: 22px;
  font-weight: bold;
  color: #000000;
  background-color: transparent;
}


.kbd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media only screen and (max-width: 768px) {
  .kbd-grid {

    grid-template-columns: repeat(3, 1fr);

  }

  .kbd-checkbox {
    right: initial;
    left: 0px;
  }

  .kbd-badge.kbd-badge-saved {
    position: absolute;
    top: 8px;
    right: 8px;
  }
  .single-kbd-el-content{
    min-height: initial;
  }
}

/* One set of inputs serves both layouts, including viewport changes. */
@media (min-width: 768px) {
  .kbd-bundle--responsive[data-layout-desktop="grid"] .kbd-swiper > .swiper-wrapper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; transform: none !important; }
  .kbd-bundle--responsive[data-layout-desktop="grid"] .single-kbd-el { width: auto !important; min-width: 0; margin: 0 !important; }
  .kbd-bundle--responsive[data-layout-desktop="grid"] .kbd-slider-controls { display: none; }
  .kbd-bundle--responsive[data-layout-desktop="grid"] .kbd-swiper { overflow: visible; }
}
@media (max-width: 767px) {
  .kbd-bundle--responsive[data-layout-mobile="grid"] .kbd-swiper > .swiper-wrapper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; transform: none !important; }
  .kbd-bundle--responsive[data-layout-mobile="grid"] .single-kbd-el { width: auto !important; min-width: 0; margin: 0 !important; }
  .kbd-bundle--responsive[data-layout-mobile="grid"] .kbd-slider-controls { display: none; }
  .kbd-bundle--responsive[data-layout-mobile="grid"] .kbd-swiper { overflow: visible; }
}
