/* ---------- Hero ---------- */
.ap-hero { text-align: center; }
/* Pills are positioned in % so they follow the art at any width. */
.ap-hero__scene { position: relative; isolation: isolate; width: 100%; max-width: 420px; margin: 0 auto; }
.ap-hero__image { width: 100%; height: auto; aspect-ratio: 1; }
.ap-hero-label {
  position: absolute; z-index: 2; display: flex; min-width: 30%; min-height: 48px; border-radius: 999px;
  text-decoration: none; touch-action: manipulation;
}
.ap-hero-label--s1 { right: -1%; top: 11%; --entry-delay: 140ms; --wiggle-delay: 2.1s; }
.ap-hero-label--s2 { left: -1%; top: 11%; --entry-delay: 260ms; --wiggle-delay: 3s; }
.ap-hero-label--s3 { left: 50%; top: 86%; margin-left: -16%; min-width: 32%; --entry-delay: 380ms; --wiggle-delay: 3.9s; }
.ap-hero-label::before { /* one sheen pass on entry */
  content: ''; position: absolute; z-index: 1; inset: 4% 2%; border-radius: 999px; pointer-events: none; opacity: 0;
  background: linear-gradient(110deg, transparent 36%, #ffffff00 43%, #ffffffb3 50%, #ffffff00 57%, transparent 64%);
  background-size: 260% 100%; background-position: 150% 0;
}
.ap-hero-label:focus-visible { outline-offset: 4px; }
/* Frosted white pill: reads on the teal art without competing with it. */
.ap-hero-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 5px 14px 6px;
  border: 1px solid #ffffffd9; border-radius: inherit; background: #ffffffe6; color: var(--ap-brand-ink);
  -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: 0 1px 2px #0a3a5c14, 0 10px 24px -10px #0a3a5c59;
  font-size: clamp(.75rem, 3.3vw, .875rem); font-weight: 700; line-height: 1.45; white-space: nowrap;
  transform-origin: 50% 80%; transition: transform 260ms var(--ap-ease), box-shadow 260ms var(--ap-ease);
}
.ap-hero-pill small { color: var(--ap-muted); font-size: .625rem; font-weight: 400; line-height: 1.4; }
@media (hover: hover) and (pointer: fine) {
  .ap-hero-label:hover .ap-hero-pill { transform: translateY(-3px); box-shadow: 0 1px 2px #0a3a5c14, 0 16px 30px -12px #0a3a5c66; }
}
.ap-hero-label:active .ap-hero-pill { transform: scale(.96); }
.ap-hero__copy { margin-top: 10px; }
.ap-hero__title { color: var(--ap-ink); font-size: 1.5rem; font-weight: 700; line-height: 1.6; }
.ap-hero__description { max-width: 340px; margin: 4px auto 0; color: var(--ap-muted); font-size: .875rem; line-height: 1.9; }

/* Search entry (inside the hero copy, like the cashback landing) */
.ap-search-entry { margin-top: 16px; }
.ap-search-entry__open {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 10px 16px;
  border: 1px solid var(--ap-line); border-radius: 16px; background: var(--ap-surface); color: var(--ap-muted);
  font-size: .8125rem; text-decoration: none; transition: border-color 160ms ease, background-color 160ms ease;
}
.ap-search-entry__open svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--ap-brand); }
.ap-search-entry__open:active { background: var(--ap-brand-soft); }
@media (hover: hover) { .ap-search-entry__open:hover { border-color: var(--ap-brand-line); background: #fff; } }

/* ---------- Sections ---------- */
.ap-section { margin-top: 36px; scroll-margin-top: 64px; }
.ap-section__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-bottom: 4px; }
.ap-section__title { font-size: 1.0625rem; font-weight: 700; line-height: 1.7; }
.ap-section__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ap-section__all {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 6px 4px 6px 0;
  color: var(--ap-link); font-size: .75rem; text-decoration: none;
}
.ap-section__all svg { width: 16px; height: 16px; }
/* Prev/next for mouse users; hidden on phones (desktop.css shows them). */
.ap-controls { display: none; }

/* ---------- Swiper rails ----------
 * The rail bleeds to the screen edge and keeps 8px above / 26px below inside its clip box, so card shadows
 * and the hover lift are never cut. Without Swiper (script blocked) it falls back to native scroll-snap. */
.ap-swiper {
  --ap-swiper-bleed: var(--ap-gutter);
  margin: -8px calc(var(--ap-gutter) * -1) -26px; padding: 8px 0 26px;
}
.ap-swiper:not(.swiper-initialized) { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.ap-swiper:not(.swiper-initialized)::-webkit-scrollbar { display: none; }
.ap-swiper:not(.swiper-initialized) > .swiper-wrapper { gap: 12px; padding-inline: var(--ap-gutter); }
.ap-swiper:not(.swiper-initialized) .swiper-slide { scroll-snap-align: start; scroll-margin-inline: var(--ap-gutter); }
.ap-swiper > .swiper-wrapper { display: flex; align-items: stretch; }
.ap-slide { flex-shrink: 0; height: auto; display: flex; }
.ap-slide > * { flex: 1; min-width: 0; }
.ap-slide--product { width: clamp(150px, calc((100vw - 56px) / 2.25), 186px); }
.ap-slide--coupon { width: min(300px, calc(100vw - 64px)); }
.ap-slide--after { width: 104px; }
.ap-swiper.swiper-initialized { cursor: grab; }
.ap-swiper.swiper-initialized:active { cursor: grabbing; }

.ap-more {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 100%;
  border-radius: var(--ap-radius-l); background: var(--ap-surface); color: var(--ap-link);
  font-size: .75rem; font-weight: 700; text-decoration: none;
}
.ap-more__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: var(--ap-elev-1); }
.ap-more__icon svg { width: 20px; height: 20px; }

.ap-rail--skeleton { display: flex; gap: 12px; overflow: hidden; margin-inline: calc(var(--ap-gutter) * -1); padding: 0 var(--ap-gutter) 4px; }
.ap-rail--skeleton > .ap-skeleton { flex-shrink: 0; }
.ap-skeleton--product { width: clamp(150px, calc((100vw - 56px) / 2.25), 186px); aspect-ratio: 5 / 8; border-radius: var(--ap-radius-l); }
.ap-skeleton--coupon { width: min(300px, calc(100vw - 64px)); height: 250px; }
.ap-skeleton--tile { aspect-ratio: 1; }
.ap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.ap-tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* ---------- Campaign banners (between sections) ---------- */
.ap-banner-slot { margin-top: 36px; }
.ap-banner { display: block; border-radius: var(--ap-radius-l); text-decoration: none; box-shadow: var(--ap-elev-1);
  transition: transform 260ms var(--ap-ease), box-shadow 260ms var(--ap-ease); }
.ap-banner__frame { display: block; overflow: hidden; border-radius: inherit; aspect-ratio: 1024 / 449; }
.ap-banner__frame img { width: 100%; height: 100%; object-fit: cover; }
.ap-banner:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .ap-banner:hover { transform: translateY(-3px); box-shadow: var(--ap-elev-2); } }

