/* ==========================================================================
   BUY.CSS
   Toilet Issues to Toilet Tissues — Buy / Store Links Page
   Requires: shared.css (loaded first)
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. HERO SECTION
   -------------------------------------------------------------------------- */
.buy-hero {
  background-color: var(--dark-bg);
  padding: 60px 40px 70px;
}

.buy-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 70px;
}


/* --------------------------------------------------------------------------
   2. BOOK COVER COLUMN
   -------------------------------------------------------------------------- */
.buy-book-col {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.buy-book-wrap {
  position: relative;
  width: 220px;
}

.buy-book-img {
  width: 100%;
  border-radius: 10px;
  display: block;
  position: relative;
  z-index: 1;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  animation: bookFloat 5s ease-in-out infinite;
}

/* Warm glow behind cover */
.buy-book-glow {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 40px;
  background: radial-gradient(ellipse, rgba(196, 98, 26, 0.55) 0%, transparent 70%);
  z-index: 0;
  animation: glowPulse 5s ease-in-out infinite;
}

@keyframes bookFloat {
  0%,  100% { transform: translateY(0px);   }
  50%        { transform: translateY(-14px); }
}

@keyframes glowPulse {
  0%,  100% { opacity: 0.6; transform: translateX(-50%) scaleX(1);   }
  50%        { opacity: 1;   transform: translateX(-50%) scaleX(1.15); }
}


/* --------------------------------------------------------------------------
   3. COPY COLUMN
   -------------------------------------------------------------------------- */
.buy-copy-col {
  flex: 1;
  min-width: 0;
  padding-top: 10px;
}

.buy-title {
  font-family: 'Playfair Display', serif;
  font-size: 52px;
  font-weight: 700;
  color: #f0e0c8;
  line-height: 1.1;
  margin-bottom: 10px;
}

.buy-title em {
  font-style: italic;
  color: var(--orange-brown);
}

.buy-author-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #9a8060;
  margin-bottom: 22px;
}

.buy-tagline {
  font-family: 'Source Serif 4', serif;
  font-size: 15px;
  font-style: italic;
  color: #b09878;
  line-height: 1.7;
  max-width: 420px;
  margin-bottom: 28px;
}

/* Star rating row */
.buy-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.star {
  color: var(--orange-brown);
  font-size: 18px;
  display: inline-block;
  animation: starPop 0.4s ease both;
}

.star:nth-child(1) { animation-delay: 0.1s; }
.star:nth-child(2) { animation-delay: 0.2s; }
.star:nth-child(3) { animation-delay: 0.3s; }
.star:nth-child(4) { animation-delay: 0.4s; }
.star:nth-child(5) { animation-delay: 0.5s; }

@keyframes starPop {
  from { opacity: 0; transform: scale(0.4) rotate(-20deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.buy-stars-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #9a8060;
  margin-left: 6px;
}


/* --------------------------------------------------------------------------
   4. QUOTE BAND
   -------------------------------------------------------------------------- */
.buy-quote-band {
  background-color: var(--orange-brown);
  padding: 32px 40px;
  text-align: center;
}

.buy-quote-band blockquote {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-style: italic;
  color: #fff;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.55;
}


/* --------------------------------------------------------------------------
   5. BUY SECTION WRAPPER
   -------------------------------------------------------------------------- */
.buy-section {
  padding: 80px 40px 60px;
  background-color: var(--cream);
}

.buy-section-inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.buy-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 12px;
  line-height: 1.2;
}

.buy-section-sub {
  font-size: 14px;
  color: var(--text-light);
  max-width: 400px;
  margin: 0 auto 52px;
  line-height: 1.7;
}


/* --------------------------------------------------------------------------
   6. BUY BUTTONS GRID
   -------------------------------------------------------------------------- */
.buy-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 0 auto 32px;
}


/* --------------------------------------------------------------------------
   7. INDIVIDUAL BUY BUTTON BASE
   -------------------------------------------------------------------------- */
.buy-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 36px 24px 30px;
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;

  /* Entrance animation */
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease,
    box-shadow 0.35s ease;
}

/* Animated in via JS */
.buy-btn.buy-btn-visible {
  opacity: 1;
  transform: translateY(0);
}

.buy-btn:nth-child(1) { transition-delay: 0s; }
.buy-btn:nth-child(2) { transition-delay: 0.12s; }
.buy-btn:nth-child(3) { transition-delay: 0.24s; }


/* Background layer (colour per platform) */
.buy-btn-bg {
  position: absolute;
  inset: 0;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  transform-origin: bottom center;
}

/* Shimmer sweep */
.buy-btn-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 65%
  );
  background-size: 200% 100%;
  background-position: -100% 0;
  transition: background-position 0.55s ease;
}

.buy-btn:hover .buy-btn-shimmer {
  background-position: 150% 0;
}

/* Content */
.buy-btn-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.buy-btn-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.buy-btn-icon svg {
  width: 100%;
  height: 100%;
}

.buy-btn:hover .buy-btn-icon {
  transform: scale(1.18) rotate(-4deg);
}

.buy-btn-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.buy-btn-platform {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transition: letter-spacing 0.3s ease;
}

