/* ==========================================================================
   OFFERS BLOCK - Main Styles
   ========================================================================== */

.content-block.block-width-full-width.offers-block {
  padding-left: 0;
  padding-right: 0;
}

/* ==========================================================================
   GRID LAYOUT
   ========================================================================== */

.gutter-wrap {
  border-bottom: 1px solid #D5D5D5;
  overflow: hidden;
}

.offers-loop-wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.offers-loop-wrap article {
  box-sizing: border-box;
  padding: 30px;
  padding-bottom: clamp(40px, 10vw, 55px);
  position: relative;
  border-right: 1px solid #D5D5D5;
  border-bottom: 1px solid #D5D5D5;
}

/* Remove right border on last column */
.offers-loop-wrap article:nth-of-type(3n) {
  border-right: none;
}

/* ==========================================================================
   ARTICLE CONTENT
   ========================================================================== */

.offers-loop-wrap .inside-article {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.offers-loop-wrap .offer-top-wrap {
  height: 100%;
}

.offers-loop-wrap article .post-image {
  margin-top: 0;
}

.offers-loop-wrap article img {
  display: block;
  width: 100%;
  object-fit: cover;
  height: 100%;
  max-height: 875px;
  aspect-ratio: 800 / 533;
}

.offers-loop-wrap .post-content-wrap {
  padding: 24px 30px 0 30px;
  max-width: 600px;
}

.offers-loop-wrap h3.entry-title {
  margin-bottom: 20px;
}

.content-block .offers-loop-wrap p:last-child {
  margin-bottom: 1.5em;
}

.offers-loop-wrap .content-block-button-wrap {
  display: flex;
  gap: 15px 20px;
  flex-wrap: wrap;
  margin-top: 35px;
  padding: 0 30px;
}

.offers-loop-wrap .content-block-button-wrap .lsb-button {
  min-width: 168px;
}

/* ==========================================================================
   FILTERS - Layout, Facet + Button
   ========================================================================== */

.offers-filters-block {
  position: relative;
  margin-bottom: 40px !important;
}

.offers-filters-block .block-inner {
  position: absolute;
  bottom: -40px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  left: 0;
  right: 0;
}

.offers-filters-block .offers-filters {
  width: 100%;
}

.offers-filters-inner {
  display: flex;
  align-items: center;
  height: 80px;
  justify-content: center;
}

.offers-facet {
  flex: 1 1 auto;
  max-width: 288px;
  height: 100%;
}

.offers-apply-button {
  flex: 0 0 auto;
  height: 100%;
  width: 100%;
  max-width: 208px;
  padding: 0;
  border-radius: 0;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Raleway', sans-serif;
  background: var(--primary-colour);
  color: #fff;
  text-transform: uppercase;
}

.offers-apply-button:hover {
  background: var(--secondary-colour);
}

.offers-apply-button.is-disabled,
.offers-apply-button:disabled {
  cursor: not-allowed;
}

.offers-filters-block .facetwp-facet {
  margin-bottom: 0;
  height: 100%;
  opacity: 1 !important;
}

/* ==========================================================================
   SELECT2 STYLING
   ========================================================================== */

.offers-filters-block .select2-container {
  height: 100%;
  width: 100% !important;
}

.offers-filters-block .select2-container .select2-selection--single {
  height: 100%;
  border: 1px solid #D5D5D5;
  border-radius: 0;
  padding: 14px;
  display: flex;
}

.facetwp-facet-offer_category .select2-selection--single,
.facetwp-facet-offer_hotel .select2-selection--single {
  padding: 6px 10px;
  box-sizing: border-box;
}

.offers-filters-block .select2-selection__arrow {
  height: 100%;
  display: flex;
  align-items: center;
  width: auto !important;
  top: initial !important;
  right: 14px !important;
  bottom: 17px !important;
}

.offers-filters-block .select2-selection__arrow b {
  display: none;
}

.offers-filters-block .select2-selection__arrow::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background-image: url("/wp-content/uploads/2025/12/filter-down-arrow.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.filter-selection {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.offers-filters-block .select2-selection__clear {
  top: 8px;
  right: 8px;
  position: absolute;
  margin: 0 !important;
  color: var(--secondary-colour);
  width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px !important;
  padding: 0 !important;
}

.offers-filters-block .select2-selection__rendered {
  color: inherit !important;
  line-height: inherit !important;
  padding: 0 !important;
}

.offers-filters-block .select2-selection__placeholder {
  height: 100%;
  display: flex;
}

.filter-selection .filter-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--secondary-colour);
}

.filter-selection .filter-value {
  color: #162B29;
  line-height: 1.5;
  font-size: 18px;
}

.offers-filters-block .select2-selection__placeholder .filter-selection .filter-value {
  opacity: 0.8;
}

.offers-no-results {
  text-align: center;
  padding: 40px 0;
}

/* ==========================================================================
   CATEGORIES STYLE
   Uses flexbox for centered orphan rows, pseudo-elements for aligned borders
   ========================================================================== */

.offers-style-categories .offers-category-heading {
  padding-top: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #D5D5D5;
  text-align: center;
}

