.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: 58px !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: #fff !important; /* ensure white text */
  align-items: center;
  display: inline-flex;
  justify-content: center;
  padding: 14px 32px;
  overflow: hidden;
  border-radius: 25px;
  background: var(--e-global-color-d665ab1);
  /* 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;
}

/* Keep link text white and set red hover background */
a.offer-card__moreline,
a.offer-card__moreline:link,
a.offer-card__moreline:visited {
  color: #fff !important;
}

a.offer-card__moreline:hover,
a.offer-card__moreline:focus-visible {
  background: #d31717 !important;
  color: #fff !important;
}

@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 */
  }

  /* Tablet typography */
  .offer-card__title {
    font-size: 40px !important;
    line-height: 1.15 !important;
  }

  .offer-card__desc,
  .offer-card__desc p {
    font-size: 16px;
    line-height: 1.5;
  }

  .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;
  }

  /* Mobile typography */
  .offer-card__title {
    font-size: 28px !important;
    line-height: 1.2 !important;
  }

  .offer-card__desc,
  .offer-card__desc p {
    font-size: 14px;
    line-height: 1.5;
  }
}

/* (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: 22px;
  line-height: 1.4;
  color: #fff;
  text-align: start;
  /* margin: 0; */
}

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