/* =========================================================================
 * Account area (Mi cuenta — Mi Transición + Recetas guardadas shell + saved
 * recipe grid). Loaded by functions.php on pages that contain the account
 * header block or the pv-saved-recipes pattern. Tokens-only — no raw hex.
 * Token sources: pages.css + offer.css conventions, theme.json palette.
 *
 * Token map from account-mockup.html / auth-mockup.html raw hex:
 *   --masa (#FAF6EF)        → var(--wp--preset--color--masa)           [page bg]
 *   --masa-deep (#F1EBE1)   → var(--wp--preset--color--masa-deep)      [count badge bg]
 *   --surface (#FFFDF9)     → var(--wp--custom--surface)               [card / header bg]
 *   --ink (#2B2622)         → var(--wp--custom--text)                  [body text]
 *   --ink-soft (#5C5349)    → var(--wp--custom--text-soft)             [muted text]
 *   --line (#E2D6C2)        → var(--wp--custom--border)                [borders]
 *   --cobalt (#1E5BA8)      → var(--wp--custom--brand)                 [active tab / brand]
 *   --cobalt-deep (#14406F) → var(--wp--custom--brand-strong)          [cobalt deep text]
 *   --cobalt-tint (#E7EEF8) → var(--wp--custom--brand-tint)           [tint backgrounds]
 *   --nopal (#3A6B2E)       → var(--wp--custom--accent)               [leaf on / meter]
 *   --nopal-deep (#27500A)  → var(--wp--preset--color--nopal-deep)    [empty state icon]
 *   --nopal-tint (#E3F0D6)  → var(--wp--custom--accent-tint)         [empty state bg]
 *   --terra (#C2552F)       → var(--wp--custom--warm)                 [remove btn / CTA]
 *   --terra-deep (#8A3A1E)  → var(--wp--preset--color--terra-deep)    [eyebrow]
 *   --terra-tint (#F6E4DB)  → var(--wp--custom--warm-tint)           [card placeholder bg]
 *   --r-md (14px)           → var(--wp--custom--radius--md)
 *   --r-lg (22px)           → var(--wp--custom--radius--lg)
 *   --r-pill (999px)        → var(--wp--custom--radius--pill)
 * ====================================================================== */

/* -------------------------------------------------------------------------
 * Account wrapper
 * ---------------------------------------------------------------------- */
.pv-account {
  color: var(--wp--custom--text);
  font-family: var(--wp--preset--font-family--text, "Mulish", system-ui, sans-serif);
  font-size: 17px;
  line-height: 1.6;
}
.pv-account h1,
.pv-account h2,
.pv-account h3 {
  font-family: var(--wp--preset--font-family--display, "Fraunces", Georgia, serif);
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
}
.pv-account a { color: inherit; text-decoration: none; }

/* -------------------------------------------------------------------------
 * Account header block (.pv-account-header from pv_render_account_header)
 * ---------------------------------------------------------------------- */
.pv-account-header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 0;
}

.pv-account__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pv-account__eyebrow {
  font-family: var(--wp--preset--font-family--stamp, "Special Elite", monospace);
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--terra-deep);
  margin: 0;
}

.pv-account__greeting {
  font-size: clamp(28px, 4vw, 38px);
  margin-top: 4px;
}

.pv-account__signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wp--custom--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  padding: 10px 18px;
  border-radius: var(--wp--custom--radius--pill);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Sub-nav */
.pv-account__nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--wp--custom--border);
  margin: 22px 0 0;
  flex-wrap: wrap;
}

.pv-account__tab {
  padding: 12px 4px;
  margin-bottom: -1px;
  font-weight: 700;
  font-size: 15px;
  color: var(--wp--custom--text-soft);
  border-bottom: 2.5px solid transparent;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  text-decoration: none;
}

.pv-account__tab:hover {
  color: var(--wp--custom--brand);
}

.pv-account__tab.is-active {
  color: var(--wp--custom--brand);
  border-bottom-color: var(--wp--custom--brand);
}

