/* AI Photo Book product page — scoped to #aipb-page + .aipb-* class prefix */

/* Lift the warm-cream page background to <html>/<body> so it covers the
   strip behind the fixed inset header and the area around the footer. */
html, body { background: #fffaf3; }

#aipb-page {
  --aipb-bg: #fffaf3;
  --aipb-ink: #1a1a1a;
  --aipb-ink-soft: #555;
  --aipb-accent: #ff5722;
  --aipb-accent-deep: #e64a19;
  --aipb-card: #ffffff;
  --aipb-line: #f0e6da;
  --aipb-radius: 16px;
  /* Warm cream — used in place of pure white on accent surfaces so the
     button/CTA text feels brand-coherent against the orange gradient. */
  --aipb-cta-ink: #fff5e6;
  background: transparent;
  color: var(--aipb-ink);
  padding: 0;
  font-family: "poppins-medium", system-ui, -apple-system, sans-serif;
}

.aipb-section-header { text-align: center; margin: 0 16px 24px; }
.aipb-section-title {
  font-family: poppins-bold;
  font-style: italic;
  font-size: 18px;
  color: var(--aipb-accent-deep);
  text-align: center;
  margin: 0 0 10px;
}
.aipb-section-sub { color: var(--aipb-ink-soft); font-size: 14px; margin: 0; }

