.kcc-offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.kcc-offers-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #222;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.kcc-offers-link {
  color: inherit;
  text-decoration: none;
}

/* The native link covers the preview too, including modified clicks. */
.kcc-offers-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.kcc-offers-card:hover {
  border-color: #777;
}

.kcc-offers-link:focus-visible::after,
.kcc-offers-back:focus-visible {
  outline: 3px solid #333;
  outline-offset: 4px;
}

.kcc-offers-link:focus-visible::after {
  outline-offset: -4px;
}

.kcc-offers-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f4f4f4;
}

.kcc-offers-card .kcc-offers-cover,
.kcc-offers-minipaper {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f4f4f4;
}

.kcc-offers-minipaper {
  border: 0;
  pointer-events: none;
}

.kcc-offers-card .kcc-offers-cover--missing {
  display: grid;
  place-items: center;
  color: #555;
  font-size: 1.4rem;
}

.kcc-offers-title {
  display: block;
  padding: 1rem;
  font-weight: 600;
}

.kcc-offers-grid.is-compact {
  display: flex;
  gap: 0.75rem;
  min-width: 0;
  overflow-x: auto;
  padding: 0.25rem;
  margin-bottom: 1rem;
}

.kcc-offers-grid.is-compact .kcc-offers-card {
  flex: 0 0 110px;
}

.kcc-offers-grid.is-compact .kcc-offers-title {
  padding: 0.5rem;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.kcc-offers-grid.is-compact .kcc-offers-cover--missing {
  font-size: 1rem;
}

.kcc-offers-card.is-active {
  border-color: #222;
  box-shadow: 0 0 0 2px #222;
}

.kcc-offers-card.is-active .kcc-offers-title {
  color: #fff;
  background: #222;
}

.kcc-offer-header {
  margin-bottom: 1rem;
}

/* Themes must not override visibility of the single-page views or inactive cards. */
.kcc-offers [hidden] {
  display: none !important;
}

#kcc-expand-offers {
  display: block;
  margin: 0;
  min-height: 44px;
  padding: 0.5rem 1rem;
  color: #fff;
  background: #222;
  border: 2px solid #222;
  border-radius: 4px;
  cursor: pointer;
}

#kcc-expand-offers:focus-visible,
.kcc-offers-pdf:focus-visible {
  outline: 3px solid #222;
  outline-offset: 3px;
}

#kcc-offers .kcc-catalog-share {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
}

.kcc-offers-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  min-width: 0;
}

#kcc-offers .kcc-catalog-share-status,
#kcc-offers .kcc-catalog-share-manual {
  grid-column: 1 / -1;
}

.kcc-offers-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  justify-self: end;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #222;
  background: #fff;
  border: 1px solid #777;
  border-radius: 4px;
  text-decoration: none;
}

.kcc-offers-pdf svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

/* Temporarily release fixed containing blocks, clipping and stacking contexts
   along this reader's ancestor path, including Elementor motion containers.
   No live iframe or iframe ancestor is reparented. */
.kcc-offers-expanded-ancestor {
  position: static !important;
  z-index: auto !important;
  transform: none !important;
  translate: none !important;
  rotate: none !important;
  scale: none !important;
  perspective: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  contain: none !important;
  container-type: normal !important;
  content-visibility: visible !important;
  will-change: auto !important;
  transition: none !important;
  isolation: auto !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  mask: none !important;
}

html.kcc-offers-expanded,
body.kcc-offers-expanded {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.kcc-offers-expanded {
  position: fixed !important;
  top: var(--kcc-offers-scroll-y) !important;
  left: var(--kcc-offers-scroll-x) !important;
  width: 100% !important;
}

#kcc-offers.is-expanded {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483646 !important;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(0.5rem, env(safe-area-inset-right, 0px))
    max(0.5rem, env(safe-area-inset-bottom, 0px)) max(0.5rem, env(safe-area-inset-left, 0px));
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: 0;
}

#kcc-offers.is-expanded > .kcc-offers-grid {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  max-height: 22dvh;
  box-sizing: border-box;
  margin: 0 0 0.25rem;
  overscroll-behavior-x: contain;
}

#kcc-offers.is-expanded .kcc-offers-card {
  flex: 0 0 11rem;
  flex-direction: row;
  align-items: center;
}

#kcc-offers.is-expanded .kcc-offers-media {
  flex: 0 0 42px;
  width: 42px;
  height: 56px;
}

#kcc-offers.is-expanded .kcc-offers-link {
  min-width: 0;
  flex: 1;
  align-self: stretch;
  display: flex;
  align-items: center;
}

#kcc-offers.is-expanded .kcc-offers-card.is-active {
  background: #222;
}

#kcc-offers-status:empty {
  display: none;
}

#kcc-offers.is-expanded > #kcc-campaign-catalog {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  width: 100%;
  height: auto;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: auto;
}

#kcc-offers .kcc-offer-header {
  /* Keep the publication heading available to assistive technology. */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#kcc-offers.is-expanded .kcc-catalog-share {
  flex-shrink: 0;
  padding: 0.25rem 0;
}

#kcc-offers.is-expanded #kcc-campaign-catalog > .kcc-ipaper-viewer-shell {
  flex: 1 1 0;
  height: auto;
  min-height: 80px;
  max-height: none;
}

body.kcc-offers-expanded > .kcc-product-drawer {
  padding-top: max(1rem, env(safe-area-inset-top, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  overscroll-behavior: contain;
}
