.offers-widget {
  width: 100%;
  margin: 0 auto;
}

.offers-widget .offers-grid {
  display: grid;
  gap: var(--offers-gap, 24px);
}

.offer-card {
  border-radius: 15px;
  /* padding: 16px; */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.offer-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.offer-card__media {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.offer-card__img {
  width: 100%;
  height: 100% !important;
  object-fit: contain;
  display: block;
}

.offer-card__title {
  font-size: 64px !important;
  line-height: 55px !important;
  color: #fff;
}

.offer-card__moreline {
  text-align: start;
  font-size: var(--e-global-typography-accent-font-size, inherit);
  font-weight: 800;
  color: var(--stb-main-button-text-color, #fff);
  align-items: center;
  display: inline-flex;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 100px;
  overflow: hidden;
  background: linear-gradient(137deg, #c70f5d 0%, #ff1584 70.75%);
  box-shadow: 0 4px 4px rgb(var(--stb-white, 255 255 255)) inset,
    0 -5px 5px rgb(var(--stb-main-button-light, 255 255 255) / 0.9) inset,
    0 1px 3px rgb(var(--stb-brand-700, 154 34 0) / 0.3);
  text-shadow: 0 1px 0 rgb(var(--stb-red-500, 120 0 0)),
    0 2px 3px rgb(var(--stb-black, 0 0 0) / 0.2);
  /* No border as requested */
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.offer-card__moreline:hover,
.offer-card__moreline:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  outline: none;
  text-decoration: none;
}

@media (max-width: 1200px) {
  /* Center card layout on tablet */
  .offer-card {
    align-items: center;
  }

  .offer-card__body {
    align-items: center;
    min-width: 0; /* allow text to shrink and wrap */
  }

  .offer-card__title,
  .offer-card__desc,
  .offer-card__desc p {
    text-align: center;
  }

  .offer-card__moreline {
    align-self: center;
  }

  .offer-card__moreline {
    font-size: 0.75rem;
    padding: 10px 20px;
  }

  .offer-card__media {
    width: 100%;
    height: 260px; /* fixed container height on tablet */
    aspect-ratio: auto; /* disable ratio when fixed height used */
    margin: 16px 0 0;
  }

  .offer-card__img {
    width: 100%;
    height: 100% !important;
    object-fit: contain; /* fill container like background-size: cover */
    transform: none;
  }

  /* Enable word wrapping on tablet/mobile to avoid overflow */
  .offer-card__desc,
  .offer-card__desc p {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word; /* Safari/legacy support */
    hyphens: auto;
  }
}

/* Mobile overlay: info block overlaps the image using z-index */
@media (max-width: 767px) {
  .offer-card {
    position: relative;
  }
  .offer-card__body {
    position: relative;
    z-index: 2;
  }
  .offer-card__media {
    position: relative;
    z-index: 1;
    margin-top: -200px;
  }
}

/* (reverted) mobile keeps default flow */

@media (min-width: 1201px) {
  .offers-widget {
    max-width: 1200px;
  }

  .offer-card {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 37px; /* +15% spacing between media and body */
  }

  .offer-card__body {
    flex: 1 1 auto; /* harmless in grid */
    align-items: flex-start;
    max-width: none; /* allow full 2-column span */
    grid-column: 1 / span 2; /* text left */
  }

  .offer-card__title,
  .offer-card__desc,
  .offer-card__desc p {
    text-align: left;
    width: 100%;
  }

  .offer-card__media {
    margin: 0;
    max-width: none;
    grid-column: 3 / span 3; /* image right */
  }

  .offer-card__moreline {
    align-self: stretch;
  }

  /* Prevent long text from overflowing under the image */
  .offer-card__body {
    min-width: 0;
  }
  .offer-card__desc,
  .offer-card__desc p {
    overflow-wrap: anywhere;
    word-break: break-word; /* wider browser support */
  }
}

.offer-card__desc {
  font-size: var(--e-global-typography-primary-font-size, inherit);
  line-height: 1.4;
  color: #fff;
  text-align: start;
  /* margin: 0; */
}

.offer-card__cta {
  display: none !important;
}