/* HERO — splashbook-compact spacing */
.aipb-hero {
  text-align: center;
  padding: 10px 16px;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.aipb-hero-badge {
  display: inline-block;
  background: #fff;
  border: 1px solid #ffd5be;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--aipb-accent-deep);
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.10);
  letter-spacing: 0.2px;
}
.aipb-hero-title {
  font-family: "poppins-bold", sans-serif;
  font-size: clamp(24px, 5.4vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 8px;
  letter-spacing: -1px;
}
.aipb-hero-highlight {
  background: linear-gradient(120deg, var(--aipb-accent), #ff9800);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.aipb-hero-subtitle {
  color: #666;
  font-size: 11px;
  line-height: 1.4;
  max-width: 520px;
  margin: 0 auto;
}
.aipb-hero-trust-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  row-gap: 3px;
  padding: 6px 10px;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
  box-sizing: border-box;
}
.aipb-hero-trust-item {
  font-size: 10px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}
.aipb-hero-trust-icon {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.aipb-hero-trust-divider {
  color: #ccc;
  font-size: 11px;
  font-weight: 300;
}
.aipb-trust-bar {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 10px;
  font-size: 13px; color: var(--aipb-ink-soft);
  margin-bottom: 22px;
}
.aipb-trust-divider { opacity: 0.4; }
.aipb-hero-cta-row { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* CTA buttons */
.aipb-cta-btn {
  border: 0; cursor: pointer;
  padding: 14px 28px;
  font-size: 16px; font-weight: 600;
  border-radius: 999px;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.aipb-cta-btn:active { transform: scale(0.97); }
.aipb-cta-primary {
  background: linear-gradient(135deg, var(--aipb-accent), var(--aipb-accent-deep));
  color: var(--aipb-cta-ink);
  box-shadow: 0 6px 20px rgba(255, 87, 34, 0.32);
}
.aipb-cta-large { padding: 16px 36px; font-size: 17px; }
.aipb-cta-note { font-size: 12px; color: var(--aipb-ink-soft); }

/* GALLERY (Embla) — splashbook-style edge-to-edge with peek */
.aipb-product-images { padding: 0; }
.aipb-gallery-wrapper {
  width: 100%;
  overflow: hidden;
}
.aipb-gallery-viewport {
  width: 100%;
  overflow: visible;
}
.aipb-gallery-track {
  display: flex;
  touch-action: pan-y;
  will-change: transform;
}
.aipb-gallery-slide {
  flex: 0 0 72%;
  width: 72%;
  aspect-ratio: 3 / 4;
  min-width: 0;
  background: #f4ece1;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  margin-right: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}
.aipb-gallery-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
@media (min-width: 900px) {
  .aipb-gallery-slide {
    flex: 0 0 calc(50% - 4px);
    width: calc(50% - 4px);
    aspect-ratio: 3 / 4;
    margin-right: 8px;
    border-radius: 16px;
  }
}

/* ─── 3D wire-O flipbook slide (Scrapbook-style 2-page spread, image faces) ─── */
.aipb-gallery-slide.aipb-flip-slide {
  flex: 0 0 92%;
  width: 92%;
  aspect-ratio: auto;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0 30px;
}
.aipb-flip {
  position: relative;
  /* Fill the slide width so the gap to the neighbouring image is just the
     slide margin (same spacing as image↔image), not an extra inner gutter. */
  width: 100%;
  aspect-ratio: 3 / 2;
  perspective: 2200px;
}
.aipb-flip-shadow {
  position: absolute; inset: 88% -6% -12% -6%;
  background: radial-gradient(ellipse at center, rgba(31, 26, 20, 0.30), transparent 70%);
  filter: blur(6px); z-index: 0;
}
/* Scoped under .aipb-flip to beat the global `.aipb-gallery-slide img` rule
   (which would otherwise cover-stretch the tall wire-O binding to fill). */
.aipb-flip .aipb-flip-spine {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: auto; height: 100%;
  transform: translateX(-50%);
  object-fit: contain; object-position: center;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
  z-index: 30; pointer-events: none;
  transition: left 0.3s ease;
}
/* Lean the coil toward whichever cover is showing so it touches the page:
   cover → page on the right (51%), back → page on the left (49%). */
.aipb-flip[data-state="cover"] .aipb-flip-spine { left: 51%; }
.aipb-flip[data-state="back"] .aipb-flip-spine { left: 49%; }
.aipb-flip-pages { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.aipb-flip-page {
  position: absolute; left: 50%; top: 0;
  width: 50%; height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.05s cubic-bezier(.4, .05, .2, 1);
}
.aipb-flip-page.flipped { transform: rotateY(-176deg); }
.aipb-flip .face {
  position: absolute; inset: 0;
  background: #f4ece1;
  border-radius: 2px 8px 8px 2px;
  box-shadow: inset 6px 0 14px -8px rgba(0, 0, 0, 0.28);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.aipb-flip .face.back {
  transform: rotateY(180deg);
  border-radius: 8px 2px 2px 8px;
  box-shadow: inset -6px 0 14px -8px rgba(0, 0, 0, 0.28);
}
.aipb-flip .face img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Thumbnails strip below the slider */
.aipb-gallery-thumbnails {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.aipb-gallery-thumbnails::-webkit-scrollbar { display: none; }
.aipb-gallery-thumbnail {
  flex: 0 0 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
  background: #eee;
}
.aipb-gallery-thumbnail img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.aipb-gallery-thumbnail.active {
  border-color: var(--aipb-accent);
  transform: translateY(-1px);
}

/* PRODUCT INFO — splashbook-style component re-skinned in orange */
.aipb-product-info { padding: 14px 16px 8px; }

.aipb-sales-badge-wrap { margin-bottom: 8px; }
.aipb-sales-badge {
  display: inline-block;
  padding: 4px 10px;
  font-weight: 600;
  background-color: #ffe7c2;
  color: #7a3c00;
  border-radius: 10px;
  font-size: 12px;
}

.aipb-product-title {
  font-family: "poppins-bold", sans-serif;
  letter-spacing: -1px;
  margin: 0;
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 600;
  line-height: 1.05;
  color: var(--aipb-ink);
}

.aipb-rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 6px 0 4px;
  cursor: pointer;
}
.aipb-static-stars {
  color: #f5b400;
  font-size: 14px;
  margin-top: -2px;
  letter-spacing: 1px;
}
.aipb-rating-text-link {
  font-size: 13px;
  color: var(--aipb-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.aipb-product-desc {
  font-size: 13px;
  color: #444;
  margin: 6px 0 12px;
  line-height: 1.5;
}

.aipb-coupon-wrapper { position: relative; margin: 10px 0; }
.aipb-coupon-banner {
  background: #569730;
  padding: 8px 8px 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px;
  color: #fff;
  gap: 10px;
}
.aipb-coupon-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
}
.aipb-coupon-star-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.aipb-coupon-star-shape { fill: #fff; fill-rule: evenodd; clip-rule: evenodd; }
.aipb-coupon-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.aipb-coupon-copy { margin: 0; font-size: 14px; white-space: nowrap; }
.aipb-coupon-price {
  color: #fff;
  font-size: 22px;
  font-family: "poppins-bold", sans-serif;
  white-space: nowrap;
}
.aipb-coupon-button {
  background-color: #306412;
  color: #fff;
  border-radius: 11px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.aipb-coupon-button:active { transform: scale(0.96); }
.aipb-coupon-code { font-size: 14px; font-weight: 700; letter-spacing: 0.2px; }

.aipb-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  min-height: 40px;
}
.aipb-old-price {
  text-decoration: line-through;
  color: #888;
  font-size: 14px;
  padding-top: 2px;
}
.aipb-new-price {
  font-size: 22px;
  letter-spacing: -1px;
  font-weight: 700;
  font-family: "poppins-bold", sans-serif;
  color: var(--aipb-ink);
}
.aipb-save-pill {
  background: #117d02;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
}

.aipb-info-meta {
  font-size: 12px;
  color: var(--aipb-ink-soft);
  margin: 4px 0 16px;
  line-height: 1.5;
}
.aipb-info-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--aipb-accent-deep);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 12px 0 8px;
}
.aipb-info-cta {
  width: 100%;
  margin-top: 16px;
  border-radius: 15px;
  padding: 15px 10px;
  font-size: 14px;
  font-weight: 700;
}
.aipb-info-cta-note {
  text-align: center;
  font-size: 12px;
  color: var(--aipb-ink-soft);
  margin: 8px 0 0;
}

/* Inline how-it-works strip — one line, sits under the Upload CTA */
.aipb-how-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--aipb-ink-soft);
  letter-spacing: 0.01em;
}
.aipb-how-strip li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.aipb-how-strip .aipb-how-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--aipb-accent);
  color: var(--aipb-cta-ink);
  display: inline-grid; place-items: center;
  font-size: 10px; font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.aipb-how-strip .aipb-how-sep {
  flex: 1 1 12px;
  min-width: 8px;
  height: 1px;
  background: var(--aipb-line);
  align-self: center;
}

/* THEME CARDS — horizontal scroller (splashbook-style compact thumbnails) */
.aipb-info-label-under-slider {
  padding: 0 16px;
  margin: 14px 0 8px;
}
/* ── Step labels inside the uploader (1 Choose theme · 2 Add faces) ── */
.aipb-uploader-step {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.aipb-step-num {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--aipb-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.aipb-step-label {
  font-family: "poppins-bold", sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--aipb-ink);
}

/* ── Theme selector — circular thumbnails below the gallery (Splashbook-style) ── */
.aipb-theme-cards {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 14px 16px 8px;
  margin: 0;
}
.aipb-theme-cards::-webkit-scrollbar { display: none; }
.aipb-theme-option-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 72px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease;
}
.aipb-theme-option-card:active { transform: scale(0.96); }
.aipb-theme-option-image-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: #f3eadf;
  border: 2px solid transparent;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.aipb-theme-option-image-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.aipb-theme-option-card.active .aipb-theme-option-image-wrap {
  border-color: var(--aipb-accent);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--aipb-accent);
}
.aipb-theme-option-title {
  font-size: 12px;
  line-height: 1.15;
  font-weight: 500;
  color: var(--aipb-ink);
  text-align: center;
  white-space: normal;
}
.aipb-theme-option-card.active .aipb-theme-option-title {
  font-weight: 700;
  color: var(--aipb-accent-deep);
}
/* POPULAR-style pink badge overlapping the top of the circle */
.aipb-theme-option-badge {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: #e6197a;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* DESKTOP TWO-COLUMN LAYOUT */
@media (min-width: 900px) {
  /* Global body has max-width: 800px which would clip the two-col layout
     to a narrow centred column. Splashbook overrides it the same way. */
  body { max-width: none !important; }

  .aipb-hero { display: none; }
  #aipb-page {
    display: grid;
    grid-template-columns: 1.3fr 1.1fr;
    gap: 0 36px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 15px 0;
    align-items: start;
  }
  #aipb-page > * { min-width: 0; }
  /* Left column = gallery + thumbnails. It STRETCHES to the right column's
     full height (both live in grid row 1), so the sticky inner has runway for
     the ENTIRE right-side scroll and releases right as the reviews row begins.
     No multi-row spanning, so it can't end early and leave a gap. */
  .aipb-product-images {
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    padding: 0;
    min-height: 0;
  }
  /* Gallery + theme thumbnails stick together as one unit, confined to the
     left column so they never overlay the full-width reviews/FAQ below. */
  .aipb-product-images .aipb-images-sticky {
    position: sticky;
    top: 124px; /* ~24px breathing room below the sticky header (bottom ≈ 99px) */
    height: fit-content;
  }
  /* Right column: a single scrolling stack — info → UGC → testimonials →
     details/returns/support tabs. Being one grid item (not separate rows)
     guarantees the left column matches its full height. */
  .aipb-buy-col {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 0;
  }
  .aipb-product-info { padding: 0; }
  .aipb-buy-col > #ugcMount,
  .aipb-buy-col > #aipb-testimonialsSection,
  .aipb-buy-col > #aipb-infoTabsMount { margin-top: 24px; padding: 0; }
  /* Left-align titles inside the narrow rail */
  #aipb-testimonialsSection .aipb-section-title,
  #aipb-infoTabsMount .aipb-section-title,
  #ugcMount .aipb-section-title { text-align: left; }
  /* UGC strip is narrower in the rail — let cards shrink */
  #ugcMount .aipb-ugc-row { gap: 8px; }
  #ugcMount .aipb-ugc-card { flex: 0 0 calc((100% - 24px) / 4); }
  #aipb-page > .aipb-final-cta {
    grid-column: 1 / -1;
    margin-left: 0;
    margin-right: 0;
  }
  /* FAQ + Reviews span the FULL body width (matching the gallery/info row),
     not the narrower shared-widget defaults. */
  #aipb-page > .faq-section { grid-column: 1 / -1; max-width: none; }
  #aipb-page > .scrapbook-reviews { grid-column: 1 / -1; max-width: none; width: 100%; }
  /* 4 review cards per row (widget JS builds 4 masonry columns via data-columns="4") */
  #aipb-page #reviewsMount .reviews-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .aipb-reviews-wrap { margin-top: 24px; }
  .aipb-sticky-cta { display: none; }
  .aipb-themes-section { display: none; } /* picker now lives in product info column */
  /* "how it works" cards switch to a single column inside the narrower
     right column so they don't shrink awkwardly. */
  .aipb-how-section .aipb-how-steps {
    grid-template-columns: 1fr;
  }
  .aipb-how-section .aipb-section-title { text-align: left; }
}

/* THEMES */
.aipb-themes-section { margin: 40px 16px 32px; }
.aipb-themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}

/* THEME DROPDOWN (compact replacement for the grid on the product page) */
.aipb-theme-dropdown {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
}
.aipb-theme-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--aipb-card);
  border: 2px solid var(--aipb-line);
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  color: var(--aipb-ink);
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.aipb-theme-select-btn:hover { border-color: var(--aipb-accent); }
.aipb-theme-select-btn[aria-expanded="true"] {
  border-color: var(--aipb-accent);
  box-shadow: 0 6px 18px rgba(255, 87, 34, 0.16);
}
.aipb-theme-select-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: #f0f0f0;
  display: none;
}
.aipb-theme-select-btn.has-selection .aipb-theme-select-thumb { display: block; }
.aipb-theme-select-label {
  flex: 1;
  font-weight: 600;
  letter-spacing: -0.1px;
}
.aipb-theme-select-caret {
  font-size: 10px;
  color: var(--aipb-ink-soft);
  transition: transform 0.2s;
}
.aipb-theme-select-btn[aria-expanded="true"] .aipb-theme-select-caret {
  transform: rotate(180deg);
}
.aipb-theme-select-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--aipb-line);
  border-radius: 14px;
  list-style: none;
  margin: 0;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  max-height: 320px;
  overflow-y: auto;
}
.aipb-theme-select-list[hidden] { display: none; }
.aipb-theme-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.aipb-theme-select-item:hover,
.aipb-theme-select-item:focus { background: #fff5e6; outline: none; }
.aipb-theme-select-item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.aipb-theme-select-item-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.aipb-theme-select-item-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--aipb-ink);
}
.aipb-theme-select-item-badge {
  font-size: 11px;
  color: var(--aipb-accent-deep);
}
.aipb-theme-select-item.selected {
  background: #fff0e0;
}
.aipb-theme-select-item.selected::after {
  content: "✓";
  color: var(--aipb-accent);
  font-weight: 700;
  margin-left: 4px;
}
.aipb-theme-card {
  background: var(--aipb-card);
  border: 2px solid transparent;
  border-radius: var(--aipb-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.aipb-theme-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.aipb-theme-card.selected { border-color: var(--aipb-accent); box-shadow: 0 6px 18px rgba(255, 87, 34, 0.18); }
.aipb-theme-img-wrap { aspect-ratio: 4/5; background: #eee; overflow: hidden; }
.aipb-theme-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aipb-theme-meta { padding: 10px 12px; }
.aipb-theme-title { font-weight: 600; font-size: 15px; margin: 0; }
.aipb-theme-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,0.7); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 6px;
}

/* HOW IT WORKS */
.aipb-how-section {
  margin: 56px 16px 40px;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}
.aipb-how-section .aipb-section-title { text-align: center; margin-bottom: 28px; }
.aipb-how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.aipb-how-step {
  background: var(--aipb-card);
  padding: 24px 20px;
  border-radius: var(--aipb-radius);
  border: 1px solid var(--aipb-line);
  position: relative;
}
.aipb-how-num {
  position: absolute; top: -12px; left: 20px;
  background: var(--aipb-accent); color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.aipb-how-icon { font-size: 32px; margin-bottom: 10px; }
.aipb-how-step h3 { font-size: 17px; margin: 0 0 6px; font-weight: 600; }
.aipb-how-step p { font-size: 14px; color: var(--aipb-ink-soft); margin: 0; line-height: 1.5; }

/* PHYSICAL PRODUCT REASSURANCE */
.aipb-physical-section { margin: 40px 16px; }
.aipb-physical-card {
  max-width: 720px; margin: 0 auto;
  background: linear-gradient(135deg, #fff8e1, #fffde7);
  border: 1px solid #f7e7c2;
  border-radius: var(--aipb-radius);
  padding: 22px;
  display: flex; gap: 18px; align-items: center;
}
.aipb-physical-icon { font-size: 44px; flex-shrink: 0; }
.aipb-physical-card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.aipb-physical-card p { margin: 0; font-size: 14px; color: #7a6a4d; line-height: 1.5; }

/* FAQ */
.aipb-faqs-section { margin: 56px 16px 40px; max-width: 720px; margin-left: auto; margin-right: auto; }
.aipb-faqs-section .aipb-section-title { text-align: center; margin-bottom: 24px; }
.aipb-faqs-list { display: flex; flex-direction: column; gap: 10px; }
.aipb-faq-item {
  background: var(--aipb-card);
  border: 1px solid var(--aipb-line);
  border-radius: 12px;
  overflow: hidden;
}
.aipb-faq-q {
  width: 100%; text-align: left; background: none; border: 0;
  padding: 16px 18px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  color: var(--aipb-ink); font-family: inherit;
}
.aipb-faq-q::after { content: "+"; font-size: 22px; font-weight: 300; transition: transform 0.2s; }
.aipb-faq-item.open .aipb-faq-q::after { transform: rotate(45deg); }
.aipb-faq-a {
  padding: 0 18px;
  font-size: 14px; color: var(--aipb-ink-soft); line-height: 1.6;
  max-height: 0; overflow: hidden; transition: max-height 0.3s, padding 0.3s;
}
.aipb-faq-item.open .aipb-faq-a { max-height: 500px; padding: 0 18px 18px; }

/* FINAL CTA */
.aipb-final-cta {
  text-align: center; padding: 56px 24px 40px; margin: 40px 16px 0;
  background: linear-gradient(135deg, #fff5e6, #fff);
  border-radius: var(--aipb-radius);
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.aipb-final-cta h2 {
  font-family: "poppins-bold", sans-serif; font-size: 26px;
  font-weight: 600; margin: 0 0 8px;
}
.aipb-final-cta p { color: var(--aipb-ink-soft); margin: 0 0 22px; }

/* STICKY MOBILE CTA */
.aipb-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.aipb-sticky-cta.visible {
  transform: translateY(0);
  pointer-events: auto;
}
.aipb-sticky-cta-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: white;
}
.aipb-sticky-delivery-row {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #000000;
  background: #c9ea12;
  padding: 5px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}
.aipb-sticky-cta-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.aipb-sticky-cta-theme {
  font-size: 12px;
  font-weight: 600;
  color: var(--aipb-ink);
}
.aipb-sticky-coupon-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  flex-wrap: wrap;
}
.aipb-sticky-old-price-muted {
  text-decoration: line-through;
  color: #aaa;
  font-size: 12px;
}
.aipb-sticky-new-price {
  font-family: poppins-bold, system-ui, -apple-system, sans-serif;
  font-size: 18px;
  letter-spacing: -0.5px;
  color: var(--aipb-accent-deep);
}
.aipb-sticky-coupon-label {
  font-size: 10px;
  color: var(--aipb-accent-deep);
  font-weight: 700;
  background: #ffe7d6;
  padding: 2px 5px;
  border-radius: 5px;
}
.aipb-sticky-cta-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--aipb-accent), var(--aipb-accent-deep));
  color: var(--aipb-cta-ink);
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(255, 87, 34, 0.32);
  font-family: inherit;
}
.aipb-sticky-cta-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.32);
}
.aipb-sticky-cta-btn svg { flex-shrink: 0; stroke: currentColor; }

