/*
 * Bank / card / UPI offers carousel. Used by templates/partials/payment-offers-strip.php
 * (Default storefront) and by the custom storefront templates, which mount it from
 * storefront/assets/custom-storefront.js. Markup is built by js/payment-offers.js.
 */
.pay-offers { margin: 18px 0 6px; }
.pay-offers[hidden] { display: none !important; }

.pay-offers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.pay-offers-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
  /* One line on every screen: scale with the viewport, never wrap, ellipsis as a last resort. */
  font-size: clamp(0.88rem, 3.6vw, 1.05rem);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--theme-text, #212529);
}
.pay-offers-title .po-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pay-offers-title .po-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9f1c, #ff5e62);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 3px 8px rgba(255, 94, 98, 0.35);
}
.pay-offers-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--theme-text-muted, #6c757d);
  white-space: nowrap;
  flex-shrink: 0;
}

.pay-offers-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 2px 6px;
}
.pay-offers-track::-webkit-scrollbar { display: none; }

.po-card {
  --po-from: #6a11cb;
  --po-to: #2575fc;
  position: relative;
  flex: 0 0 320px;
  max-width: 86%;
  min-height: 104px;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: 12px;
  /* Bottom room for the "T&C apply" corner label so it never sits on the chips. */
  padding: 14px 14px 22px 12px;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  color: #fff;
  background: linear-gradient(120deg, var(--po-from), var(--po-to));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.po-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16); }
.po-card:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.9); outline-offset: -5px; }
.po-card[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85) inset, 0 8px 20px rgba(0, 0, 0, 0.18); }

/* Decorative rings, like the grocery apps' offer banners. */
.po-card::before,
.po-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.po-card::before { width: 130px; height: 130px; right: -40px; top: -55px; }
.po-card::after { width: 80px; height: 80px; right: 40px; bottom: -45px; background: rgba(255, 255, 255, 0.08); }

.po-icon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff;
  color: var(--po-from);
  font-size: 1.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.po-body { position: relative; z-index: 1; flex: 1; min-width: 0; }
.po-issuer {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.po-headline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
}
.po-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.95;
}
.po-sub span { padding: 1px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.16); }
.po-tnc {
  position: absolute;
  right: 10px;
  bottom: 6px;
  z-index: 1;
  font-size: 0.6rem;
  font-weight: 600;
  opacity: 0.8;
}

.pay-offers-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}
.pay-offers-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--theme-border, #ced4da);
  transition: width 0.25s ease, background 0.25s ease;
}
.pay-offers-dots button.active { width: 20px; background: var(--theme-primary, #0d6efd); }

.pay-offers-detail {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--theme-border, #ced4da);
  border-radius: 12px;
  background: var(--theme-surface, #fff);
  color: var(--theme-text, #212529);
  font-size: 0.8rem;
  line-height: 1.45;
}
.pay-offers-detail strong { display: block; margin-bottom: 4px; font-size: 0.88rem; }
.pay-offers-detail .po-detail-meta { color: var(--theme-text-muted, #6c757d); margin-top: 6px; }

.pay-offers-note {
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--theme-text-muted, #6c757d);
  text-align: center;
}

.pay-offers-skeleton { display: flex; gap: 12px; overflow: hidden; }
.pay-offers-skeleton span {
  flex: 0 0 320px;
  max-width: 86%;
  height: 104px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.11) 50%, rgba(0,0,0,0.06) 75%);
  background-size: 200% 100%;
  animation: poShimmer 1.3s infinite linear;
}
@keyframes poShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Product page: tighter, sits in the buy column. */
.pay-offers--product { margin: 4px 0 16px; }
.pay-offers--product .pay-offers-title { font-size: clamp(0.85rem, 3.4vw, 0.95rem); }
.pay-offers--product .po-card,
.pay-offers--product .pay-offers-skeleton span { flex-basis: 280px; min-height: 88px; height: auto; }
.pay-offers--product .pay-offers-skeleton span { height: 88px; }
.pay-offers--product .po-icon { width: 44px; height: 44px; font-size: 1.25rem; border-radius: 12px; }
.pay-offers--product .po-headline { font-size: 0.86rem; }

.pay-offers--home { padding: 0 20px; }

@media (max-width: 576px) {
  .pay-offers--home { padding: 0 12px; }
  .po-card, .pay-offers-skeleton span { flex-basis: 84%; }
}
@media (prefers-reduced-motion: reduce) {
  .pay-offers-track { scroll-behavior: auto; }
  .po-card { transition: none; }
  .pay-offers-skeleton span { animation: none; }
}

/* ── Custom storefront templates (Aura Professional, Sélene Beauty, Giva Luxe) ── */
.sf-body .pay-offers { margin: 28px auto 8px; }
/* The SPA wraps the home strip in .sf-container, which already supplies the gutter. */
.sf-body .pay-offers--home { padding: 0; }
.sf-body .pay-offers-title { font-family: var(--sf-heading); color: var(--sf-ink); font-size: clamp(0.9rem, 3.8vw, 1.25rem); }
.sf-body .pay-offers-count,
.sf-body .pay-offers-note { color: var(--sf-muted); }
.sf-body .pay-offers-dots button { background: var(--sf-line); }
.sf-body .pay-offers-dots button.active { background: var(--sf-accent); }
.sf-body .pay-offers-detail { background: var(--sf-paper); border-color: var(--sf-line); color: var(--sf-ink); }
.sf-body .po-card { font-family: var(--sf-body-font); }
.sf-body .pay-offers--product { margin: 16px 0 18px; }
.sf-body .pay-offers--product .pay-offers-title { font-size: clamp(0.85rem, 3.5vw, 1.05rem); }

/* Sélene and Giva are editorial themes with near-square corners and a muted palette;
   the offer cards follow suit instead of shouting in saturated app colours. */
body[data-storefront-theme="selene_beauty"] .po-card,
body[data-storefront-theme="selene_beauty"] .pay-offers-skeleton span { border-radius: 4px; }
body[data-storefront-theme="selene_beauty"] .po-icon { border-radius: 50%; }
body[data-storefront-theme="selene_beauty"] .pay-offers-title .po-title-icon { background: var(--sf-accent); box-shadow: none; }
body[data-storefront-theme="giva_luxe"] .po-card,
body[data-storefront-theme="giva_luxe"] .pay-offers-skeleton span { border-radius: 12px; }
body[data-storefront-theme="giva_luxe"] .pay-offers-title .po-title-icon { background: var(--sf-accent); box-shadow: none; }
body[data-storefront-theme="aura_professional"] .pay-offers-title { text-transform: uppercase; letter-spacing: .01em; font-weight: 800; }
