/* ==========================================================================
   SENDJOY PREMIUM STYLESHEET (Apple & Stripe Inspired)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #1B8F5A;
  --accent: #F5B700;
  --bg: #FFFFFF;
  --section-bg: #F8FAF9;
  --text: #1F2937;
  --muted: #6B7280;
  --border: #E5E7EB;
  --font: 'Poppins', -apple-system, sans-serif;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Typography Utility */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
p { color: var(--muted); line-height: 1.6; font-weight: 400; }
a { text-decoration: none; color: inherit; transition: var(--transition); }

/* Global Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 99px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #146d44; transform: translateY(-1px); }
.btn-secondary { background: var(--section-bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #eef2f0; }

.section { padding: 6rem 1.5rem; }
.section-light { background: var(--bg); }
.section-alt { background: var(--section-bg); }
.container { max-width: 1140px; margin: 0 auto; width: 100%; }

.section-title { text-align: center; font-size: 2.25rem; margin-bottom: 3rem; }
.section-title span { color: var(--primary); }
.section-subtitle { text-align: center; color: var(--muted); font-size: 1.05rem; margin-top: -2rem; margin-bottom: 3rem; max-width: 500px; margin-inline: auto; }

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: var(--transition);
  padding: 1.25rem 1.5rem;
}
.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 10px rgba(0,0,0,0.05);
  padding: 0.85rem 1.5rem;
}
.nav-container {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.logo span { color: var(--primary); }
.nav-menu { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-link { font-size: 0.95rem; font-weight: 500; color: var(--text); opacity: 0.8; }
.nav-link:hover { opacity: 1; color: var(--primary); }

/* Mobile hamburger toggle - hidden on desktop */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  touch-action: manipulation;
}
.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.header.mobile-nav-open .mobile-menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header.mobile-nav-open .mobile-menu-toggle span:nth-child(2) { opacity: 0; }
.header.mobile-nav-open .mobile-menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu-mobile {
  display: none;
  list-style: none;
  flex-direction: column;
  gap: 0;
  max-height: 0;
  overflow: hidden;
  background: var(--bg);
  transition: max-height 0.3s ease;
}
.header.mobile-nav-open {
  background: var(--bg);
  box-shadow: 0 1px 10px rgba(0,0,0,0.05);
}
.header.mobile-nav-open .nav-menu-mobile {
  max-height: 400px;
}
.nav-menu-mobile a {
  display: block;
  padding: 1rem 1.5rem;
  font-weight: 500;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding-top: 10rem;
  padding-bottom: 6rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-content h1 { font-size: 3.5rem; margin-bottom: 1.5rem; letter-spacing: -1px; }
.hero-content p { font-size: 1.15rem; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; }
.hero-illustration svg { width: 100%; height: auto; max-width: 500px; display: block; margin: 0 auto; }

.hero-slideshow {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 5 / 4;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  background: var(--section-bg);
}
.hero-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-slide.active { opacity: 1; }

/* ==========================================================================
   HOW IT WORKS
   ========================================================================== */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.step-card { background: var(--bg); padding: 2.5rem; border-radius: 16px; border: 1px solid var(--border); position: relative; }
.step-num { font-size: 3.5rem; font-weight: 700; color: rgba(27, 143, 90, 0.1); position: absolute; top: 1rem; right: 1.5rem; }
.step-card h3 { margin-top: 1rem; margin-bottom: 0.75rem; font-size: 1.25rem; }

/* ==========================================================================
   FEATURED GIFTS
   ========================================================================== */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.product-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 20px;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.04); border-color: var(--primary); }
.product-badge {
  background: #E8F4EE; color: var(--primary); font-size: 0.75rem; font-weight: 600;
  padding: 0.25rem 0.75rem; border-radius: 99px; width: fit-content; margin-bottom: 1rem;
}
.product-card .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.product-card h3 { margin-bottom: 0.75rem; }
.product-card p { flex-grow: 1; margin-bottom: 1.5rem; }
.product-price { font-size: 1.75rem; font-weight: 700; color: var(--text); margin-bottom: 1.5rem; }
.product-price span { font-size: 1rem; font-weight: 500; color: var(--muted); }

/* ==========================================================================
   WHY SENDJOY
   ========================================================================== */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.why-card { text-align: center; padding: 1.5rem; }
.why-card .icon { font-size: 3rem; margin-bottom: 1rem; }
.why-card h3 { margin-bottom: 0.5rem; }

/* ==========================================================================
   TESTIMONIALS & FAQ
   ========================================================================== */