/* MODAL — bottom sheet on mobile, centered card on tablet+ */
.aipb-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.aipb-modal-overlay.show { display: flex; }
.aipb-modal-card {
  background: #fff;
  width: 100%; max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  padding: 18px 18px 32px;
  position: relative;
  animation: aipbSlideUp 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  -webkit-overflow-scrolling: touch;
}
.aipb-modal-grab {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: #d8d8d8;
  margin: 0 auto 12px;
}
@media (min-width: 600px) {
  .aipb-modal-overlay { align-items: center; }
  .aipb-modal-card { border-radius: 24px; max-height: 88vh; padding: 24px 22px 32px; }
  .aipb-modal-grab { display: none; }
}
@keyframes aipbSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.aipb-modal-close {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,0.05); border: 0;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.aipb-step { animation: aipbFade 0.3s; }
@keyframes aipbFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.aipb-step-title {
  font-family: "poppins-bold", sans-serif;
  font-size: 22px; font-weight: 600; margin: 0 0 6px;
}
.aipb-step-emp { color: var(--aipb-accent); }
.aipb-step-sub { color: var(--aipb-ink-soft); font-size: 14px; margin: 0 0 18px; }

/* PHOTO UPLOAD — dual gender cards */
/* Her + Him sit side-by-side (compact) with a 2×2 photo grid — bigger, clearer
   thumbnails and roughly half the vertical footprint of the stacked layout. */