.offers-style-categories .offers-category-heading h2 {
  margin-bottom: 0;
}

.offers-style-categories .offers-loop-wrap {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.offers-style-categories .offers-loop-wrap article {
  flex: 0 0 33.3333%;
  max-width: 33.3333%;
}

/* --- Categories: 1 item total --- */
.gutter-wrap.offers-total1 {
  border-bottom: 1px solid #D5D5D5;
}
.offers-total1 .offers-loop-wrap article {
  position: relative;
  border-bottom: 0;
}
/* Left border via pseudo-element, positioned to align with border-right above */
.offers-total1 .offers-loop-wrap article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #D5D5D5;
  transform: translateX(-1px);
}

/* --- Categories: 2 items total --- */
.gutter-wrap.offers-total2 {
  border-bottom: 1px solid #D5D5D5;
}
.offers-total2 .offers-loop-wrap article:first-of-type {
  position: relative;
}
.offers-total2 .offers-loop-wrap article:first-of-type::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #D5D5D5;
  transform: translateX(-1px);
}
.offers-total2 .offers-loop-wrap article {
  border-bottom: 0;
}

/* --- Categories: 1 orphan (4, 7, 10, 13, 16, 19, 22 items) --- */
.offers-total4 .offers-loop-wrap article:last-of-type,
.offers-total7 .offers-loop-wrap article:last-of-type,
.offers-total10 .offers-loop-wrap article:last-of-type,
.offers-total13 .offers-loop-wrap article:last-of-type,
.offers-total16 .offers-loop-wrap article:last-of-type,
.offers-total19 .offers-loop-wrap article:last-of-type,
.offers-total22 .offers-loop-wrap article:last-of-type {
  position: relative;
  border-bottom: 0;
}
.offers-total4 .offers-loop-wrap article:last-of-type::before,
.offers-total7 .offers-loop-wrap article:last-of-type::before,
.offers-total10 .offers-loop-wrap article:last-of-type::before,
.offers-total13 .offers-loop-wrap article:last-of-type::before,
.offers-total16 .offers-loop-wrap article:last-of-type::before,
.offers-total19 .offers-loop-wrap article:last-of-type::before,
.offers-total22 .offers-loop-wrap article:last-of-type::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #D5D5D5;
  transform: translateX(-1px);
}

/* --- Categories: 2 orphans (5, 8, 11, 14, 17, 20, 23 items) --- */
.offers-total5 .offers-loop-wrap article:nth-last-child(2),
.offers-total8 .offers-loop-wrap article:nth-last-child(2),
.offers-total11 .offers-loop-wrap article:nth-last-child(2),
.offers-total14 .offers-loop-wrap article:nth-last-child(2),
.offers-total17 .offers-loop-wrap article:nth-last-child(2),
.offers-total20 .offers-loop-wrap article:nth-last-child(2),
.offers-total23 .offers-loop-wrap article:nth-last-child(2) {
  position: relative;
  border-bottom: 0;
}
.offers-total5 .offers-loop-wrap article:nth-last-child(2)::before,
.offers-total8 .offers-loop-wrap article:nth-last-child(2)::before,
.offers-total11 .offers-loop-wrap article:nth-last-child(2)::before,
.offers-total14 .offers-loop-wrap article:nth-last-child(2)::before,
.offers-total17 .offers-loop-wrap article:nth-last-child(2)::before,
.offers-total20 .offers-loop-wrap article:nth-last-child(2)::before,
.offers-total23 .offers-loop-wrap article:nth-last-child(2)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #D5D5D5;
  transform: translateX(-1px);
}
.offers-total5 .offers-loop-wrap article:last-of-type,
.offers-total8 .offers-loop-wrap article:last-of-type,
.offers-total11 .offers-loop-wrap article:last-of-type,
.offers-total14 .offers-loop-wrap article:last-of-type,
.offers-total17 .offers-loop-wrap article:last-of-type,
.offers-total20 .offers-loop-wrap article:last-of-type,
.offers-total23 .offers-loop-wrap article:last-of-type {
  border-bottom: 0;
}

/* --- Categories: Full rows (3, 6, 9, 12, 15, 18, 21, 24 items) --- 
   Remove bottom border from last 3 items since gutter-wrap has border-bottom */
.offers-total3 .offers-loop-wrap article:nth-last-child(-n+3),
.offers-total6 .offers-loop-wrap article:nth-last-child(-n+3),
.offers-total9 .offers-loop-wrap article:nth-last-child(-n+3),
.offers-total12 .offers-loop-wrap article:nth-last-child(-n+3),
.offers-total15 .offers-loop-wrap article:nth-last-child(-n+3),
.offers-total18 .offers-loop-wrap article:nth-last-child(-n+3),
.offers-total21 .offers-loop-wrap article:nth-last-child(-n+3),
.offers-total24 .offers-loop-wrap article:nth-last-child(-n+3) {
  border-bottom: 0;
}

/* ==========================================================================
   RESPONSIVE - Tablet & Below
   ========================================================================== */