.testimonials-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.testimonial-card { background: var(--section-bg); padding: 2.5rem; border-radius: 16px; border-left: 4px solid var(--primary); }
.testimonial-card p { font-style: italic; font-size: 1.1rem; margin-bottom: 1.5rem; color: var(--text); }
.testimonial-meta { font-weight: 600; font-size: 0.95rem; }
.testimonial-meta span { font-weight: 400; color: var(--muted); }

.faq-container { max-width: 750px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.faq-item { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: var(--transition); }
.faq-question { padding: 1.25rem 1.5rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.faq-answer { padding: 0 1.5rem; max-height: 0; overflow: hidden; transition: var(--transition); opacity: 0; }
.faq-item.active .faq-answer { padding-bottom: 1.25rem; max-height: 200px; opacity: 1; }

/* ==========================================================================
   CTA SECTION & FOOTER
   ========================================================================== */
.cta-banner { background: var(--primary); color: #fff; padding: 5rem 2rem; border-radius: 24px; text-align: center; }
.cta-banner h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.cta-banner p { color: rgba(255,255,255,0.85); font-size: 1.1rem; margin-bottom: 2rem; max-width: 600px; margin-inline: auto; }
.cta-banner .btn { background: var(--bg); color: var(--primary); font-weight: 600; }
.cta-banner .btn:hover { background: var(--section-bg); }

.contact-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin-bottom: 3rem; }
.contact-card {
  flex: 0 1 320px;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--section-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}
.contact-card .icon { font-size: 1.75rem; flex-shrink: 0; }
.contact-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.15rem; }
.contact-value { font-weight: 600; color: var(--text); word-break: break-word; }

.footer { border-top: 1px solid var(--border); padding: 4rem 1.5rem 2rem 1.5rem; background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4rem; margin-bottom: 3rem; }
.footer-brand p { margin-top: 1rem; max-width: 320px; }
.footer-links h4 { font-size: 1rem; margin-bottom: 1.25rem; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; display: flex; justify-content: space-between; color: var(--muted); font-size: 0.875rem; }

/* ==========================================================================
   TYPEFORM-STYLE FULLSCREEN MODAL WIZARD
   ========================================================================== */
.wizard-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.wizard-overlay.active { display: flex; flex-direction: column; opacity: 1; }

.wizard-header {
  flex-shrink: 0;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}
.wizard-header .logo { flex-shrink: 0; }
.wizard-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  position: relative;
  z-index: 20;
  border-radius: 50%;
}
.wizard-close:active { background: var(--section-bg); }
.progress-container {
  flex: 1 1 auto;
  max-width: 200px;
  min-width: 50px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar { width: 0%; height: 100%; background: var(--primary); transition: width 0.3s ease; }

.wizard-body {
  max-width: 650px;
  margin: 0 auto;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  position: relative;
  padding: 1rem 1.5rem;
}
#gifting-wizard-form,
#wizard-steps-container {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
}
.wizard-step {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.wizard-step.active {
  /* Flex column so the options-grid (flex: 1, see below) can fill exactly
     whatever vertical space is left after the label/question/search bar,
     instead of guessing at a vh percentage. This is what makes cards fit
     correctly whether or not the search bar has been toggled open. */
  display: flex;
  flex-direction: column;
  min-height: 0;
  opacity: 1;
  transform: translateY(0);
}

.step-label { flex-shrink: 0; font-size: 1.1rem; color: var(--primary); font-weight: 500; margin-bottom: 0.5rem; display: block; }
.step-question { flex-shrink: 0; font-size: 2rem; font-weight: 600; margin-bottom: 2rem; color: var(--text); }

/* Form Field Styling */
.wizard-input-text {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--border);
  font-size: 1.75rem;
  padding: 0.5rem 0;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}