.aipb-genders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
/* Single couple-photo upload: one full-width card + single-column grid. */
.aipb-genders.aipb-genders-single { grid-template-columns: 1fr; }
#aipb-refs-grid-couple { grid-template-columns: 1fr; }

/* ── Shipping selector (exact Splashbook UX) ── */
.aipb-ship-section { margin: 14px 0 4px; }
.aipb-ship-title {
  margin-top: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--aipb-accent-deep, #e64a19);
  text-transform: uppercase;
  font-family: "poppins-bold", sans-serif;
}
.aipb-pincode-checker {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--aipb-line, #f0e6da);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 8px;
  background-color: white;
  justify-content: space-between;
}
.aipb-pincode-input-wrap { display: flex; width: 100%; align-items: center; }
.aipb-pincode-location-icon { font-size: 14px; padding-left: 5px; }
#aipb-pincode-input {
  border: none;
  outline: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--aipb-ink, #1a1a1a);
  background: transparent;
  width: 100%;
  padding: 6px 0 6px 6px;
}
.aipb-pincode-check-button {
  background: var(--aipb-accent, #ff5722);
  border: none;
  color: #fff;
  font-weight: 500;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.aipb-pincode-error {
  font-size: 12px;
  color: #d60000;
  margin: 4px;
  display: none;
}
.aipb-ship-options { display: flex; gap: 3px; }
.aipb-ship-card {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background-color: white;
}
.aipb-ship-card.selected {
  border-color: var(--ship-color, #7b3fe4);
  background: color-mix(in srgb, var(--ship-color, #7b3fe4) 20%, white);
}
.aipb-ship-date { font-family: "poppins-medium-italic", sans-serif; font-size: 12px; }
.aipb-ship-meta { display: flex; gap: 8px; font-size: 11px; }
.aipb-ship-spin {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(230, 74, 25, 0.25);
  border-radius: 50%;
  border-top-color: var(--aipb-accent, #ff5722);
  animation: aipbShipSpin 1s ease-in-out infinite;
  margin: 0 auto;
}
@keyframes aipbShipSpin { to { transform: rotate(360deg); } }
.aipb-gender-card {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 9px;
  display: flex;
  flex-direction: column;
}
.aipb-gender-card[data-gender="female"] { border-color: #ffd6e3; background: #fff7fa; }
.aipb-gender-card[data-gender="male"]   { border-color: #d8e4ff; background: #f5f8ff; }
.aipb-gender-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}
.aipb-gender-emoji {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.aipb-gender-meta { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex-wrap: wrap; }
.aipb-gender-title {
  font-family: "poppins-bold", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--aipb-ink);
}
.aipb-gender-count {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--aipb-ink-soft);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  padding: 1px 7px;
}
.aipb-gender-count.full { color: #fff; background: var(--aipb-secondary, #2f9e44); }
.aipb-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin: 0;
}
.aipb-photo-grid.aipb-gender-grid { grid-template-columns: repeat(2, 1fr); }
.aipb-photo-cell {
  aspect-ratio: 1;
  background: #f5f5f5;
  border: 2px dashed #ddd;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #aaa;
  position: relative;
  overflow: hidden;
}
.aipb-photo-cell.filled { border-style: solid; border-color: var(--aipb-accent); background: #000; }
.aipb-photo-cell img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.aipb-photo-cell.uploading::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(255,255,255,0.6) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><circle cx='12' cy='12' r='10' fill='none' stroke='%23ff5722' stroke-width='2' stroke-dasharray='15.7 15.7' stroke-linecap='round'><animateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.8s' repeatCount='indefinite'/></circle></svg>") center/24px no-repeat;
}
.aipb-photo-cell-remove {
  position: absolute; top: 3px; right: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.72); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; cursor: pointer; border: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  z-index: 3;
}
.aipb-photo-cell-remove:active { transform: scale(0.9); }

.aipb-step-actions {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.aipb-step-back {
  background: none; border: 0; cursor: pointer;
  color: var(--aipb-ink-soft); font-size: 14px; padding: 8px;
  font-family: inherit;
}
.aipb-step-actions .aipb-cta-btn[disabled] { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* "Add pictures" button — full-width pill above the action row */
.aipb-add-pictures-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 12px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--aipb-accent-deep);
  background: #fff5ec;
  border: 1.5px dashed #ffb38f;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.aipb-add-pictures-btn:hover {
  background: #ffeadb;
  border-color: var(--aipb-accent);
}
.aipb-add-pictures-btn:active { transform: scale(0.98); }
.aipb-add-pictures-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--aipb-accent);
  color: var(--aipb-cta-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* Progress UI shown while detection + upload runs */
.aipb-upload-progress {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #fff5ec;
  border: 1px solid #ffd2b8;
  border-radius: 10px;
}
.aipb-upload-progress-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--aipb-accent-deep);
  margin: 0 0 6px;
}
.aipb-upload-progress-bar {
  width: 100%;
  height: 6px;
  background: #ffe0cc;
  border-radius: 999px;
  overflow: hidden;
}
.aipb-upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--aipb-accent), var(--aipb-accent-deep));
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* GENERATING SPINNER */
.aipb-gen-spinner {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(255,87,34,0.2);
  border-top-color: var(--aipb-accent);
  margin: 12px auto 18px;
  animation: aipbSpin 0.9s linear infinite;
}
@keyframes aipbSpin { to { transform: rotate(360deg); } }

/* CROP MODAL (opens when 2+ faces detected on a ref upload) */
.aipb-crop-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999; /* above the sticky header (z-index 9000) so it dims it too */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.aipb-crop-overlay.show { display: flex; }
.aipb-crop-card {
  background: #fff;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.aipb-crop-head {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--aipb-line);
}
.aipb-crop-title { font-family: "poppins-bold", sans-serif; font-size: 16px; font-weight: 600; margin: 0; min-width: 0; }
/* Skip / Crop / Close actions in the header (replaces the bottom bar).
   Literal colors — the crop overlay lives outside #aipb-page, so the --aipb-*
   vars aren't in scope here. */
.aipb-crop-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.aipb-crop-btn {
  border: 1.5px solid #f0d9c8;
  background: #fff;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.aipb-crop-btn:active { transform: scale(0.96); }
.aipb-crop-btn:hover { background: #faf3ec; }
.aipb-crop-btn-primary {
  background: #ff5722;
  border-color: #ff5722;
  color: #fff;
}
.aipb-crop-btn-primary:hover { background: #ef5022; }
.aipb-crop-tool {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid #f0d9c8;
  background: #fff;
  color: #1a1a1a;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.aipb-crop-tool:active { transform: scale(0.92); }
.aipb-crop-tool:hover { background: #faf3ec; }
.aipb-crop-stage {
  position: relative;
  flex: 1;
  background: #111;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.aipb-crop-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.aipb-crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
  box-sizing: border-box;
}
/* "Crop like this" example guide — top-left of the crop stage */
.aipb-crop-guide {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 16, 12, 0.72);
  color: #fff;
  padding: 7px 10px 7px 8px;
  border-radius: 10px;
  backdrop-filter: blur(3px);
  pointer-events: none;
  max-width: 70%;
}
.aipb-crop-guide svg { flex: 0 0 auto; border-radius: 5px; }
.aipb-crop-guide span {
  font-size: 11.5px;
  line-height: 1.25;
  font-weight: 600;
}
.aipb-crop-handle {
  position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  border: 2px solid var(--aipb-accent);
  border-radius: 3px;
}
.aipb-crop-handle-nw { top: -8px; left: -8px; cursor: nwse-resize; }
.aipb-crop-handle-ne { top: -8px; right: -8px; cursor: nesw-resize; }
.aipb-crop-handle-sw { bottom: -8px; left: -8px; cursor: nesw-resize; }
.aipb-crop-handle-se { bottom: -8px; right: -8px; cursor: nwse-resize; }
.aipb-crop-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--aipb-line);
}

/* PREVIEW REVEAL */
/* ── Carousel reveal: big image + horizontal thumb strip, full-viewport ── */
@keyframes aipbShimmer { 0% { background-position: -150% 0; } 100% { background-position: 250% 0; } }
.aipb-rv-shimmer {
  background: linear-gradient(100deg, #ece3d4 30%, #f7f0e4 50%, #ece3d4 70%);
  background-size: 200% 100%;
  animation: aipbShimmer 1.3s linear infinite;
}

.aipb-reveal2 {
  display: flex;
  flex-direction: column;
  height: 100svh;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}
.aipb-rv-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}
.aipb-rv-back {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  font-size: 22px; line-height: 1;
  color: var(--aipb-ink);
  text-decoration: none;
  border-radius: 50%;
}
.aipb-rv-back:active { background: rgba(0,0,0,0.06); }
/* status now overlays the stage (header stays clean: just back + ref) */
.aipb-rv-status {
  position: absolute; top: 10px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-size: 12.5px; font-weight: 700;
  color: #fff;
  background: rgba(20, 16, 12, 0.55);
  padding: 5px 12px; border-radius: 999px;
  white-space: nowrap;
  backdrop-filter: blur(3px);
}
.aipb-rv-status.hidden { display: none; }
.aipb-rv-ref {
  flex: 0 0 auto;
  margin-left: auto;
  width: 34px; height: 44px;
  border-radius: 6px; overflow: hidden;
  background: #f0eadf; border: 1px solid var(--aipb-line, #eee);
}
.aipb-rv-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }

.aipb-rv-stage {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  background: #f4ece1;
}
.aipb-rv-stage.gen { } /* shimmer applied to the img placeholder below */
.aipb-rv-main {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 14px;
  display: block;
}
.aipb-rv-main.blurred { filter: blur(22px); transform: scale(1.08); }
.aipb-rv-stage.gen .aipb-rv-main { filter: blur(22px); transform: scale(1.08); }
.aipb-rv-stage-lock {
  position: absolute; inset: auto 0 0 0;
  text-align: center;
  background: rgba(20, 16, 12, 0.55);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 8px;
}

.aipb-rv-thumbs {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px;
}
.aipb-rv-thumbs::-webkit-scrollbar { display: none; }
.aipb-rv-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 52px; height: 64px;
  border-radius: 9px;
  overflow: hidden;
  background: #ece3d4;
  cursor: pointer;
  border: 2px solid transparent;
}
.aipb-rv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aipb-rv-thumb.locked img { filter: blur(7px); transform: scale(1.2); }
.aipb-rv-thumb.gen img { opacity: 0.35; }
.aipb-rv-thumb.gen::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(236,227,212,0) 30%, rgba(255,255,255,0.65) 50%, rgba(236,227,212,0) 70%);
  background-size: 200% 100%;
  animation: aipbShimmer 1.3s linear infinite;
}
.aipb-rv-thumb.active { border-color: var(--aipb-accent); }
.aipb-rv-yours {
  position: absolute; top: 3px; left: 3px; z-index: 2;
  background: rgba(76,175,80,0.95); color: #fff;
  font-size: 9px; padding: 1px 4px; border-radius: 5px;
}
.aipb-rv-lock {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}

