/* =========================================================
   WIR WEBEPARTNERS - STYLE FRONTEND
   Plik: style.css
   ========================================================= */

/* ============================
   RAMKA GŁÓWNA Z LISTĄ OFERT
   ============================ */

.wir-webe-offers {
  max-width: 900px;
  width: 100%;
  margin: 30px auto;
  padding: 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  font-family: inherit;
}

/* ============================
   POJEDYNCZA OFERTA - LISTA
   ============================ */

.wir-webe-offer {
  margin: 20px 0;
}

.wir-webe-offer img,
.wir-webe-thumb {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  margin: 0 auto 10px auto;
  cursor: pointer;
}

.wir-webe-offer h2:not(.wir-webe-price) {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.35;
}

.wir-webe-title-link a {
  color: #111111 !important;
  text-decoration: none;
  font-weight: 600;
}

.wir-webe-title-link a:hover {
  color: #fb0606 !important;
  text-decoration: underline;
}

.wir-webe-price {
  font-size: 21px;
  font-weight: 600 !important;
  text-align: left;
  margin-top: 12px;
  margin-bottom: 12px;
  color: #fb0606 !important;
}

.wir-webe-description,
.wir-webe-offer p {
  font-size: 16px !important;
  line-height: 1.6 !important;
  color: #222222;
}

.wir-webe-offer p {
  display: block;
  margin: 0 0 0.8em 0;
}

/* ============================
   PRZYCISKI OFERT - LISTA
   ============================ */

.wir-webe-btn-link {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 24px;
  background: #fb0606;
  color: #ffffff !important;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  box-sizing: border-box;
  max-width: 100%;
  text-align: center;
}

.wir-webe-btn-link:hover {
  background: #cc0000;
  color: #ffffff !important;
}

.wir-webe-secondary-link {
  background: #ffffff !important;
  color: #555555 !important;
  border: 1px solid #cccccc !important;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  margin-right: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  max-width: 100%;
}

.wir-webe-secondary-link:hover {
  color: #fb0606 !important;
  border-color: #fb0606 !important;
  background: #ffffff !important;
}

/* ============================
   LINIE
   ============================ */

.wir-webe-offers hr {
  border: 0;
  border-top: 1px solid #e2e2e2;
  margin: 20px 0;
}

.wir-webe-top-hr {
  border: 0;
  border-top: 1px solid #e2e2e2;
  margin: 15px 0 20px 0;
}

/* ============================
   STARA WYSZUKIWARKA - KOMPATYBILNOŚĆ
   ============================ */

.wir-webe-search-form {
  margin-bottom: 10px;
}

.wir-webe-search-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#wir-webe-search {
  flex: 1;
  padding: 10px 16px;
  font-size: 16px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  background: #ffffff;
  color: #222222;
  box-sizing: border-box;
}

#wir-webe-search::placeholder {
  color: #999999;
}

#wir-webe-search:focus {
  outline: none;
  border-color: #e60000;
  box-shadow: 0 0 0 1px rgba(230, 0, 0, 0.25);
}

.wir-webe-btn {
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: 600;
  background: #fb0606 !important;
  color: #ffffff !important;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-sizing: border-box;
  text-transform: none;
}

.wir-webe-btn:hover {
  background: #cc0000 !important;
  color: #ffffff !important;
}

/* ============================
   LICZNIK / SORTOWANIE - KOMPATYBILNOŚĆ
   ============================ */

.wir-webe-counter {
  margin-bottom: 16px;
  font-size: 16px;
  color: #222222;
}

.wir-webe-found-sort {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 14px;
  flex-wrap: wrap;
}

#wir-webe-found-box {
  white-space: nowrap;
}

#wir-webe-found-count {
  font-weight: 600;
}

.wir-webe-sort-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.wir-webe-sort-option input[type="radio"] {
  accent-color: #fb0606;
}

.wir-webe-sort-option.wir-webe-sort-active span {
  color: #fb0606;
  font-weight: 600;
}

#wir-webe-price-range {
  flex: 0 0 100%;
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#wir-webe-price-range input {
  width: 100%;
  max-width: 420px;
  padding: 10px 16px;
  font-size: 16px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  background: #ffffff;
  color: #222222;
  box-sizing: border-box;
}

#wir-webe-price-range input:focus {
  outline: none;
  border-color: #e60000;
  box-shadow: 0 0 0 1px rgba(230, 0, 0, 0.25);
}

