/*
Theme Name: The Sperm Protocol
Theme URI: https://thespermprotocol.com
Description: Official theme for TheSpermProtocol.com — clean, clinical, conversion-focused single-product sales site. WooCommerce digital downloads ready.
Version: 2.2.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
License: Private
Text Domain: sperm-protocol
*/

:root {
  --sp-bg:           #F7F8FA;
  --sp-white:        #FFFFFF;
  --sp-navy:         #1A2B4A;
  --sp-navy-light:   #2C4270;
  --sp-teal:         #0D7A6B;
  --sp-teal-dark:    #095C50;
  --sp-teal-light:   #E6F4F2;
  --sp-teal-mid:     #B8DED9;
  --sp-text:         #3D4A5C;
  --sp-muted:        #7A8899;
  --sp-border:       #DDE3EC;
  --sp-border-light: #EEF1F6;
  --sp-font-disp:    'DM Serif Display', Georgia, serif;
  --sp-font-body:    'DM Sans', system-ui, sans-serif;
  --sp-radius:       8px;
  --sp-radius-lg:    16px;
  --sp-shadow:       0 2px 12px rgba(26,43,74,0.08);
  --sp-shadow-lg:    0 8px 32px rgba(26,43,74,0.12);
  --sp-transition:   0.2s ease;
  --sp-max:          760px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }
body {
  background: var(--sp-bg);
  color: var(--sp-text);
  font-family: var(--sp-font-body);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sp-teal); text-decoration: none; transition: color var(--sp-transition); }
a:hover { color: var(--sp-teal-dark); }
button { cursor: pointer; font-family: var(--sp-font-body); }

h1, h2, h3, h4 {
  font-family: var(--sp-font-disp);
  color: var(--sp-navy);
  line-height: 1.2;
  font-weight: 400;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1rem, 3vw, 1.3rem); }
p { margin-bottom: 1.2rem; color: var(--sp-text); }
p:last-child { margin-bottom: 0; }

.sp-eyebrow {
  font-family: var(--sp-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sp-teal);
  margin-bottom: 0.75rem;
  display: block;
}

.sp-container { max-width: var(--sp-max); margin: 0 auto; padding: 0 24px; }
.sp-section { padding: 80px 0; }

/* HEADER */
.sp-header {
  background: var(--sp-white);
  border-bottom: 1px solid var(--sp-border);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(26,43,74,0.06);
}
.sp-header-inner {
  max-width: var(--sp-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sp-logo { font-family: var(--sp-font-disp); font-size: 1.25rem; color: var(--sp-navy); }
.sp-logo span { color: var(--sp-teal); }
.sp-header-cta {
  background: var(--sp-teal);
  color: var(--sp-white) !important;
  padding: 9px 20px;
  border-radius: var(--sp-radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--sp-transition), transform var(--sp-transition);
}
.sp-header-cta:hover { background: var(--sp-teal-dark); transform: translateY(-1px); color: var(--sp-white) !important; }

/* HERO */
.sp-hero { background: var(--sp-white); padding: 80px 0 64px; border-bottom: 1px solid var(--sp-border); }
.sp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sp-teal-light);
  border: 1px solid var(--sp-teal-mid);
  color: var(--sp-teal-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 28px;
}
.sp-hero-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--sp-teal); flex-shrink: 0; }
.sp-hero h1 { margin-bottom: 24px; }
.sp-hero h1 em { font-style: italic; color: var(--sp-teal); }
.sp-hero-sub { font-size: 1.15rem; color: var(--sp-text); margin-bottom: 36px; max-width: 600px; line-height: 1.75; }
.sp-hero-stats { display: flex; gap: 32px; margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--sp-border); flex-wrap: wrap; }
.sp-stat-num { font-family: var(--sp-font-disp); font-size: 2rem; color: var(--sp-navy); line-height: 1; margin-bottom: 4px; }
.sp-stat-label { font-size: 0.8rem; color: var(--sp-muted); font-weight: 500; }