/* Order bar (Splashbook-style) */
.aipb-orderbar {
  flex: 0 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}
.aipb-orderbar-strip {
  background: #d7e84f;
  color: #2a2a1a;
  font-size: 12.5px; font-weight: 700;
  text-align: center;
  padding: 6px 10px;
}
.aipb-orderbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.aipb-orderbar-info { flex: 1 1 auto; min-width: 0; text-align: left; }
.aipb-orderbar-title {
  font-size: 13.5px; font-weight: 700; color: var(--aipb-ink);
  line-height: 1.2; margin-bottom: 3px;
}
.aipb-orderbar-price { font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aipb-orderbar-price s { color: var(--aipb-ink-soft); }
.aipb-orderbar-price b { font-size: 17px; color: var(--aipb-ink); }
.aipb-orderbar-pill {
  background: #f3eafc; color: #7a3ea8;
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.aipb-orderbar-btn {
  flex: 0 0 auto;
  background: var(--aipb-accent, #ff5722);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(255, 87, 34, 0.3);
}
.aipb-orderbar-btn:active { transform: scale(0.97); }

/* Desktop: bigger thumbs, capped width, centered */
@media (min-width: 768px) {
  .aipb-reveal2 { max-width: 820px; margin: 0 auto; padding: 16px 20px; }
  .aipb-rv-thumb { width: 76px; height: 96px; }
  .aipb-rv-status { font-size: 15px; }
  .aipb-orderbar-title { font-size: 15px; }
  .aipb-orderbar-btn { padding: 15px 28px; font-size: 16px; }
}

/* ═══════════════════════════════════════════════
   INLINE UPLOADER (on the product page, under price)
   ═══════════════════════════════════════════════ */
.aipb-inline-uploader {
  margin-top: 16px;
  padding: 14px 14px 16px;
  border: 1px solid var(--aipb-line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffaf6 0%, #fff 60%);
  box-shadow: 0 2px 14px rgba(255, 87, 34, 0.06);
}
.aipb-inline-uploader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.aipb-inline-uploader-title {
  font-family: "poppins-bold", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--aipb-ink);
  margin: 0;
}
.aipb-inline-uploader-tips {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.aipb-inline-uploader-tips li {
  position: relative;
  padding-left: 20px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--aipb-ink-soft);
  margin-bottom: 5px;
}
.aipb-inline-uploader-tips li:last-child { margin-bottom: 0; }
.aipb-inline-uploader-tips li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--aipb-accent-deep);
  font-weight: 700;
}
.aipb-inline-uploader-tips strong { color: var(--aipb-ink); font-weight: 600; }
.aipb-inline-secure {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: #2e7d32;
  background: #eafbea;
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}
.aipb-inline-uploader .aipb-info-cta { margin-top: 6px; }
/* Muted = not-ready. Stays clickable (fires a toast) — no dead disabled. */
.aipb-cta-muted {
  filter: saturate(0.2);
  opacity: 0.7;
  box-shadow: none !important;
}
/* Trust row under the Generate Preview button */
.aipb-assurance-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  text-align: center;
}
.aipb-assurance-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--aipb-ink-soft);
  white-space: nowrap;
}
/* Empty per-gender state: a single full-width upload button (no "+" grid) */
.aipb-photo-grid.aipb-grid-empty { display: block; flex: 1 1 auto; }
.aipb-upload-gender-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 100%;
  min-height: 104px;
  padding: 14px 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--aipb-accent-deep);
  background: #fff;
  border: 1.5px dashed #ffb38f;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.aipb-upload-gender-btn:hover { background: #fff5ec; border-color: var(--aipb-accent); }