#wir-webe-results {
  margin-top: 10px;
}

/* =========================================================
   KAFELKI
   ========================================================= */

.wir-webe-tiles-wrap {
  max-width: 1280px;
  width: 100%;
  margin: 30px auto;
  padding: 20px;
  box-sizing: border-box;
}

.wir-webe-tiles-grid {
  display: grid;
  gap: 18px;
}

.wir-webe-tiles-3 .wir-webe-tiles-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wir-webe-tiles-4 .wir-webe-tiles-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wir-webe-tiles-5 .wir-webe-tiles-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.wir-webe-tiles-6 .wir-webe-tiles-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.wir-webe-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.wir-webe-tile-image {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  text-decoration: none;
}

.wir-webe-tile img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  cursor: pointer;
}

.wir-webe-tile h3 {
  font-size: 16px;
  line-height: 1.35;
  margin: 0 0 10px;
  font-weight: 600;
}

.wir-webe-tile h3 a {
  color: #111111;
  text-decoration: none;
}

.wir-webe-tile h3 a:hover {
  color: #fb0606;
  text-decoration: underline;
}

.wir-webe-tile-price {
  font-size: 17px;
  font-weight: 600;
  color: #fb0606 !important;
  margin: 0 0 12px;
}

.wir-webe-tile-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.wir-webe-tile-details,
.wir-webe-tile-buy {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  line-height: 1.2;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
}

.wir-webe-tile-details {
  background: #ffffff;
  color: #111111 !important;
  border: 1px solid #dddddd;
}

.wir-webe-tile-buy {
  background: #fb0606;
  color: #ffffff !important;
  border: 1px solid #fb0606;
}

.wir-webe-tile-details:hover,
.wir-webe-tile-buy:hover {
  opacity: 0.9;
}

/* =========================================================
   ZAAWANSOWANA WYSZUKIWARKA
   ========================================================= */

.wir-webe-advanced-search {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto auto;
  gap: 10px;
  margin-bottom: 18px;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  align-items: end;
}

.wir-webe-advanced-search .wir-filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.wir-webe-advanced-search label {
  font-size: 12px;
  font-weight: 600;
  color: #222222;
}

.wir-webe-advanced-search input,
.wir-webe-advanced-search select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  background: #ffffff;
  color: #222222;
  font-size: 14px;
  font-weight: 400;
  box-sizing: border-box;
}

.wir-webe-advanced-search input:focus,
.wir-webe-advanced-search select:focus {
  outline: none;
  border-color: #e60000;
  box-shadow: 0 0 0 1px rgba(230, 0, 0, 0.25);
}

.wir-filter-submit {
  padding: 12px 24px;
  background: #fb0606;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 43px;
  box-sizing: border-box;
}

.wir-filter-submit:hover {
  background: #cc0000;
}

.wir-filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 24px;
  background: #ffffff;
  color: #111111 !important;
  border: 1px solid #cccccc;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  box-sizing: border-box;
}

.wir-filter-clear:hover {
  border-color: #fb0606;
  color: #fb0606 !important;
}

/* =========================================================
   PAGINACJA
   ========================================================= */

.wir-webe-pagination,
.wir-webe-light-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 24px 0 0;
  flex-wrap: wrap;
  text-align: center;
}

.wir-webe-pagination a,
.wir-webe-pagination span,
.wir-webe-light-pagination a,
.wir-webe-light-pagination span {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  box-sizing: border-box;
  border: 1px solid #e1e1e1;
  background: #ffffff;
  color: #111111;
  line-height: 1;
}

.wir-webe-pagination .current,
.wir-webe-light-pagination .current {
  background: #fb0606 !important;
  color: #ffffff !important;
  border-color: #fb0606 !important;
  box-shadow: 0 8px 18px rgba(251, 6, 6, 0.28);
}

.wir-webe-pagination .disabled,
.wir-webe-light-pagination .disabled {
  color: #bbbbbb;
  background: #f8f8f8;
  border-color: #eeeeee;
}

.wir-webe-pagination .dots,
.wir-webe-light-pagination .dots {
  border: 0;
  background: transparent;
  min-width: 28px;
  color: #777777;
  box-shadow: none;
}