@media (max-width: 768px) {
  .offers-filters-inner {
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }

  .offers-apply-button {
    width: 100%;
    height: auto;
    margin-top: 0.5rem;
  }

  .offers-filters-block .select2-container,
  .offers-filters-block .select2-container .select2-selection--single {
    height: auto;
  }
}

@media (max-width: 1600px) {
  .offers-loop-wrap .post-content-wrap {
    padding: 24px 15px 0 15px;
  }
  .offers-loop-wrap .content-block-button-wrap {
    padding: 0 15px;
  }
}

@media (max-width: 1280px) {
  .offers-loop-wrap .post-content-wrap {
    padding: 24px 0 0 0;
    max-width: 768px;
  }
  .offers-loop-wrap .content-block-button-wrap {
    padding: 0;
  }
}

@media (max-width: 768px) {
  .offers-loop-wrap {
    grid-template-columns: 1fr;
  }

  .offers-loop-wrap article {
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid #D5D5D5;
  }

  .offers-loop-wrap article:last-of-type {
    border-bottom: none;
  }

  .offers-loop-wrap article img {
    max-height: 500px;
    height: auto;
  }

  /* Reset categories to single column */
  .offers-style-categories .offers-loop-wrap {
    display: block;
  }

  .offers-style-categories .offers-loop-wrap article {
    max-width: 100%;
  }

  /* Hide all pseudo-element left borders on mobile */
  .offers-total1 .offers-loop-wrap article::before,
  .offers-total2 .offers-loop-wrap article:first-of-type::before,
  .offers-total4 .offers-loop-wrap article:last-of-type::before,
  .offers-total7 .offers-loop-wrap article:last-of-type::before,
  .offers-total10 .offers-loop-wrap article:last-of-type::before,
  .offers-total13 .offers-loop-wrap article:last-of-type::before,
  .offers-total16 .offers-loop-wrap article:last-of-type::before,
  .offers-total19 .offers-loop-wrap article:last-of-type::before,
  .offers-total22 .offers-loop-wrap article:last-of-type::before,
  .offers-total5 .offers-loop-wrap article:nth-last-child(2)::before,
  .offers-total8 .offers-loop-wrap article:nth-last-child(2)::before,
  .offers-total11 .offers-loop-wrap article:nth-last-child(2)::before,
  .offers-total14 .offers-loop-wrap article:nth-last-child(2)::before,
  .offers-total17 .offers-loop-wrap article:nth-last-child(2)::before,
  .offers-total20 .offers-loop-wrap article:nth-last-child(2)::before,
  .offers-total23 .offers-loop-wrap article:nth-last-child(2)::before {
    display: none;
  }

  /* Reset bottom borders for mobile */
  .offers-total1 .offers-loop-wrap article,
  .offers-total2 .offers-loop-wrap article,
  .offers-total3 .offers-loop-wrap article:nth-last-child(-n+3),
  .offers-total4 .offers-loop-wrap article:last-of-type,
  .offers-total5 .offers-loop-wrap article:nth-last-child(2),
  .offers-total5 .offers-loop-wrap article:last-of-type,
  .offers-total6 .offers-loop-wrap article:nth-last-child(-n+3),
  .offers-total7 .offers-loop-wrap article:last-of-type,
  .offers-total8 .offers-loop-wrap article:nth-last-child(2),
  .offers-total8 .offers-loop-wrap article:last-of-type,
  .offers-total9 .offers-loop-wrap article:nth-last-child(-n+3),
  .offers-total10 .offers-loop-wrap article:last-of-type,
  .offers-total11 .offers-loop-wrap article:nth-last-child(2),
  .offers-total11 .offers-loop-wrap article:last-of-type,
  .offers-total12 .offers-loop-wrap article:nth-last-child(-n+3),
  .offers-total13 .offers-loop-wrap article:last-of-type,
  .offers-total14 .offers-loop-wrap article:nth-last-child(2),
  .offers-total14 .offers-loop-wrap article:last-of-type,
  .offers-total15 .offers-loop-wrap article:nth-last-child(-n+3),
  .offers-total16 .offers-loop-wrap article:last-of-type,
  .offers-total17 .offers-loop-wrap article:nth-last-child(2),
  .offers-total17 .offers-loop-wrap article:last-of-type,
  .offers-total18 .offers-loop-wrap article:nth-last-child(-n+3),
  .offers-total19 .offers-loop-wrap article:last-of-type,
  .offers-total20 .offers-loop-wrap article:nth-last-child(2),
  .offers-total20 .offers-loop-wrap article:last-of-type,
  .offers-total21 .offers-loop-wrap article:nth-last-child(-n+3),
  .offers-total22 .offers-loop-wrap article:last-of-type,
  .offers-total23 .offers-loop-wrap article:nth-last-child(2),
  .offers-total23 .offers-loop-wrap article:last-of-type,
  .offers-total24 .offers-loop-wrap article:nth-last-child(-n+3) {
    border-bottom: 1px solid #D5D5D5;
  }

  .gutter-wrap.offers-total1,
  .gutter-wrap.offers-total2 {
    border-bottom: none;
  }
}

@media (max-width: 414px) {
  .offers-loop-wrap .content-block-button-wrap .lsb-button {
    width: 100%;
  }
}