.aipb-upload-gender-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--aipb-accent);
  color: #fff;
  font-size: 17px;
  line-height: 1;
}
.aipb-gender-nudge { animation: aipbNudge 0.5s ease; }
@keyframes aipbNudge {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ═══════════════════════════════════════════════
   PREVIEW VIEW (URL = /ai-photobook/preview/{uploadID})
   ═══════════════════════════════════════════════ */
.aipb-preview-view { display: none; }
.aipb-preview-view.show { display: block; }
/* Full-screen takeover: hide the storefront chrome so the carousel fits the
   viewport with no page scroll. */
.aipb-preview-mode #aipb-page,
.aipb-preview-mode .aipb-sticky-cta,
.aipb-preview-mode #footer-placeholder,
.aipb-preview-mode #globalFooter,
.aipb-preview-mode #header-placeholder,
.aipb-preview-mode #header-skeleton { display: none !important; }
.aipb-preview-mode, .aipb-preview-mode body { overflow: hidden; }
/* the global-header class adds body padding-top for the fixed nav; the nav is
   hidden in preview mode, so reclaim that space (was the gap + overflow). */
body.aipb-preview-mode { padding-top: 0 !important; }
.aipb-preview-inner { margin: 0; padding: 0; }
.aipb-preview-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--aipb-accent-deep);
  text-decoration: none;
}
.aipb-preview-back:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════
   FULL-WIDTH SECTIONS (UGC, testimonials, tabs, FAQ)
   ═══════════════════════════════════════════════ */