.buy-btn:hover .buy-btn-platform {
  letter-spacing: 0.5px;
}

.buy-btn-cta {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.buy-btn:hover .buy-btn-cta {
  opacity: 1;
  transform: translateX(4px);
}

/* Corner tag (RECOMMENDED badge) */
.buy-btn-corner-tag {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 9px;
  z-index: 2;
  pointer-events: none;
}

/* Hover lift + glow */
.buy-btn:hover {
  transform: translateY(-8px) scale(1.02);
  transition:
    opacity 0.7s ease,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s ease;
}

/* Active press feedback */
.buy-btn:active {
  transform: translateY(-2px) scale(0.99) !important;
}


/* --------------------------------------------------------------------------
   8. AMAZON BUTTON THEME
   -------------------------------------------------------------------------- */
.buy-btn--amazon .buy-btn-bg {
  background-color: var(--dark-bg);
  border: 1.5px solid rgba(196, 98, 26, 0.4);
}

.buy-btn--amazon {
  color: #f0e0c8;
}

.buy-btn--amazon:hover {
  box-shadow: 0 18px 50px rgba(196, 98, 26, 0.35), 0 4px 20px rgba(0, 0, 0, 0.5);
}

.buy-btn--amazon:hover .buy-btn-bg {
  background-color: var(--orange-brown);
  border-color: var(--orange-brown);
}

.buy-btn--amazon .buy-btn-corner-tag {
  background-color: var(--orange-brown);
  color: #fff;
}

.buy-btn--amazon:hover .buy-btn-corner-tag {
  background-color: rgba(255, 255, 255, 0.2);
}


/* --------------------------------------------------------------------------
   9. NOTION PRESS BUTTON THEME
   -------------------------------------------------------------------------- */
.buy-btn--notion .buy-btn-bg {
  background-color: #2a1f0f;
  border: 1.5px solid rgba(200, 168, 120, 0.25);
}

.buy-btn--notion {
  color: #c8a878;
}

.buy-btn--notion:hover {
  box-shadow: 0 18px 50px rgba(44, 31, 14, 0.6), 0 4px 20px rgba(0, 0, 0, 0.5);
}

.buy-btn--notion:hover .buy-btn-bg {
  background-color: #3d2b12;
  border-color: rgba(200, 168, 120, 0.5);
}

.buy-btn--notion:hover {
  color: #f0e0c8;
}


/* --------------------------------------------------------------------------
   10. FLIPKART BUTTON THEME
   -------------------------------------------------------------------------- */
.buy-btn--flipkart .buy-btn-bg {
  background-color: #fff8f0;
  border: 1.5px solid var(--border-light);
}

.buy-btn--flipkart {
  color: var(--dark-brown);
}

.buy-btn--flipkart:hover {
  box-shadow: 0 18px 50px rgba(196, 98, 26, 0.2), 0 4px 20px rgba(0, 0, 0, 0.15);
}

.buy-btn--flipkart:hover .buy-btn-bg {
  background-color: var(--light-tan);
  border-color: var(--orange-brown);
}


/* --------------------------------------------------------------------------
   11. SMALL PRINT
   -------------------------------------------------------------------------- */
.buy-small-print {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.5px;
  margin-top: 8px;
}


/* --------------------------------------------------------------------------
   12. FORMAT DIVIDER
   -------------------------------------------------------------------------- */
.format-divider {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 40px;
  background-color: var(--cream);
}

.format-divider-line {
  flex: 1;
  height: 1px;
  background-color: var(--border-light);
}

.format-divider-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-light);
  white-space: nowrap;
}


/* --------------------------------------------------------------------------
   12b. EBOOK SECTION
   -------------------------------------------------------------------------- */
.buy-section--ebook {
  background-color: var(--dark-bg);
  padding-top: 70px;
  padding-bottom: 70px;
}

.buy-section--ebook .section-label {
  color: #c4853a;
}

.buy-section--ebook .buy-section-title {
  color: #f0e0c8;
}

.buy-section--ebook .buy-section-sub {
  color: #9a8060;
}

.buy-section--ebook .buy-small-print {
  color: #9a8060;
}

/* Header row: device icon + copy */
.ebook-header {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 36px;
  text-align: left;
}

.ebook-device-icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  color: var(--orange-brown);
  opacity: 0.85;
  margin-top: 4px;
}

.ebook-device-icon svg {
  width: 100%;
  height: 100%;
}

.ebook-header-copy {
  flex: 1;
}

.ebook-header-copy .buy-section-title,
.ebook-header-copy .buy-section-sub {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}

.ebook-header-copy .section-label {
  margin-bottom: 10px;
}

/* Perks strip */
.ebook-perks {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 48px;
}

.ebook-perk {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  border-right: 1px solid rgba(255,255,255,0.07);
}

.ebook-perk:last-child {
  border-right: none;
}

.ebook-perk-icon {
  font-size: 18px;
  line-height: 1;
}

.ebook-perk-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #9a8060;
}

/* Ebook button grid — same base grid, different spacing */
.buy-buttons-grid--ebook {
  max-width: 800px;
}