/* ---------- Merchant shelf ---------- */
.ap-tabs {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 4px calc(var(--ap-gutter) * -1) 6px;
  padding: 2px var(--ap-gutter) 6px; scroll-padding-inline: var(--ap-gutter);
}
.ap-tabs::-webkit-scrollbar { display: none; }
.ap-tab {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; min-height: 42px; padding: 4px 6px 4px 14px;
  border: 1px solid var(--ap-line); border-radius: 999px; background: #fff; font-size: .75rem; white-space: nowrap;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}
.ap-tab[aria-selected="true"] { border-color: var(--ap-ink); background: var(--ap-ink); color: #fff; font-weight: 700; }
.ap-tab__logo { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #fff; }
.ap-tab__logo img { width: 100%; height: 100%; object-fit: cover; }
.ap-shelf__panel { min-height: 120px; }

.ap-empty { display: grid; justify-items: center; gap: 12px; padding: 20px 12px; border-radius: var(--ap-radius-m);
  background: var(--ap-surface); color: var(--ap-muted); text-align: center; font-size: .8125rem; line-height: 2; }
.ap-empty--error { background: #fff6f7; color: #8a2b38; }

/* ---------- Buying guide + FAQ (static, for search engines and people) ---------- */
.ap-guide { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--ap-line); }
.ap-guide__title { font-size: 1.0625rem; font-weight: 700; line-height: 1.7; }
.ap-guide__lead { margin-top: 8px; color: var(--ap-muted); font-size: .8125rem; line-height: 2.1; text-align: justify; }
.ap-faq { display: grid; gap: 8px; margin-top: 18px; }
.ap-faq__item { border: 1px solid var(--ap-line); border-radius: var(--ap-radius-m); background: #fff; }
.ap-faq__item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 14px;
  cursor: pointer; list-style: none;
}
.ap-faq__item summary::-webkit-details-marker { display: none; }
.ap-faq__item summary::after {
  content: ''; flex: 0 0 10px; width: 10px; height: 10px; margin-top: -4px; border: solid var(--ap-subtle); border-width: 0 0 1.8px 1.8px;
  transform: rotate(-45deg); transition: transform 220ms var(--ap-ease);
}
.ap-faq__item[open] summary::after { transform: rotate(135deg); margin-top: 4px; }
.ap-faq__item h3 { font-size: .8125rem; font-weight: 700; line-height: 1.8; }
.ap-faq__item p { padding: 0 14px 14px; color: var(--ap-muted); font-size: .8125rem; line-height: 2.1; }

@media (max-width: 359px) {
  .ap-hero__title { font-size: 1.3125rem; }
  .ap-hero__description { font-size: .8125rem; }
  .ap-hero-pill { padding-inline: 8px; }
  .ap-section__title { font-size: .9375rem; }
  .ap-grid { gap: 10px 8px; }
}
