/*
 * ZYMARG Cart — CSS Custom Properties
 * Standalone Cart Page Edition v2.2.0
 *
 * This file declares all CSS custom properties used throughout the plugin.
 * It is prepended to zymarg-cart.css via wp_enqueue_style dependency.
 *
 * Design decisions:
 *  - The page/body background is NOT set here. It inherits from the active
 *    WordPress theme (Astra) so the cart page adapts to your theme's colours.
 *  - All component-level colours (cards, buttons, rows) use --zc-* tokens,
 *    which are thin aliases onto the REAL shared --zym-* tokens declared in
 *    zymarg-tokens.css (the canonical file also used by ZYMARG Vendor
 *    Dashboard, Store Page, Single Product, and Reviews Engine). Never
 *    redefine a --zym-* value here, and never invent a --zym-* name that
 *    does not exist in the canonical file — every ZYMARG plugin shares the
 *    same `zymarg-tokens` enqueue handle, so whichever plugin loads first
 *    "wins" and supplies the file for everyone else. A --zc-* alias
 *    pointing at a token that does not exist in the canonical file
 *    resolves to nothing (transparent), which is exactly what happened in
 *    v2.1.0 and is fixed here.
 *  - Dark mode is driven by [data-theme="dark"] on <html>, set by the
 *    site's theme toggle (NOT the OS-level prefers-color-scheme, which is
 *    an unrelated signal). The dark values live in zymarg-tokens.css and
 *    flip automatically under that same selector.
 */

/* ============================================================
   Light mode tokens (default) — aliases onto the REAL shared
   --zym-* tokens in zymarg-tokens.css.
   ============================================================ */
:root {
  /* ── Primary brand ─────────────────────────────────────── */
  --zc-primary:            var(--zym-color-primary);
  --zc-primary-container:  var(--zym-color-secondary);      /* hover / gradient end */
  --zc-inverse-primary:    var(--zym-color-accent);         /* soft accent / on-dark */
  --zc-primary-fixed:      #ffd6fb;                         /* stable tint surface — no canonical token, fixed brand value */
  --zc-on-primary-fixed:   var(--zym-color-dark);           /* text on primary fixed */

  /* ── Secondary ─────────────────────────────────────────── */
  --zc-secondary:           #505f76;   /* no canonical equivalent — unique to this plugin's neutral-blue accents */
  --zc-secondary-container: #d0e1fb;

  /* ── Surface (components only — NOT the page background) ── */
  --zc-surface:           var(--zym-color-bg);           /* widget containers      */
  --zc-surface-container: var(--zym-color-container);    /* vendor row bg, headers */
  --zc-surface-lowest:    var(--zym-color-surface);      /* card / row bg          */
  --zc-inverse-surface:   #283044;                       /* dark elements — no canonical equivalent */

  /* ── Text ──────────────────────────────────────────────── */
  --zc-text-body:  var(--zym-color-dark);
  --zc-text-muted: var(--zym-color-text);

  /* ── Borders ────────────────────────────────────────────── */
  --zc-outline:         var(--zym-color-neutral-text);
  --zc-outline-variant: var(--zym-color-border);

  /* ── Semantic / status ──────────────────────────────────── */
  --zc-success-bg:   var(--zym-color-success-bg);
  --zc-success-text: var(--zym-color-success-text);
  --zc-error-bg:     var(--zym-color-error-bg);
  --zc-error-text:   var(--zym-color-error);
  --zc-warning-bg:   #faeeda;   /* no canonical warning-bg token */
  --zc-warning-text: var(--zym-color-warning);

  /* ── Radii ──────────────────────────────────────────────── */
  --zc-radius-sm: 8px;   /* inputs, steppers */
  --zc-radius-md: var(--zym-radius-card);  /* 16px — cards, blocks */
  --zc-radius-lg: var(--zym-radius-pill);  /* pills, badges */

  /* ── Elevation — real shared shadow tokens (steering: use --zym-shadow-*) ── */
  --zc-shadow: var(--zym-shadow-card);

  /* ── Transitions ────────────────────────────────────────── */
  --zc-transition-fast:   var(--zym-motion-fast);
  --zc-transition-normal: var(--zym-motion-standard);
  --zc-transition-slow:   0.5s ease;

  /* ── Gradients — real shared gradient token (steering: use --zym-gradient) ── */
  --zc-gradient-primary: var(--zym-gradient);
  --zc-gradient-soft:    linear-gradient(135deg, var(--zym-color-accent) 0%, var(--zym-color-secondary) 100%);
  --zc-gradient-dark:    linear-gradient(135deg, #1a1a2e 0%, var(--zym-color-primary) 100%);
}

/* ============================================================
   Dark mode — the --zc-* aliases above already resolve to the
   shared --zym-* dark values automatically, because
   zymarg-tokens.css flips those tokens under [data-theme="dark"]
   (the site's actual theme-toggle attribute). No duplicate
   values needed here for anything with a canonical token.
   ============================================================ */
[data-theme="dark"] {
  --zc-shadow: var(--zym-shadow-card);
  --zc-inverse-surface: #eaedff;
  --zc-secondary-container: #2c2533;
}

/* ============================================================
   Cart wrapper — no background, let the theme show through.
   1200px max-width matches your theme's --zymarg-content-width.
   ============================================================ */
.zymarg-cart-wrapper {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* No background-color: inherits from your active theme */
}

@media (max-width: 768px) {
  .zymarg-cart-wrapper {
    padding-left: 12px;
    padding-right: 12px;
  }
}
