/* PillaLeads — design tokens & global styles */
:root {
  /* Brand */
  --pl-accent: #7c3aed;          /* purple-600 — overridable via Tweaks */
  --pl-accent-bright: #8b5cf6;   /* violet-500 */
  --pl-accent-deep: #5b21b6;     /* purple-800 */
  --pl-accent-ink: #1a0d3a;      /* deep navy-purple for premium card */

  /* Surfaces */
  --pl-bg: #f1ecff;              /* lavender body */
  --pl-bg-2: #ece4ff;            /* lavender deeper */
  --pl-surface: #ffffff;
  --pl-surface-2: #faf8ff;
  --pl-border: rgba(91, 33, 182, 0.10);
  --pl-border-strong: rgba(91, 33, 182, 0.18);

  /* Ink */
  --pl-ink: #0c0a1a;
  --pl-ink-2: #29243d;
  --pl-ink-3: #5b5670;
  --pl-ink-mute: #8a8499;

  /* States */
  --pl-success: #16a34a;
  --pl-warning: #ea580c;
  --pl-danger:  #dc2626;
  --pl-info:    #2563eb;

  /* Radii */
  --pl-r-sm: 8px;
  --pl-r-md: 14px;
  --pl-r-lg: 20px;
  --pl-r-xl: 28px;
  --pl-r-2xl: 36px;
  --pl-r-pill: 999px;

  /* Shadow */
  --pl-shadow-sm: 0 1px 2px rgba(20, 6, 60, .04), 0 1px 1px rgba(20, 6, 60, .04);
  --pl-shadow:    0 6px 24px -8px rgba(60, 24, 140, .15), 0 2px 6px rgba(60, 24, 140, .06);
  --pl-shadow-lg: 0 24px 60px -20px rgba(60, 24, 140, .35), 0 4px 16px rgba(60, 24, 140, .08);

  /* Density (overridable) */
  --pl-density: 1;
  --pl-section-py: calc(120px * var(--pl-density));
  --pl-section-gap: calc(72px * var(--pl-density));
  --pl-card-pad: calc(24px * var(--pl-density));

  /* Type */
  --pl-font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --pl-font-body: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --pl-font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Container */
  --pl-container: 1200px;
  --pl-container-tight: 980px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--pl-font-body);
  background: var(--pl-bg);
  color: var(--pl-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.55;
  /* subtle radial wash */
  background-image:
    radial-gradient(900px 600px at 85% -10%, rgba(124, 58, 237, .18), transparent 60%),
    radial-gradient(800px 600px at -10% 30%, rgba(124, 58, 237, .10), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.pl-container { max-width: var(--pl-container); margin: 0 auto; padding: 0 28px; }
.pl-container-tight { max-width: var(--pl-container-tight); margin: 0 auto; padding: 0 28px; }

/* Display type */
.pl-display {
  font-family: var(--pl-font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}
.pl-eyebrow {
  font-family: var(--pl-font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pl-accent);
}
.pl-accent { color: var(--pl-accent); }
.pl-accent-grad {
  background: linear-gradient(105deg, var(--pl-accent) 0%, var(--pl-accent-bright) 50%, var(--pl-accent) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* Buttons */
.pl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px;
  border-radius: var(--pl-r-pill);
  font-family: var(--pl-font-body);
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
  text-decoration: none;
}
.pl-btn:active { transform: translateY(1px); }
.pl-btn-primary {
  background: var(--pl-ink);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(12, 10, 26, .4), inset 0 1px 0 rgba(255,255,255,.1);
}
.pl-btn-primary:hover { background: #1f1a40; box-shadow: 0 8px 22px -6px rgba(12, 10, 26, .5); }
.pl-btn-accent {
  background: var(--pl-accent);
  color: #fff;
  box-shadow: 0 4px 16px -4px rgba(124, 58, 237, .55), inset 0 1px 0 rgba(255,255,255,.18);
}
.pl-btn-accent:hover { background: var(--pl-accent-bright); }
.pl-btn-ghost {
  background: transparent;
  color: var(--pl-ink);
  border: 1.5px solid rgba(12, 10, 26, .14);
}
.pl-btn-ghost:hover { background: rgba(12, 10, 26, .04); }
.pl-btn-white {
  background: #fff;
  color: var(--pl-ink);
  box-shadow: var(--pl-shadow-sm);
}
.pl-btn-white:hover { background: var(--pl-surface-2); }
.pl-btn-lg { padding: 16px 26px; font-size: 16px; }
.pl-btn-sm { padding: 9px 14px; font-size: 13px; }

/* Cards */
.pl-card {
  background: var(--pl-surface);
  border-radius: var(--pl-r-xl);
  box-shadow: var(--pl-shadow);
  border: 1px solid var(--pl-border);
}
.pl-card-flat {
  background: var(--pl-surface);
  border-radius: var(--pl-r-lg);
  border: 1px solid var(--pl-border);
}

/* Pills */
.pl-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--pl-r-pill);
  font-size: 13px;
  font-weight: 600;
  background: rgba(124, 58, 237, .10);
  color: var(--pl-accent-deep);
  border: 1px solid rgba(124, 58, 237, .18);
}
.pl-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pl-accent); }
.pl-pill-pulse { animation: pl-pulse 1.6s infinite; }

@keyframes pl-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}