.aipb-fullwidth-section { margin: 32px 0 0; padding: 0 16px; }
/* UGC: mirrors Splashbook's UGC strip exactly — the row carries the 10px side
   inset + 14px scroll-padding; cards are 3.2-per-view, center-snapped. */
#ugcMount.aipb-fullwidth-section { padding: 0; margin-top: 14px; }
.aipb-initially-hidden { display: none; }

/* SECTION HEADER */
.aipb-section-title {
  font-family: "poppins-bold", sans-serif;
  font-size: clamp(22px, 3.6vw, 30px);
  font-weight: 600;
  color: var(--aipb-ink);
  text-align: center;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
}

/* UGC ROW */
.aipb-ugc-wrapper { width: 100%; }
.aipb-ugc-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-padding: 14px;
  padding: 0 10px;
}
.aipb-ugc-row::-webkit-scrollbar { display: none; }
.aipb-ugc-card {
  position: relative;
  flex: 0 0 calc((100% - 20px) / 3.2);
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  scroll-snap-align: center;
  cursor: pointer;
  background: #111;
}
.aipb-ugc-card img,
.aipb-ugc-card video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.aipb-ugc-card video {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.aipb-ugc-card.is-playing video { opacity: 1; }
.aipb-ugc-card.is-playing img { opacity: 0; }
/* Drop the #111 placeholder once the video has loaded and covers the card. */
.aipb-ugc-card.video-loaded { background: transparent; }

/* UGC MODAL */
.aipb-ugc-modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  padding: 24px;
}
.aipb-ugc-modal-inner {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  background: #000;
  overflow: hidden;
}
.aipb-ugc-modal-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.aipb-ugc-modal-inner video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.aipb-ugc-modal-inner.video-ready video { opacity: 1; }
.aipb-ugc-close {
  position: absolute;
  top: 30px; right: 30px;
  z-index: 10;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.6);
  color: #000;
  font-size: 18px;
  cursor: pointer;
}

