/**
 * Clyro Bundles - front (skład zestawu + nota cenowa w buy-boxie)
 */

/* ---------------------------------------------------------------- *
 * Sekcja "Skład zestawu" pod galerią
 * Siatka do 4 kafelków w wierszu, kafelki rozdzielone znakiem "+"
 * ---------------------------------------------------------------- */
.clyro-bundle-section {
  background: #ffffff;
  border: 1px solid var(--clyro-border-color, #e5e7eb);
  border-radius: var(--clyro-radius-lg, 16px);
  padding: 28px;
  margin: 24px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.clyro-bundle-section .cb-header {
  margin-bottom: 20px;
}

.clyro-bundle-section .cb-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--clyro-primary, #111417);
  margin: 0;
  letter-spacing: -0.02em;
}

.clyro-bundle-section .cb-subtitle {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--clyro-text-muted, #8A9096);
  margin: 8px 0 0;
}

.clyro-bundle-section .cb-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 16px;
}

.clyro-bundle-section .cb-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  padding: 14px 10px 12px;
  background: #ffffff;
  border: 1px solid var(--clyro-border-color, #e5e7eb);
  border-radius: var(--clyro-radius-md, 12px);
  transition: border-color 0.18s ease;
}

.clyro-bundle-section .cb-item:hover,
.clyro-bundle-section .cb-item:focus-within {
  border-color: var(--clyro-accent-lime, #C7FF2E);
}

/* Znak "+" między kafelkami w wierszu (nie po ostatniej kolumnie) */
.clyro-bundle-section .cb-item::after {
  content: "+";
  position: absolute;
  top: 14px;                 /* górny padding kafelka */
  right: -16px;              /* = odstęp siatki, żeby plus był dokładnie w połowie przerwy */
  width: 16px;
  height: 104px;             /* wysokość obszaru zdjęcia — plus na jego środku */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: #c3c8cd;
  pointer-events: none;
}

.clyro-bundle-section .cb-item:nth-child(4n)::after,
.clyro-bundle-section .cb-item:last-child::after {
  content: none;
}

.clyro-bundle-section .cb-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 104px;
  padding: 4px;
  background: transparent;
}

.clyro-bundle-section .cb-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.clyro-bundle-section .cb-media-placeholder {
  color: #d5d9dd;
}

.clyro-bundle-section .cb-media-placeholder .material-icons {
  font-size: 38px;
}

.clyro-bundle-section .cb-qty {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--clyro-primary, #111417);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: var(--clyro-radius-pill, 9999px);
}

.clyro-bundle-section .cb-name {
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  min-height: 4.05em;        /* dokładnie 3 linie — kafelki równej wysokości */
  color: var(--clyro-primary, #111417);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

a.cb-name:hover,
a.cb-name:focus {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--clyro-primary, #111417);
}

.clyro-bundle-section .cb-name.is-static {
  color: var(--clyro-text-muted, #8A9096);
  font-weight: 500;
}

.clyro-bundle-section .cb-price {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 700;
  color: #6b7280;
}

.clyro-bundle-section .cb-more {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--clyro-text-muted, #8A9096);
}

/* Podsumowanie cenowe */
.clyro-bundle-section .cb-summary {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--clyro-border-color, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.clyro-bundle-section .cb-summary-lines {
  display: flex;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}

.clyro-bundle-section .cb-summary-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  color: #4b5563;
}

.clyro-bundle-section .cb-summary-row.is-main {
  font-size: 17px;
  font-weight: 800;
  color: var(--clyro-text-dark, #111417);
}

.clyro-bundle-section .cb-summary-label {
  color: var(--clyro-text-muted, #8A9096);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.clyro-bundle-section .cb-strike {
  text-decoration: line-through;
  color: var(--clyro-text-muted, #8A9096);
  font-weight: 700;
}

.clyro-bundle-section .cb-summary-savings {
  background: var(--clyro-accent-lime, #C7FF2E);
  color: var(--clyro-primary, #111417);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: var(--clyro-radius-pill, 9999px);
}

@media (max-width: 991px) {
  /* Motyw układa kartę produktu flexem z order — bez tego sekcja ląduje nad galerią */
  .clyro-bundle-section {
    order: 6;
    width: 100%;
  }
}

@media (max-width: 767px) {
  .clyro-bundle-section {
    padding: 20px 16px;
  }

  .clyro-bundle-section .cb-title {
    font-size: 20px;
  }

  .clyro-bundle-section .cb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }

  .clyro-bundle-section .cb-item:nth-child(4n)::after {
    content: "+";
  }

  .clyro-bundle-section .cb-item:nth-child(2n)::after,
  .clyro-bundle-section .cb-item:last-child::after {
    content: none;
  }

  .clyro-bundle-section .cb-media {
    height: 92px;
  }

  .clyro-bundle-section .cb-item::after {
    top: 14px;
    right: -12px;
    width: 12px;
    height: 92px;
    font-size: 16px;
  }
}

/* ---------------------------------------------------------------- *
 * Nota "Cena poza zestawem" w buy-boxie
 * ---------------------------------------------------------------- */
.clyro-bundle-price-note {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.clyro-bundle-price-note .cbp-label {
  color: var(--clyro-text-muted, #8A9096);
}

.clyro-bundle-price-note .cbp-separate {
  text-decoration: line-through;
  color: var(--clyro-text-muted, #8A9096);
  font-weight: 700;
}

.clyro-bundle-price-note .cbp-savings {
  background: var(--clyro-accent-lime, #C7FF2E);
  color: var(--clyro-primary, #111417);
  font-weight: 800;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--clyro-radius-pill, 9999px);
}

.clyro-bundle-price-note .cbp-link {
  flex: 1 0 100%;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--clyro-primary, #111417);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------------- *
 * Galeria: produkt bez własnych zdjęć renderowany jest przez <picture>,
 * które nie dziedziczy wysokości kontenera — przez to zdjęcie wychodziło
 * poza kadr i było przycinane. Przywracamy pełne "contain".
 * ---------------------------------------------------------------- */
.main-image-slide-container picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.main-image-slide-container picture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
