/* Renéra · Component layer
   Token-built UI primitives shared across pages, extracted from chrome.css (P2 #4 of
   the architecture-evolution backlog) so they live in ONE place instead of being
   redefined per page. Enqueued globally right after brand-base (priority 21) — every
   page gets these without depending on chrome.css. Page-/section-specific variants
   (e.g. .rn-account .rn-btn in my-account.css) still live in their own files and
   override these by selector specificity.

   NOTE: the auth/error pages use a PARALLEL system (.rn-btn-primary in login-page.css /
   error-pages.css) — that is intentional and NOT consolidated here. See the
   "Auth Style Contract".

   Depends on design-system.css for all --renera-* tokens.
   --------------------------------------------------------------------------- */

/* =========================================
   Buttons
   ========================================= */
.rn-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 12px; cursor: pointer;
  font-family: var(--renera-font-mono);
  font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase;
  height: 56px; padding: 0 32px;
  border-radius: var(--renera-r-sm);
  white-space: nowrap; text-decoration: none;
  transition: background var(--renera-dur-fast) var(--renera-ease),
              color var(--renera-dur-fast) var(--renera-ease),
              border-color var(--renera-dur-fast) var(--renera-ease);
}
.rn-btn .rn-arrow { transition: transform var(--renera-dur-base) var(--renera-ease); }
.rn-btn:hover .rn-arrow { transform: translateX(4px); }

.rn-btn--primary {
  background: var(--renera-btn-bg); color: var(--renera-btn-fg);
  border: 1px solid var(--renera-btn-bg);
}
/* Hover only — no `:focus` variant. Focus does not repaint a button: a tap
   leaves focus behind, so a focus fill sticks after the finger lifts (the
   "selection effect"). Keyboard users get the UA focus-visible ring. */
.rn-btn--primary:hover {
  background: var(--renera-btn-bg-hover);
  color: var(--renera-btn-fg-hover);
  border-color: var(--renera-btn-bg-hover);
}

.rn-btn--secondary {
  background: transparent; color: var(--renera-olive-700);
  border: 1px solid var(--renera-olive-700);
}
@media (hover: hover) {
  .rn-btn--secondary:hover { background: var(--renera-olive-700); color: var(--renera-sand-200); }
}

.rn-btn--invert {
  background: var(--renera-sand-200); color: var(--renera-olive-700);
  border: 1px solid var(--renera-sand-200);
}
@media (hover: hover) {
  .rn-btn--invert:hover {
    background: var(--renera-sand-100);
    color: var(--renera-olive-700);
    border-color: var(--renera-sand-100);
  }
}

.rn-btn--ghost-invert {
  background: transparent; color: var(--renera-sand-200);
  border: 1px solid rgba(246,238,232,0.6);
}
@media (hover: hover) {
  .rn-btn--ghost-invert:hover {
    background: var(--renera-sand-200); color: var(--renera-olive-700);
    border-color: var(--renera-sand-200);
  }
}
.rn-btn--sm { height: 44px; padding: 0 22px; font-size: 11px; }

/* =========================================
   Icon button
   Glyph-only control — stepper −/+, carousel and rail arrows, gallery nav.
   The shared shape and the one hover every icon button uses. Existing
   components (.rn-qty button, .rn-carousel-btn, .rn-co-qty__btn, …) keep
   their own selectors for size/shape but pull the hover from the same
   --renera-iconbtn-* tokens, so the colour is defined once.
   ========================================= */
.rn-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent;
  border: 1px solid var(--renera-olive-700);
  border-radius: var(--renera-r-sm);
  color: var(--renera-olive-700);
  cursor: pointer;
  transition: background var(--renera-dur-fast) var(--renera-ease),
              color var(--renera-dur-fast) var(--renera-ease),
              border-color var(--renera-dur-fast) var(--renera-ease);
}
/* Hover only — see the .rn-btn--primary note above on why focus never repaints.
   Guarded by (hover: hover): a touch screen has no pointer to hover with, so the
   browser applies :hover on tap and leaves it applied until the next tap
   elsewhere — an unguarded hover fill reads as a stuck "selected" state. */