.pv-account__count {
  font-size: 12px;
  background: var(--wp--preset--color--masa-deep);
  color: var(--wp--custom--text-soft);
  border-radius: var(--wp--custom--radius--pill);
  padding: 1px 8px;
  font-weight: 700;
}

/* -------------------------------------------------------------------------
 * Saved recipes section (.pv-saved wraps the JS mount)
 * ---------------------------------------------------------------------- */
.pv-saved {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 24px 80px;
}

/* Recipe grid — 3-col desktop, 2-col tablet, 1-col mobile */
.pv-saved__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

/* -------------------------------------------------------------------------
 * Recipe card (.pv-rcard)
 * ---------------------------------------------------------------------- */
.pv-rcard {
  background: var(--wp--custom--surface);
  border: 1px solid var(--wp--custom--border);
  border-radius: var(--wp--custom--radius--lg);
  overflow: hidden;
  position: relative;
}

/* Card image area */
.pv-rcard__img {
  display: block;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  position: relative;
}

.pv-rcard__img--ph {
  background-image: linear-gradient(135deg, var(--wp--custom--warm-tint), var(--wp--custom--warm));
}

/* Leaf meter badge (positioned over image, top-left) */
.pv-saved__meter {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  gap: 3px;
  background: color-mix(in srgb, var(--wp--custom--surface) 92%, transparent);
  border-radius: var(--wp--custom--radius--pill);
  padding: 3px 8px;
}

.pv-pip {
  width: 13px;
  height: 13px;
}

.pv-pip svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.pv-pip.on {
  color: var(--wp--custom--accent);
}

.pv-pip.off {
  color: var(--wp--custom--meter-empty);
}

/* Remove button (★) — top-right of image */
.pv-rcard__remove {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--wp--custom--surface) 95%, transparent);
  border: 0;
  cursor: pointer;
  font-size: 15px;
  color: var(--wp--custom--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.pv-rcard__remove:hover {
  background: var(--wp--custom--warm);
  color: #fff;
}

/* Card body */
.pv-rcard__bd {
  display: block;
  padding: 14px 16px 16px;
  text-decoration: none;
  color: var(--wp--custom--text);
}

.pv-rcard__bd h3 {
  font-size: 18px;
}

.pv-rcard__tag {
  font-size: 12.5px;
  color: var(--wp--preset--color--nopal-deep);
  font-weight: 700;
  margin: 6px 0 0;
}

/* -------------------------------------------------------------------------
 * Empty state
 * ---------------------------------------------------------------------- */
.pv-saved__empty {
  text-align: center;
  max-width: 44ch;
  margin: 30px auto;
  padding: 40px 24px;
  background: var(--wp--custom--surface);
  border: 1px dashed var(--wp--custom--border);
  border-radius: var(--wp--custom--radius--lg);
}

.pv-saved__leaf {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--wp--custom--accent-tint);
  color: var(--wp--preset--color--nopal-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.pv-saved__leaf svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.pv-saved__empty h3 {
  font-size: 21px;
}

.pv-saved__empty p {
  color: var(--wp--custom--text-soft);
  margin: 8px 0 0;
}

/* Shared CTA button (.pv-btn used by empty state + noscript fallback) */
.pv-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wp--custom--warm);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--wp--custom--radius--pill);
  text-decoration: none;
  margin-top: 14px;
}

.pv-btn:hover {
  background: var(--wp--preset--color--terra-deep);
  color: #fff;
}

/* -------------------------------------------------------------------------
 * No-JS fallback
 * ---------------------------------------------------------------------- */
.pv-saved__noscript {
  color: var(--wp--custom--text-soft);
  font-size: 15px;
  margin: 0 0 8px;
}

/* -------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */
@media (max-width: 860px) {
  .pv-saved__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .pv-account-header {
    padding: 28px 16px 0;
  }
  .pv-saved {
    padding: 24px 16px 60px;
  }
  .pv-saved__grid {
    grid-template-columns: 1fr;
  }
  .pv-account__greeting {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pv-rcard__remove,
  .pv-btn {
    transition: none;
  }
}