/* PROOF BAR */
.sp-proof-bar { background: var(--sp-navy); padding: 20px 0; }
.sp-proof-inner { max-width: var(--sp-max); margin: 0 auto; padding: 0 24px; display: flex; gap: 40px; align-items: center; justify-content: center; flex-wrap: wrap; }
.sp-proof-item { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,0.9); font-size: 0.875rem; font-weight: 500; }
.sp-proof-item::before { content: '✓'; width: 20px; height: 20px; border-radius: 50%; background: var(--sp-teal); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; line-height: 20px; text-align: center; }

/* STORY */
.sp-story { background: var(--sp-white); padding: 80px 0; }
.sp-story-text { font-size: 1.05rem; line-height: 1.85; }
.sp-story-text p { color: var(--sp-text); }
.sp-pull-quote { background: var(--sp-teal-light); border-left: 4px solid var(--sp-teal); padding: 24px 28px; margin: 36px 0; border-radius: 0 var(--sp-radius) var(--sp-radius) 0; }
.sp-pull-quote p { font-family: var(--sp-font-disp); font-size: 1.25rem; color: var(--sp-navy); line-height: 1.5; margin: 0; font-style: italic; }

/* RESULTS */
.sp-results-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 36px; }
.sp-result-card { background: var(--sp-white); border: 1px solid var(--sp-border); border-radius: var(--sp-radius-lg); padding: 28px 20px; text-align: center; }
.sp-result-arrow { font-size: 0.8rem; font-weight: 700; color: var(--sp-teal); letter-spacing: 0.05em; margin-bottom: 8px; }
.sp-result-label { font-family: var(--sp-font-disp); font-size: 1.5rem; color: var(--sp-navy); }
.sp-result-sub { font-size: 0.8rem; color: var(--sp-muted); margin-top: 4px; }

