.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;
  border-radius: inherit; /* follow container rounding */
}

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

.offer-card__moreline {
  text-align: start;
  font-size: var(--e-global-typography-primary-font-size, inherit);
  font-weight: 900;
  color: #fff !important; /* ensure white text */
  align-items: center;
  display: inline-flex;
  justify-content: center;
  padding: 22px 30px;
  overflow: hidden;
  /* default look (will be overridden below by site-specific image) */
  background: var(--e-global-color-d665ab1, #d665ab);
  background-repeat: no-repeat;
  clip-path: none;
  /* No border as requested */
  text-decoration: none !important;
  font-size: 28px;
  font-style: italic;
  text-transform: uppercase;
  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 {
  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: 34px !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: 1.25rem;
    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 */
  }

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

/* ===== Site-specific: golden pill background button ===== */
.offers-widget .offer-card__moreline {
  /* Use provided image as full background (no crop) */
  background-image: url("/wp-content/uploads/2025/10/super-primary_desktop.4422bbeb192a9c2f.webp") !important;
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;

  /* Shape/box */
  border-radius: 999px !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  box-shadow: none !important;
  transform-origin: center center !important;
  transition: transform 0.2s ease !important;

  /* Sizing: width from content, height from aspect ratio */
  display: inline-grid !important;
  place-items: center;
  padding: 0 40px !important;
  width: fit-content !important;
  height: auto !important;
  aspect-ratio: 500 / 174; /* original image ratio */
}

.offers-widget .offer-card__moreline:hover,
.offers-widget .offer-card__moreline:focus-visible {
  box-shadow: none !important;
  transform: scale(1.05) !important;
}