@media (hover: hover) {
  .rn-iconbtn:hover:not(:disabled) {
    background: var(--renera-iconbtn-bg-hover);
    border-color: var(--renera-iconbtn-bg-hover);
    color: var(--renera-iconbtn-fg-hover);
  }
}
.rn-iconbtn:disabled {
  border-color: var(--renera-clay-300);
  color: var(--renera-clay-300);
  cursor: default;
}
.rn-iconbtn--round { border-radius: 50%; width: 52px; height: 52px; }
.rn-iconbtn--bare  { border-color: transparent; border-radius: 0; }
.rn-iconbtn--invert {
  border-color: rgba(246,238,232,0.6);
  color: var(--renera-sand-200);
}
@media (hover: hover) {
  .rn-iconbtn--invert:hover:not(:disabled) {
    background: var(--renera-iconbtn-bg-hover-invert);
    border-color: var(--renera-iconbtn-bg-hover-invert);
    color: var(--renera-iconbtn-fg-hover-invert);
  }
}

/* =========================================
   Mono link
   ========================================= */
.rn-link-mono {
  font-family: var(--renera-font-mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--renera-olive-700); text-decoration: none;
  border-bottom: 1px solid var(--renera-clay-300);
  padding-bottom: 2px;
  transition: border-color var(--renera-dur-fast) var(--renera-ease),
              color var(--renera-dur-fast) var(--renera-ease);
}
.rn-link-mono:hover { color: var(--renera-olive-500); border-color: var(--renera-olive-500); }
.rn-link-mono--invert { color: var(--renera-sand-200); border-color: rgba(246,238,232,0.4); }
.rn-link-mono--invert:hover { color: var(--renera-olive-300); border-color: var(--renera-olive-300); }

/* =========================================
   Eyebrow — with leading hairline
   (auth pages keep their own .rn-eyebrow in login-page.css — its margin is !important)
   ========================================= */
.rn-eyebrow {
  font-family: var(--renera-font-mono);
  font-size: 11px; font-weight: 400;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--renera-mute);
  display: inline-flex; align-items: center; gap: 14px;
  margin: 0;
}
.rn-eyebrow::before {
  content: ""; display: inline-block;
  width: 28px; height: 1px; background: var(--renera-clay-300);
}
.rn-eyebrow--plain::before { display: none; }
.rn-eyebrow--invert       { color: rgba(246,238,232,0.7); }
.rn-eyebrow--invert::before { background: rgba(246,238,232,0.4); }
.rn-eyebrow--center { display: inline-flex; }

/* =========================================
   Cards
   ========================================= */
.rn-card {
  background: var(--renera-sand-300);
  border: 1px solid var(--renera-clay-300);
  border-radius: var(--renera-r-lg);
}
.rn-card--paper { background: var(--renera-paper); border-color: var(--renera-clay-300); box-shadow: var(--renera-shadow-card); }
.rn-card--clay  { background: var(--renera-clay-100); border-color: var(--renera-clay-300); }

/* =========================================
   Toasts (Toastify re-skin)
   ========================================= */
/* Both toast call sites — the WC notice→toast bridge (wc-toast-functions.php)
   and the cart promo toast (cart.js) — render through Toastify, whose stock
   skin is a blue gradient. Re-skinned here once so every toast is on-brand;
   the call sites pass no styling and need no JS changes.

   Why !important + div.toastify: the Customizer's Additional CSS is per-env
   DB data a git deploy can't change, and it historically carried a legacy
   `.toastify` white-card skin with !important (removed from the local DB
   2026-08-09 — backup in scripts/.state/custom-css-backup-2026-08-09-*.css —
   but .net/prod may still hold it). Additional CSS prints after enqueued
   sheets, so only same-importance + higher specificity beats it. Do NOT
   soften these back to plain declarations. */
div.toastify {
  background: var(--renera-olive-700) !important;
  color: var(--renera-sand-200) !important;
  font-family: var(--renera-font-sans) !important;
  font-size: 15px !important; line-height: 1.5;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 14px 20px;
  border: 0 !important;
  border-radius: var(--renera-r-sm) !important;
  box-shadow: var(--renera-shadow-lift) !important;
}
div.toastify .toast-close {
  color: var(--renera-sand-200);
  opacity: 0.55;
  font-size: 16px; line-height: 1;
  margin-left: auto;
  padding: 0 0 0 12px;
  transition: opacity var(--renera-dur-fast) var(--renera-ease);
}
div.toastify .toast-close:hover { opacity: 1; }
/* Forward link a WC notice may carry (e.g. "View cart") — keep it a quiet
   underlined link, not the legacy Elementor pill button. */
div.toastify a.wc-forward {
  display: inline !important;
  background: none !important;
  border: 0 !important;
  margin: 0 0 0 10px !important;
  color: var(--renera-sand-200) !important;
  font-family: var(--renera-font-sans) !important;
  font-size: 14px !important;
  text-transform: none !important;
  text-shadow: none !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