/* DOCTOR QUOTE */
.sp-doctor-quote { background: var(--sp-navy); padding: 72px 0; }
.sp-doctor-quote-inner { max-width: 680px; margin: 0 auto; padding: 0 24px; text-align: center; }
.sp-doctor-quote blockquote { font-family: var(--sp-font-disp); font-size: clamp(1.3rem,3vw,1.8rem); color: #fff; font-style: italic; line-height: 1.5; margin: 20px 0 16px; }
.sp-doctor-quote cite { font-size: 0.82rem; color: rgba(255,255,255,0.45); font-style: normal; letter-spacing: 0.05em; }

/* NO CHANGES NEEDED (v2 new section) */
.sp-no-changes { background: var(--sp-navy); padding: 80px 0; }
.sp-no-changes .sp-eyebrow { color: var(--sp-teal-mid); }
.sp-no-changes h2 { color: #fff; margin-bottom: 16px; }
.sp-no-changes-lead { font-size: 1.05rem; color: rgba(255,255,255,0.7); margin-bottom: 40px; line-height: 1.75; }
.sp-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sp-col-card { border-radius: var(--sp-radius-lg); padding: 28px 24px; }
.sp-col-card.without { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }
.sp-col-card.with { background: rgba(13,122,107,0.15); border: 1px solid rgba(13,122,107,0.3); }
.sp-col-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 16px; display: block; }
.without .sp-col-label { color: rgba(255,255,255,0.45); }
.with .sp-col-label { color: var(--sp-teal-mid); }
.sp-col-card ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.sp-col-card ul li { font-size: 0.875rem; display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.without ul li { color: rgba(255,255,255,0.65); }
.with ul li { color: rgba(255,255,255,0.85); }
.without ul li::before { content: '✓'; color: rgba(255,255,255,0.35); flex-shrink: 0; font-weight: 700; font-size: 0.75rem; margin-top: 2px; }
.with ul li::before { content: '✓'; color: var(--sp-teal-mid); flex-shrink: 0; font-weight: 700; font-size: 0.75rem; margin-top: 2px; }

/* WHAT'S INSIDE */
.sp-inside { background: var(--sp-bg); padding: 80px 0; }
.sp-inside-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.sp-inside-card { background: var(--sp-white); border: 1px solid var(--sp-border); border-radius: var(--sp-radius-lg); padding: 28px 24px; transition: box-shadow var(--sp-transition), transform var(--sp-transition); }
.sp-inside-card:hover { box-shadow: var(--sp-shadow-lg); transform: translateY(-2px); }
.sp-inside-icon { width: 44px; height: 44px; border-radius: var(--sp-radius); background: var(--sp-teal-light); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 1.3rem; }
.sp-inside-card h3 { margin-bottom: 8px; font-size: 1rem; color: var(--sp-navy); }
.sp-inside-card p { font-size: 0.875rem; color: var(--sp-muted); margin: 0; line-height: 1.6; }

/* WHY IT WORKS */
.sp-lifestyle { background: var(--sp-white); padding: 80px 0; }
.sp-lifestyle-list { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.sp-lifestyle-list li { list-style: none; display: flex; gap: 16px; align-items: flex-start; background: var(--sp-bg); border: 1px solid var(--sp-border); border-radius: var(--sp-radius); padding: 20px 24px; }
.sp-lifestyle-list li .check { width: 24px; height: 24px; border-radius: 50%; background: var(--sp-teal); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.sp-lifestyle-list li .li-text strong { display: block; font-weight: 600; color: var(--sp-navy); margin-bottom: 3px; font-size: 0.95rem; }
.sp-lifestyle-list li .li-text span { font-size: 0.875rem; color: var(--sp-muted); line-height: 1.5; }

/* PURCHASE */
.sp-purchase { background: var(--sp-bg); padding: 80px 0; }
.sp-purchase-box { background: var(--sp-white); border: 2px solid var(--sp-border); border-radius: var(--sp-radius-lg); padding: 48px 40px; text-align: center; box-shadow: var(--sp-shadow-lg); position: relative; overflow: hidden; }
.sp-purchase-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--sp-teal), var(--sp-teal-dark)); }
.sp-price-tag { margin: 20px 0 8px; }
.sp-price-amount { font-family: var(--sp-font-disp); font-size: 3.5rem; color: var(--sp-navy); line-height: 1; }
.sp-price-note { font-size: 0.875rem; color: var(--sp-muted); margin-bottom: 28px; }
.sp-btn-primary { display: inline-block; background: var(--sp-teal); color: var(--sp-white) !important; font-size: 1.1rem; font-weight: 700; padding: 18px 40px; border-radius: var(--sp-radius); border: none; transition: all var(--sp-transition); cursor: pointer; width: 100%; max-width: 400px; text-align: center; letter-spacing: 0.02em; }
.sp-btn-primary:hover { background: var(--sp-teal-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(13,122,107,0.3); color: var(--sp-white) !important; }
.sp-guarantee { display: flex; align-items: flex-start; gap: 16px; background: var(--sp-teal-light); border: 1px solid var(--sp-teal-mid); border-radius: var(--sp-radius); padding: 20px 24px; margin: 28px 0 0; text-align: left; }
.sp-guarantee-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.sp-guarantee-text strong { display: block; font-weight: 600; color: var(--sp-navy); margin-bottom: 4px; font-size: 0.95rem; }
.sp-guarantee-text span { font-size: 0.85rem; color: var(--sp-text); line-height: 1.5; }
.sp-purchase-includes { margin: 28px 0 0; display: flex; flex-direction: column; gap: 8px; }
.sp-purchase-includes li { list-style: none; font-size: 0.875rem; color: var(--sp-text); display: flex; align-items: center; justify-content: center; gap: 8px; }
.sp-purchase-includes li::before { content: '✓'; color: var(--sp-teal); font-weight: 700; }

/* FAQ */
.sp-faq { background: var(--sp-white); padding: 80px 0; }
.sp-faq-list { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; }
.sp-faq-item { background: var(--sp-white); border: 1px solid var(--sp-border); border-radius: var(--sp-radius); overflow: hidden; }
.sp-faq-q { width: 100%; background: none; border: none; padding: 20px 24px; text-align: left; font-family: var(--sp-font-body); font-size: 0.95rem; font-weight: 600; color: var(--sp-navy); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.sp-faq-q::after { content: '+'; font-size: 1.25rem; color: var(--sp-teal); flex-shrink: 0; transition: transform var(--sp-transition); font-weight: 300; }
.sp-faq-item.open .sp-faq-q::after { transform: rotate(45deg); }
.sp-faq-a { display: none; padding: 0 24px 20px; font-size: 0.9rem; color: var(--sp-text); line-height: 1.7; border-top: 1px solid var(--sp-border-light); }
.sp-faq-item.open .sp-faq-a { display: block; padding-top: 16px; }

/* DISCLAIMER */
.sp-disclaimer { background: var(--sp-bg); padding: 32px 0; border-top: 1px solid var(--sp-border); }
.sp-disclaimer p { font-size: 0.78rem; color: var(--sp-muted); text-align: center; line-height: 1.7; margin: 0; }

/* FOOTER */
.sp-footer { background: var(--sp-navy); padding: 40px 0; }
.sp-footer-inner { max-width: var(--sp-max); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.sp-footer-logo { font-family: var(--sp-font-disp); font-size: 1rem; color: rgba(255,255,255,0.9); }
.sp-footer-logo span { color: var(--sp-teal-mid); }
.sp-footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.sp-footer-links a { font-size: 0.8rem; color: rgba(255,255,255,0.5); transition: color var(--sp-transition); }
.sp-footer-links a:hover { color: rgba(255,255,255,0.9); }
.sp-footer-copy { font-size: 0.75rem; color: rgba(255,255,255,0.35); text-align: center; padding-top: 24px; margin-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); max-width: var(--sp-max); margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }

/* WOOCOMMERCE OVERRIDES */
.woocommerce .button, .woocommerce button.button, .woocommerce input.button, .woocommerce #place_order { background: var(--sp-teal) !important; color: white !important; border-radius: var(--sp-radius) !important; font-family: var(--sp-font-body) !important; font-weight: 600 !important; letter-spacing: 0.02em !important; padding: 14px 28px !important; border: none !important; transition: all var(--sp-transition) !important; }
.woocommerce .button:hover, .woocommerce button.button:hover, .woocommerce #place_order:hover { background: var(--sp-teal-dark) !important; transform: translateY(-1px) !important; }
.woocommerce-page .woocommerce { max-width: var(--sp-max); margin: 0 auto; padding: 48px 24px; }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea { border: 1px solid var(--sp-border) !important; border-radius: var(--sp-radius) !important; padding: 12px 16px !important; font-family: var(--sp-font-body) !important; color: var(--sp-text) !important; }
.woocommerce form .form-row input.input-text:focus, .woocommerce form .form-row textarea:focus { border-color: var(--sp-teal) !important; outline: none !important; box-shadow: 0 0 0 3px rgba(13,122,107,0.12) !important; }
.woocommerce-order-details { background: var(--sp-white); border-radius: var(--sp-radius-lg); padding: 32px; border: 1px solid var(--sp-border); }
.woocommerce-thankyou-order-received { font-family: var(--sp-font-disp); font-size: 1.8rem; color: var(--sp-navy); }

/* ANIMATIONS */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.sp-fade-up { animation: fadeUp 0.6s ease both; }
.sp-fade-up:nth-child(2) { animation-delay: 0.1s; }
.sp-fade-up:nth-child(3) { animation-delay: 0.2s; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .sp-inside-grid { grid-template-columns: 1fr; }
  .sp-results-grid { grid-template-columns: 1fr; gap: 12px; }
  .sp-two-col { grid-template-columns: 1fr; }
  .sp-hero-stats { gap: 24px; }
  .sp-purchase-box { padding: 32px 24px; }
  .sp-proof-inner { gap: 20px; justify-content: flex-start; }
  .sp-footer-inner { flex-direction: column; text-align: center; }
  .sp-btn-primary { font-size: 1rem; padding: 16px 28px; }
  .sp-doctor-quote blockquote { font-size: 1.2rem; }
}

/* ============================================================
   MOBILE FIXES v2.2 — responsive overhaul
   ============================================================ */

/* Tablet breakpoint — 768px */
@media (max-width: 768px) {
  /* Typography scale down */
  h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
  h2 { font-size: clamp(1.3rem, 4vw, 1.8rem); }

  /* Hero */
  .sp-hero { padding: 56px 0 48px; }
  .sp-hero h1 br { display: none; } /* let text reflow naturally */
  .sp-hero-sub { font-size: 1rem; }
  .sp-hero-stats {
    gap: 20px;
    margin-top: 36px;
    padding-top: 28px;
    flex-wrap: wrap;
  }
  .sp-stat-item { min-width: calc(50% - 20px); flex: 1 1 calc(50% - 20px); }
  .sp-stat-num { font-size: 1.6rem; }

  /* Proof bar — stack items */
  .sp-proof-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 0 20px;
  }

  /* Section padding reduction */
  .sp-section { padding: 56px 0; }
  .sp-story { padding: 56px 0; }
  .sp-no-changes { padding: 56px 0; }
  .sp-inside { padding: 56px 0; }
  .sp-lifestyle { padding: 56px 0; }
  .sp-purchase { padding: 56px 0; }
  .sp-doctor-quote { padding: 52px 0; }

  /* Grids → single column */
  .sp-inside-grid { grid-template-columns: 1fr; gap: 12px; }
  .sp-results-grid { grid-template-columns: 1fr; gap: 12px; }
  .sp-two-col { grid-template-columns: 1fr; }

  /* Purchase box */
  .sp-purchase-box { padding: 36px 20px; }
  .sp-price-amount { font-size: 2.8rem; }

  /* FAQ */
  .sp-faq-q { padding: 16px 18px; font-size: 0.9rem; }

  /* Story text */
  .sp-story-text { font-size: 0.95rem; }
  .sp-pull-quote p { font-size: 1.1rem; }

  /* Footer */
  .sp-footer-inner { flex-direction: column; gap: 12px; text-align: center; }
  .sp-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; }
  .sp-footer-links a { font-size: 0.8rem; }

  /* WooCommerce checkout on mobile */
  .woocommerce-page .woocommerce { padding: 28px 16px; }
  .woocommerce form .form-row { width: 100% !important; float: none !important; }
  .woocommerce form .form-row input.input-text { font-size: 16px !important; } /* prevents iOS zoom */
}

/* Small phone breakpoint — 480px */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .sp-container { padding: 0 16px; }

  /* Header */
  .sp-header-inner { padding: 0 16px; }
  .sp-logo { font-size: 1rem; }
  .sp-header-cta { padding: 8px 14px; font-size: 0.8rem; }

  /* Hero */
  .sp-hero { padding: 48px 0 40px; }
  .sp-hero-badge { font-size: 0.72rem; padding: 5px 10px; }
  .sp-hero-sub { font-size: 0.95rem; }
  .sp-stat-item { min-width: calc(50% - 12px); }
  .sp-stat-num { font-size: 1.4rem; }
  .sp-stat-label { font-size: 0.72rem; }

  /* Buttons */
  .sp-btn-primary { font-size: 0.95rem; padding: 15px 20px; max-width: 100%; width: 100%; }

  /* Story */
  .sp-story-text { font-size: 0.9rem; }
  .sp-pull-quote { padding: 16px 18px; }
  .sp-pull-quote p { font-size: 1rem; }

  /* Doctor quote */
  .sp-doctor-quote blockquote { font-size: 1.1rem; }
  .sp-doctor-quote-inner { padding: 0 16px; }

  /* Purchase */
  .sp-purchase-box { padding: 28px 16px; }
  .sp-price-amount { font-size: 2.5rem; }

  /* Proof bar */
  .sp-proof-bar { padding: 16px 0; }
  .sp-proof-item { font-size: 0.82rem; }

  /* Sections */
  [style*="padding:80px 0"] { padding: 48px 0 !important; }

  /* WooCommerce */
  .woocommerce form .form-row input.input-text { font-size: 16px !important; }
  .woocommerce #payment { padding: 16px !important; }
  .woocommerce-page .woocommerce { padding: 20px 16px; }
}