/* Section */
.pl-section { padding: var(--pl-section-py) 0; }
.pl-section-head { text-align: center; margin-bottom: 48px; }
.pl-section-head h2 { font-size: clamp(34px, 4.4vw, 56px); margin: 14px 0 16px; }
.pl-section-head p { color: var(--pl-ink-3); font-size: 17px; max-width: 620px; margin: 0 auto; }

/* Utilities */
.pl-grid { display: grid; gap: 24px; }
.pl-flex { display: flex; }
.pl-row { display: flex; align-items: center; }

/* Subtle animations */
@keyframes pl-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pl-fade-in { animation: pl-fade-in .4s ease both; }

/* Sticky launch bar layout adjust */
body.pl-has-bar { padding-top: 42px; }

/* Scrollbar style for inner panels */
.pl-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.pl-scroll::-webkit-scrollbar-thumb { background: rgba(91,33,182,.18); border-radius: 8px; }
.pl-scroll::-webkit-scrollbar-track { background: transparent; }

/* Mark */
mark.pl-mark {
  background: linear-gradient(180deg, transparent 60%, rgba(124, 58, 237, .28) 60%);
  color: inherit;
  padding: 0 2px;
}

/* Underline accent like the original */
.pl-uline {
  background: linear-gradient(180deg, transparent 78%, rgba(124, 58, 237, .35) 78%);
}

/* Hide scrollbar (used in marquees) */
.pl-noscrollbar::-webkit-scrollbar { display: none; }
.pl-noscrollbar { scrollbar-width: none; }