.wir-webe-pagination a:hover,
.wir-webe-light-pagination a:hover {
  border-color: #fb0606;
  color: #fb0606;
}

/* =========================================================
   LIGHTBOX
   ========================================================= */

.wir-webe-lightbox-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 999999;
}

.wir-webe-lightbox-bg.show {
  opacity: 1;
  visibility: visible;
}

.wir-webe-lightbox-bg img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background: #ffffff;
}

body.wir-lightbox-open {
  overflow: hidden;
}

/* =========================================================
   SKRACANIE OPISU OFERT
   ========================================================= */

.wir-webe-description {
  margin: 12px 0 15px;
}

.wir-webe-description-inner {
  max-height: 220px;
  overflow: hidden;
  position: relative;
}

.wir-webe-description-inner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  background: linear-gradient(to top, #ffffff, transparent);
  pointer-events: none;
}

.wir-webe-description-inner.is-expanded {
  max-height: none;
}

.wir-webe-description-inner.is-expanded::after {
  display: none;
}

.wir-webe-desc-toggle {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 16px;
  border-radius: 8px;
  background: #ffffff !important;
  color: #666666 !important;
  cursor: pointer;
  border: 1px solid #cccccc !important;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.wir-webe-desc-toggle:hover {
  color: #fb0606 !important;
  border-color: #fb0606 !important;
  background: #ffffff !important;
}

/* =========================================================
   SINGLE OFERTA - ZABEZPIECZENIA
   ========================================================= */

body.single-wir_webe_offer .js-webe-desc,
body.single.post-type-wir_webe_offer .js-webe-desc {
  max-height: none !important;
  overflow: visible !important;
}

body.single-wir_webe_offer .js-webe-desc-toggle,
body.single.post-type-wir_webe_offer .js-webe-desc-toggle {
  display: none !important;
}

.single-wir_webe_offer .wir-webe-description-inner {
  max-height: none !important;
  overflow: visible !important;
}

.single-wir_webe_offer .wir-webe-description-inner::after {
  display: none !important;
}

/* POPRAWKA SINGLE MOBILE - przyciski nie wychodzą poza ekran */
.wir-webe-single-actions {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.wir-webe-single-buy,
.wir-webe-single-print,
.wir-webe-single-back-link {
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.wir-webe-single-buy {
  overflow-wrap: anywhere;
}

/* =========================================================
   RESPONSYWNOŚĆ
   ========================================================= */

@media (max-width: 1300px) {
  .wir-webe-tiles-6 .wir-webe-tiles-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .wir-webe-advanced-search {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

@media (max-width: 1150px) {
  .wir-webe-tiles-5 .wir-webe-tiles-grid,
  .wir-webe-tiles-6 .wir-webe-tiles-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .wir-webe-tiles-3 .wir-webe-tiles-grid,
  .wir-webe-tiles-4 .wir-webe-tiles-grid,
  .wir-webe-tiles-5 .wir-webe-tiles-grid,
  .wir-webe-tiles-6 .wir-webe-tiles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wir-webe-advanced-search {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .wir-webe-single-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    gap: 10px;
    overflow: hidden;
  }

  .wir-webe-single-buy,
  .wir-webe-single-print,
  .wir-webe-single-back-link {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-left: 14px;
    padding-right: 14px;
    box-sizing: border-box;
  }
}

@media (max-width: 560px) {
  .wir-webe-offers,
  .wir-webe-tiles-wrap {
    padding: 12px;
  }

  .wir-webe-tiles-3 .wir-webe-tiles-grid,
  .wir-webe-tiles-4 .wir-webe-tiles-grid,
  .wir-webe-tiles-5 .wir-webe-tiles-grid,
  .wir-webe-tiles-6 .wir-webe-tiles-grid {
    grid-template-columns: 1fr;
  }

  .wir-webe-advanced-search {
    grid-template-columns: 1fr;
  }

  .wir-webe-pagination a,
  .wir-webe-pagination span,
  .wir-webe-light-pagination a,
  .wir-webe-light-pagination span {
    min-width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .wir-webe-tile-actions {
    flex-direction: column;
  }

  .wir-webe-tile-details,
  .wir-webe-tile-buy {
    width: 100%;
  }

  .wir-webe-secondary-link {
    width: 100%;
    margin-right: 0;
    margin-bottom: 8px;
  }

  .wir-webe-btn-link {
    width: 100%;
  }
}