/* --------------------------------------------------------------------------
   13. KINDLE BUTTON THEME
   -------------------------------------------------------------------------- */
.buy-btn--kindle .buy-btn-bg {
  background-color: #1a1208;
  border: 1.5px solid rgba(196, 98, 26, 0.35);
}

.buy-btn--kindle {
  color: #f0e0c8;
}

.buy-btn--kindle:hover {
  box-shadow: 0 18px 50px rgba(196, 98, 26, 0.4), 0 4px 20px rgba(0,0,0,0.6);
}

.buy-btn--kindle:hover .buy-btn-bg {
  background-color: var(--orange-brown);
  border-color: var(--orange-brown);
}

.buy-btn--kindle .buy-btn-corner-tag {
  background-color: rgba(196, 98, 26, 0.5);
  color: #f0e0c8;
}

.buy-btn--kindle:hover .buy-btn-corner-tag {
  background-color: rgba(255,255,255,0.2);
  color: #fff;
}


/* --------------------------------------------------------------------------
   14. GOOGLE PLAY BUTTON THEME
   -------------------------------------------------------------------------- */
.buy-btn--google .buy-btn-bg {
  background-color: #141414;
  border: 1.5px solid rgba(200, 168, 120, 0.2);
}

.buy-btn--google {
  color: #c8a878;
}

.buy-btn--google:hover {
  box-shadow: 0 18px 50px rgba(60, 40, 10, 0.7), 0 4px 20px rgba(0,0,0,0.6);
}

.buy-btn--google:hover .buy-btn-bg {
  background-color: #2a1f0f;
  border-color: rgba(200, 168, 120, 0.45);
}

.buy-btn--google:hover {
  color: #f0e0c8;
}


/* --------------------------------------------------------------------------
   15. APPLE BOOKS BUTTON THEME
   -------------------------------------------------------------------------- */
.buy-btn--apple .buy-btn-bg {
  background-color: #2a1f0f;
  border: 1.5px solid rgba(200, 168, 120, 0.15);
}

.buy-btn--apple {
  color: #b09878;
}

.buy-btn--apple:hover {
  box-shadow: 0 18px 50px rgba(44, 31, 14, 0.8), 0 4px 20px rgba(0,0,0,0.5);
}

.buy-btn--apple:hover .buy-btn-bg {
  background-color: #3d2b12;
  border-color: rgba(200, 168, 120, 0.5);
}

.buy-btn--apple:hover {
  color: #f0e0c8;
}


/* --------------------------------------------------------------------------
   16. TRUST STRIP
   -------------------------------------------------------------------------- */
.buy-trust-strip {
  background-color: var(--dark-brown);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 42px 40px;
  gap: 0;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 40px;
}

.trust-num {
  font-family: 'Playfair Display', serif;
  font-size: 44px;
  font-weight: 700;
  color: var(--orange-brown);
  line-height: 1;
  display: block;
}

.trust-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9a8060;
  display: block;
}

.trust-divider {
  width: 1px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   13. RESPONSIVE — Tablet (≤ 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Hero: stack vertically, center */
  .buy-hero-inner {
    flex-direction: column;
    align-items: center;
    gap: 40px;
  }

  .buy-copy-col {
    text-align: center;
    padding-top: 0;
  }

  .buy-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .buy-stars {
    justify-content: center;
  }

  .buy-book-wrap  { width: 180px; }
  .buy-title      { font-size: 38px; }

  /* Buttons: 2-col then 1 below */
  .buy-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .buy-btn:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 360px;
    margin: 0 auto;
    width: 100%;
  }

  .buy-section         { padding: 60px 24px 50px; }
  .buy-section-title   { font-size: 28px; }
  .buy-quote-band      { padding: 28px 24px; }
  .buy-quote-band blockquote { font-size: 17px; }

  .ebook-header        { flex-direction: column; gap: 20px; }
  .ebook-device-icon   { width: 48px; height: 48px; }
  .ebook-perk          { padding: 14px 16px; }
  .format-divider      { padding: 0 24px; }

  .trust-item          { padding: 0 20px; }
  .trust-num           { font-size: 36px; }
  .buy-trust-strip     { padding: 36px 20px; gap: 10px; }

  .buy-hero            { padding: 40px 24px 50px; }
}


/* --------------------------------------------------------------------------
   14. RESPONSIVE — Mobile (≤ 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .buy-title           { font-size: 30px; }

  /* All 3 buttons in a single column */
  .buy-buttons-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: 340px;
  }

  .buy-btn:nth-child(3) {
    grid-column: auto;
    max-width: 100%;
    margin: 0;
  }

  .buy-btn             { padding: 28px 20px 24px; }

  .buy-section-title   { font-size: 24px; }
  .buy-section-sub     { margin-bottom: 36px; }
  .buy-quote-band blockquote { font-size: 15px; }

  /* Trust strip: 2-col grid on small screens */
  .buy-trust-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 32px 24px;
  }

  .trust-divider       { display: none; }
  .trust-item          { padding: 0; }
  .trust-num           { font-size: 32px; }

  .buy-hero            { padding: 32px 20px 44px; }
  .buy-book-wrap       { width: 150px; }
}