/* ───────────────────────────────────────────────
 * RESPONSIVE — overrides inline styles via [style*=]
 * with !important. Forces multi-col grids to single
 * column on mobile, tightens spacing, scales type.
 * ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --pl-section-py: calc(80px * var(--pl-density));
    --pl-section-gap: calc(48px * var(--pl-density));
  }
  .pl-container, .pl-container-tight { padding: 0 20px; }
  /* 3+ col grids → 2 col */
  [style*="repeat(3, 1fr)"],
  [style*="repeat(4, 1fr)"],
  [style*="repeat(5, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  :root {
    --pl-section-py: calc(56px * var(--pl-density));
    --pl-section-gap: calc(36px * var(--pl-density));
  }
  /* Tighten container padding on phone */
  .pl-container, .pl-container-tight { padding: 0 16px; }

  /* Force ALL grids to 1 column */
  [style*="grid-template-columns"],
  [style*="gridTemplateColumns"] {
    grid-template-columns: 1fr !important;
  }

  /* OVERRIDE: stats strip 4 cols → 2x2 (no 1 col, queda gigante vertical) */
  [style*="repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* OVERRIDE: Klarna strip '1fr auto' → 1 col stack + buttons full width */
  [style*="1fr auto"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  [style*="1fr auto"] > div:last-child {
    flex-direction: column !important;
    width: 100% !important;
  }
  [style*="1fr auto"] > div:last-child a {
    width: 100% !important;
    justify-content: center !important;
    font-size: 13px !important;
    padding: 10px 12px !important;
    white-space: normal !important;
  }

  /* Tabs strip (app-walkthrough): keep horizontal scroll, don't shrink */
  .pl-noscrollbar[style*="overflowX: auto"],
  [style*="overflow-x: auto"][style*="display: flex"] {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .pl-noscrollbar button,
  [style*="overflow-x: auto"][style*="display: flex"] > * {
    flex: 0 0 auto !important;
    min-width: auto !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* Stat cells: reduce padding + border-left on 3rd item (col 1 of row 2) */
  [style*="repeat(4, 1fr)"] > div { padding: 16px !important; }
  [style*="repeat(4, 1fr)"] > div:nth-child(3) { border-left: none !important; border-top: 1px solid var(--pl-border) !important; }
  [style*="repeat(4, 1fr)"] > div:nth-child(4) { border-top: 1px solid var(--pl-border) !important; }

  /* Display headings — clamp aggressively */
  .pl-display, h1, h2 {
    font-size: clamp(28px, 8vw, 40px) !important;
    line-height: 1.1 !important;
    letter-spacing: -0.02em !important;
  }
  .pl-section-head h2 { font-size: clamp(26px, 7vw, 36px) !important; }
  .pl-section-head p { font-size: 15px !important; }

  /* Header — hide nav links on phone, keep logo + CTA */
  header nav { display: none !important; }
  header > div { gap: 8px !important; }
  header .pl-btn-sm { padding: 6px 10px !important; font-size: 12.5px !important; }

  /* Buttons */
  .pl-btn-lg { padding: 14px 22px !important; font-size: 15px !important; width: 100%; }
  .pl-btn-sm { font-size: 12.5px !important; }
  .pl-btn { width: 100% !important; justify-content: center !important; }

  /* Hero — reduce vertical padding */
  section[id="hero"], main > section:first-child { padding-top: 24px !important; padding-bottom: 32px !important; }

  /* Cards — lighter padding */
  [style*="padding: 28px"] { padding: 20px !important; }
  [style*="padding: 32px"] { padding: 22px !important; }
  [style*="padding: 40px"] { padding: 24px !important; }
  [style*="padding: 48px"] { padding: 28px !important; }

  /* Tighten gaps */
  [style*="gap: 40"], [style*="gap: 48"], [style*="gap: 56"] { gap: 20px !important; }
  [style*="gap: 22"], [style*="gap: 28"], [style*="gap: 32"] { gap: 16px !important; }

  /* Video iframe + 16:9 containers */
  [style*="aspectRatio"], [style*="aspect-ratio"] { width: 100% !important; }

  /* Avatars, big circular elements */
  [style*="width: 110"], [style*="width: 96"] { transform: scale(0.85); }

  /* Marquee / horizontal scrolls — preserve */
  .pl-marquee, [data-pl-marquee] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Footer columns stack */
  footer [style*="grid"] { grid-template-columns: 1fr !important; }
  footer { padding: 32px 16px !important; }

  /* Launch bar — compact on phone via dedicated classes (clean, no [style*=]) */
  .pl-launchbar {
    height: 40px !important;
    gap: 8px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    justify-content: space-between !important;
  }
  /* Hide: separator, countdown block, struck price, 'Lanzamiento' word + bullet */
  .pl-launchbar .pl-lb-sep,
  .pl-launchbar .pl-lb-count,
  .pl-launchbar .pl-lb-word { display: none !important; }
  /* Price block: only show '699€ Lifetime' (last <b>) */
  .pl-launchbar .pl-lb-price { gap: 6px !important; min-width: 0 !important; overflow: hidden !important; }
  .pl-launchbar .pl-lb-price b { font-size: 12.5px !important; }
  /* CTA stays compact, never cut */
  .pl-launchbar .pl-lb-cta {
    padding: 5px 10px !important; font-size: 11.5px !important; margin-left: 0 !important;
    flex: 0 0 auto !important; white-space: nowrap !important;
  }
  body.pl-has-bar { padding-top: 40px !important; }

  /* Tables wrap */
  table { display: block !important; overflow-x: auto !important; }

  /* Hide decorative absolute overlays on small screens */
  [aria-hidden="true"][style*="position: absolute"] { opacity: 0.5; }
}

@media (max-width: 480px) {
  .pl-display, h1 { font-size: 28px !important; }
  .pl-section-head h2 { font-size: 24px !important; }
  [style*="font-size: 56"], [style*="fontSize: 56"] { font-size: 28px !important; }
  [style*="font-size: 48"], [style*="fontSize: 48"] { font-size: 26px !important; }
  [style*="font-size: 40"], [style*="fontSize: 40"] { font-size: 24px !important; }
  [style*="font-size: 32"], [style*="fontSize: 32"] { font-size: 20px !important; }
  /* Container even tighter */
  .pl-container, .pl-container-tight { padding: 0 12px; }
}