.wizard-input-text:focus { border-color: var(--primary); }

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-content: flex-start;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  /* Long lists (e.g. the 49 occasion cards) won't all fit on screen at
     once, so the grid scrolls internally instead of pushing the Next/Back
     footer buttons off-screen. flex: 1 + min-height: 0 makes it fill
     exactly whatever vertical space remains under the label/question/
     search bar (whether or not the search bar is toggled open), rather
     than guessing at a fixed vh/px cap that may be too big or too small
     depending on step content and viewport. */
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.option-card {
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.option-card:hover { border-color: var(--primary); background: var(--section-bg); }
.option-card.selected { border-color: var(--primary); background: #E8F4EE; }
.option-card .icon { font-size: 1.5rem; }
.option-card .icon.swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.review-summary { display: flex; flex-direction: column; gap: 0.75rem; max-height: 380px; overflow-y: auto; padding-right: 0.5rem; }
.review-item { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; font-size: 0.95rem; }
.review-item strong { color: var(--text); }

.wizard-footer {
  flex-shrink: 0;
  max-width: 650px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem 2rem;
}
.wizard-footer .btn { padding: 0.75rem 1.5rem; }
/* Back button pinned far left, Next/Pay button pinned far right, the
   keyboard hint (if visible) sits in the middle. justify-content:
   space-between handles the left/right pinning; visibility:hidden on
   the back button (step 1) still reserves its space so Next stays put. */

/* Search toggle inside wizard steps */
.wizard-search-wrapper {
  flex-shrink: 0;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.wizard-search-toggle {
  background: var(--section-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.wizard-search-toggle:hover,
.wizard-search-toggle.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #E8F4EE;
}
.wizard-search {
  display: none;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  background: var(--bg);
  color: var(--text);
}
.wizard-search.active {
  display: block;
}
.wizard-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 143, 90, 0.1);
}

/* Keyboard hint styling */
.nav-hint { font-size: 0.8rem; color: var(--muted); align-self: center; text-align: center; }

/* ==========================================================================
   SITE-WIDE BANNERS (maintenance / offline) - text comes from
   SendJoyConfig.systemMessages, shown/hidden via SendJoyConfig.features
   ========================================================================== */
.maintenance-banner, .offline-banner {
  width: 100%;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
  color: #fff;
}
.maintenance-banner { background: var(--accent); color: #1F2937; }
.offline-banner { background: var(--text); }

/* Footer legal links row */
.footer-bottom { flex-wrap: wrap; gap: 1rem; }
.footer-bottom-left { display: flex; flex-direction: column; }
.footer-legal-links { display: flex; gap: 1.25rem; list-style: none; padding: 0; margin: 0; }
.footer-legal-links a { color: var(--muted); font-size: 0.875rem; }
.footer-legal-links a:hover { color: var(--primary); }

/* Optional product image / audio preview (used when a product entry
   sets "image" and/or "audioPreview" in config.js) */
.product-image {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}
.product-audio { width: 100%; margin-bottom: 1.25rem; }
.option-card-image {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
}

/* Optional per-step help text under a wizard question */
.step-help-text { color: var(--muted); font-size: 0.95rem; margin-top: -1.5rem; margin-bottom: 1.5rem; }

/* Empty-state message for an options step with no items configured */
.empty-state-text { color: var(--muted); font-style: italic; }

/* FAQ category grouping headings (only shown if faq items set "category") */
.faq-category-heading {
  font-size: 1rem;
  color: var(--primary);
  margin: 2rem 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.faq-category-heading:first-child { margin-top: 0; }

/* Payment method badges + instructions on the checkout step */
.payment-methods { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.payment-method-badge {
  background: var(--section-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text);
}
.payment-instructions { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 960px) {
  .hero-section { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
  .hero-actions { justify-content: center; }
  .steps-grid, .products-grid, .why-grid, .testimonials-grid { grid-template-columns: 1fr; }
  .contact-grid { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }

  .nav-menu { display: none; }
  .desktop-only-cta { display: none; }
  .mobile-menu-toggle { display: flex; }
  .nav-menu-mobile { display: flex; }
}

@media (max-width: 600px) {
  .section { padding: 3.5rem 1.25rem; }
  .section-title { font-size: 1.75rem; margin-bottom: 2rem; }
  .section-subtitle { margin-top: -1.25rem; margin-bottom: 2rem; }

  .hero-section { padding-top: 7rem; padding-bottom: 3rem; }
  .hero-content h1 { font-size: 2.25rem; }
  .hero-content p { font-size: 1rem; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }

  .contact-grid { justify-content: center; }

  .cta-banner { padding: 3rem 1.5rem; }
  .cta-banner h2 { font-size: 1.75rem; }

  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

  /* Wizard - shrink text and spacing so nothing overflows small screens */
  .wizard-header { padding: 1rem; }
  .wizard-body { padding: 0.75rem 1.25rem; }
  .step-question { font-size: 1.4rem; margin-bottom: 1.5rem; }
  .wizard-input-text { font-size: 1.25rem; }
  .options-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.6rem;
    width: 100%;
    min-width: 0;
    padding-right: 0.35rem;
  }
  .option-card {
    flex-direction: column;
    text-align: center;
    padding: 0.75rem 0.5rem;
    gap: 0.4rem;
    border-radius: 10px;
  }
  .option-card .icon { font-size: 1.25rem; }
  .option-card strong { font-size: 0.85rem; line-height: 1.25; word-break: break-word; }
  .option-card small { font-size: 0.7rem; }
  .wizard-footer { padding: 0.75rem 1.25rem 1.5rem; flex-wrap: wrap; }
  .nav-hint { display: none; }
}

/* Touch devices (phones/tablets) have no physical Enter key, so the
   keyboard hint in the wizard footer isn't useful - hide it there too. */
@media (hover: none) and (pointer: coarse) {
  .nav-hint { display: none; }
}