/* =============================================================
   COMPONENT PRIMITIVES — PepShop
   Reusable building blocks for all section agents.
   These are deliberately section-agnostic — do not add any
   section-specific overrides here.

   All values reference tokens from styles/tokens.css only.
   No hex literals.
   ============================================================= */


/* =============================================================
   BUTTONS
   ============================================================= */

/* -----------------------------------------------------------
   Base button — shared by all variants
   ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px; /* WCAG touch target minimum */
  padding: var(--space-3) var(--space-5); /* 12px 20px */
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--t-base) ease;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* -----------------------------------------------------------
   Primary — on light backgrounds (white, surface)
   ----------------------------------------------------------- */
.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn--primary:hover {
  filter: brightness(0.85);
  color: var(--color-white);
  text-decoration: none;
}

/* -----------------------------------------------------------
   Primary on dark — for the navy Telegram CTA block
   ----------------------------------------------------------- */
.btn--primary-on-dark {
  background-color: var(--color-white);
  color: var(--color-navy);
}

.btn--primary-on-dark:hover {
  filter: brightness(0.92);
  color: var(--color-navy);
  text-decoration: none;
}

/* -----------------------------------------------------------
   Secondary — text-link style, no background
   ----------------------------------------------------------- */
.btn--secondary {
  background-color: transparent;
  color: var(--color-text-primary);
  padding-inline: 0;
  text-decoration: none;
}

.btn--secondary:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* -----------------------------------------------------------
   Full-width modifier — used on mobile via section CSS
   ----------------------------------------------------------- */
.btn--full {
  display: flex;
  width: 100%;
}

/* -----------------------------------------------------------
   Mobile button sizing — slightly larger touch target
   ----------------------------------------------------------- */
@media (max-width: 767px) {
  .btn {
    min-height: 48px;
    font-size: var(--fs-body);
  }
}


/* =============================================================
   BADGE
   Pill-shaped label for purity claims and featured markers.
   ============================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2-half, 10px);
  padding-block: 4px;
  padding-inline: 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: var(--fs-micro); /* 13px */
  letter-spacing: 0.04em;
  background-color: var(--color-accent-soft);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  line-height: 1.4;
}

/* ALL CAPS permitted only inside .badge — brand rule §8.3 */
.badge--caps {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* =============================================================
   CARD
   Product card and generic white elevated surface.
   No box-shadow. No gradient. Border + radius only.
   ============================================================= */
.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5); /* 20px on mobile */
  display: flex;
  flex-direction: column;
  gap: var(--space-4); /* 16px */
}

@media (min-width: 640px) {
  .card {
    padding: var(--space-6); /* 24px on tablet+ */
  }
}

/* -----------------------------------------------------------
   Featured card — used for Recovery Stack
   ----------------------------------------------------------- */
.card--featured {
  border-color: var(--color-accent);
  position: relative;
  overflow: visible;
}

/* Feature badge anchored to the top-left of the card */
.card__feature-badge {
  position: absolute;
  top: -12px;
  left: var(--space-6);
  /* Inherits .badge styles — section agent applies .badge class */
  z-index: 1;
}


/* =============================================================
   ACCORDION
   Used for FAQ section.
   ============================================================= */
.accordion__item {
  border-bottom: 1px solid var(--color-border);
}

.accordion__item:first-child {
  border-top: 1px solid var(--color-border);
}

.accordion__trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-block: var(--space-5); /* 20px */
  padding-inline: 0;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  gap: var(--space-4);
}

.accordion__trigger:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.accordion__trigger-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--color-text-secondary);
  transition: transform var(--t-base) ease;
}

.accordion__item[data-open="true"] .accordion__trigger-icon {
  transform: rotate(180deg);
}

.accordion__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--t-base) ease;
}

.accordion__item[data-open="true"] .accordion__panel {
  max-height: 600px; /* Generous ceiling; JS overrides for very long answers */
}

.accordion__panel-inner {
  padding-bottom: var(--space-5); /* 20px */
  color: var(--color-text-secondary);
  font-size: var(--fs-body);
  line-height: 1.6;
}


/* =============================================================
   MODAL
   Age gate and any future modal overlay.
   ============================================================= */
.modal__overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-6);
}

.modal__card {
  background-color: var(--color-white);
  max-width: 440px;
  width: 100%;
  padding: var(--space-8); /* 32px */
  border-radius: var(--radius-lg);
}

/* Hide modal when not active */
.modal__overlay[hidden] {
  display: none;
}


/* =============================================================
   ICON SIZE HELPERS
   ============================================================= */
.icon-24 {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.icon-16 {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}


/* =============================================================
   COLOUR UTILITY CLASSES
   For quickly applying token colours to text or backgrounds.
   ============================================================= */
.text-secondary  { color: var(--color-text-secondary); }
.text-accent     { color: var(--color-accent); }
.text-muted      { color: var(--color-text-secondary); }

.bg-navy    { background-color: var(--color-navy); }
.bg-surface { background-color: var(--color-surface); }
.bg-muted   { background-color: var(--color-muted); }
.bg-white   { background-color: var(--color-white); }