/* TESTIMONIALS */
.aipb-testimonial-section { margin: 32px 0 0; padding: 0 16px; }
.aipb-testimonial-slider { position: relative; }
.aipb-testimonial-viewport {
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  transition: height 280ms ease;
  touch-action: pan-y;
  cursor: grab;
}
.aipb-testimonial-viewport.is-dragging { cursor: grabbing; }
.aipb-testimonial-viewport.is-dragging .aipb-testimonial-slide { user-select: none; }
.aipb-testimonial-track {
  display: flex;
  transition: transform 320ms ease;
  will-change: transform;
  align-items: flex-start;
}
.aipb-testimonial-slide {
  position: relative;
  width: 100%;
  flex: 0 0 100%;
  padding: 15px 25px;
}
.aipb-testimonial-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.aipb-testimonial-name {
  font-family: "poppins-semibold";
  font-size: 14px;
  color: #111;
}
.aipb-testimonial-stars {
  color: #f5b400;
  font-size: 14px;
  letter-spacing: 1px;
}
.aipb-testimonial-date {
  color: #6f6f6f;
  font-size: 12px;
  white-space: nowrap;
}
.aipb-testimonial-text {
  font-size: 12px;
  line-height: 1.6;
  color: #222;
  margin: 0;
}
.aipb-testimonial-arrows {
  position: absolute; inset: 0;
  pointer-events: none;
}
.aipb-testimonial-arrow {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-80%);
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 1px solid #f1d8c6;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  color: var(--aipb-accent-deep);
}
.aipb-testimonial-arrow-prev { left: -10px; }
.aipb-testimonial-arrow-next { right: -10px; }
.aipb-testimonial-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  height: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  width: calc((7 * 10px) + (6 * 6px));
  margin-left: auto;
  margin-right: auto;
  justify-content: flex-start;
}
.aipb-testimonial-dots::-webkit-scrollbar { display: none; }
.aipb-testimonial-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #e8d6c7;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 0 0 auto;
}
.aipb-testimonial-dot.active {
  width: 18px;
  border-radius: 10px;
  background: var(--aipb-accent);
}
.aipb-testimonial-dot[data-dist="1"] { transform: scale(0.9); opacity: 0.55; }
.aipb-testimonial-dot[data-dist="2"] { transform: scale(0.75); opacity: 0.45; }
.aipb-testimonial-dot[data-dist="3"] { transform: scale(0.6); opacity: 0.35; }

/* INFO TABS */
.aipb-tabs-wrapper {
  padding: 6px;
  border-radius: 35px;
  background: #fff;
  border: 2px solid #ffd2b8;
  margin: 0;
}
.aipb-tabs {
  position: relative;
  display: flex;
  background: #fff5ec;
  border-radius: 999px;
  padding: 6px;
}
.aipb-tab-slider {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc((100% - 12px) / 3);
  height: calc(100% - 12px);
  background: var(--aipb-accent);
  border-radius: 999px;
  transition: left 0.35s ease;
}
.aipb-tab-button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--aipb-accent-deep);
  cursor: pointer;
  position: relative;
  z-index: 1;
  text-transform: capitalize;
  font-family: inherit;
}
.aipb-tab-button.active { color: #fff; }
.aipb-tab-content {
  display: none;
  padding: 14px 8px 6px;
  font-size: 12px;
  line-height: 1.45;
  animation: aipbFade 0.25s ease;
}
.aipb-tab-content.active { display: block; }
.aipb-tab-content p {
  margin: 0 0 8px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--aipb-ink);
}
.aipb-tab-details-indent { margin-left: 16px !important; font-size: 12px; }

/* FAQ — re-skin shared FaqWidget tones to AI Photobook palette.
   Sizing/padding/centering left to the shared .faq-section rule so it matches
   Splashbook exactly. */
#aipb-page #faqMount .faq-main-title { display: none; }
/* Tighten the gap to the Reviews section below (shared widget sets 50px). */
#aipb-page #faqMount { margin-bottom: 24px; }
#aipb-page .faq-list { gap: 10px; }
#aipb-page .faq-item {
  background: #fff3e8;
  border: 1px solid #f7d1b5;
  border-radius: 14px;
}
#aipb-page .faq-question-text {
  font-weight: 700;
  color: var(--aipb-ink);
  font-size: 14px;
}
#aipb-page .faq-toggle-icon { color: var(--aipb-accent-deep); }
#aipb-page .answer-content { color: #574535; font-size: 13px; line-height: 1.55; }

/* DESKTOP — keep new sections inside the right column / full-width below gallery */
@media (min-width: 900px) {
  #aipb-page .aipb-fullwidth-section { grid-column: 1 / -1; padding: 0; }
  /* UGC, Testimonials, and the info-tabs (Details/Returns/Support) sit in
     the RIGHT column alongside the sticky gallery — beat the generic
     .aipb-fullwidth-section rule above via #id-on-#id specificity. */
  #aipb-page #ugcMount                 { grid-column: 2; grid-row: 4; margin: 14px 0 0; padding: 0; }
  #aipb-page #aipb-testimonialsSection { grid-column: 2; grid-row: 5; margin: 24px 0 0; padding: 0; }
  #aipb-page #aipb-infoTabsMount       { grid-column: 2; grid-row: 6; margin: 24px 0 0; padding: 0; }
  /* The tabs-wrapper inside the right column doesn't need centering. */
  #aipb-page #aipb-infoTabsMount .aipb-tabs-wrapper { max-width: none; margin: 0; }
  .aipb-ugc-card { flex: 0 0 calc((100% - 60px) / 6.2); }
  .aipb-tabs-wrapper { max-width: 720px; margin: 0 auto; }
  #aipb-page #faqMount { margin-top: 32px; }
}

/* ─── Reviews widget — inherit scrapbook-style layout from reviews.css ──
   We only set --sb-* var mapping so the shared widget renders with the
   AI Photo Book palette. Layout/structure is owned by the shared CSS so
   every product page looks identical. */
:root, body {
  --sb-ink: #1a1a1a;
  --sb-muted: #555;
  --sb-line: #f0e6da;
  --sb-card: #ffffff;
  --sb-shadow: 0 8px 22px rgba(30, 23, 15, 0.08);
  --sb-accent: #ff5722;
  --sb-accent-deep: #e64a19;
  --sb-secondary: #2f9e44;
}

/* Mobile: align FAQ + footer to the body's 16px side gutter.
   FAQ inherits .faq-section padding:10px (too wide); footer panel uses a
   95vw formula (too narrow). Both scoped to this page only — the footer rule
   keys off the unique #aipb-page sibling so the shared/Splashbook footer is
   untouched. Desktop (>=900px) keeps its existing centred layout. */
@media (max-width: 899px) {
  #aipb-page #faqMount { padding-left: 16px; padding-right: 16px; }
  #aipb-page ~ #footer-placeholder .lp-footer-panel { width: calc(100vw - 32px); }
}
