/* Elite Center Brand System v2 — Store tokens
 *
 * Source: Cloud Design handoff `Docs/Redesign ref/extracted/renew-store-elite-center/project/styles/tokens.css`
 * Verified: 100% brand-aligned with `Docs/elite-brand-guidelines/ELITE-BRAND-SYSTEM-v2.md`.
 *
 * Google Fonts loaded from `functions.php` (`wp_enqueue_style ec-google-fonts`)
 * + preconnects in `header.php` for parallel loading (better performance than @import).
 *
 * Sprint Rediseño Store Fase 1 Sub-fase 1A — 2026-05-08
 */

:root {
  /* Fonts */
  --ec-font-display: "Exo 2", sans-serif;
  --ec-font-body: "Montserrat", sans-serif;
  --ec-font-mono: "JetBrains Mono", monospace;
  --ec-font-label: "Rajdhani", sans-serif;

  /* Brand blacks */
  --ec-black: #060606;
  --ec-black-surface: #212121;
  --ec-black-deep: #0a0a0f;

  /* Primary indigo */
  --ec-primary: #444ce7;
  --ec-primary-dark: #272dcf;
  --ec-primary-light: #e0e0ff;
  /* Primary accent: indigo-300 range. Para eyebrows tinted, splits dark, callouts contextuales. */
  --ec-primary-accent: #9ca0f8;

  /* States */
  --ec-success: #16a34a;
  --ec-error: #dc2626;
  --ec-warning: #d97706;
  --ec-info: #2563eb;
  /* State light variants: chips, badges, alerts, stock indicators sobre fondos oscuros. */
  --ec-success-light: #86efac;
  --ec-error-light: #fca5a5;

  /* Light neutrals (indigo-tinted) */
  --ec-text-primary: #060606;
  --ec-text-secondary: #44455a;
  --ec-text-muted: #75768a;
  --ec-text-hint: #9b9cab;

  /* Surfaces */
  --ec-surface: #ffffff;
  --ec-surface-2: #f2f4f6;
  --ec-surface-3: #f8fafc;
  --ec-border: #e6e8ea;
  --ec-border-hover: #c6c5d8;

  /* Shadows */
  --ec-shadow-ambient:
    0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --ec-shadow-card: 0 4px 12px rgba(0, 0, 0, 0.08);
  --ec-shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
  --ec-shadow-overlay: 0 20px 40px rgba(0, 0, 0, 0.15);

  /* Radii */
  --ec-r-sm: 4px;
  --ec-r-md: 8px;
  --ec-r-lg: 10px;
  --ec-r-xl: 12px;
  --ec-r-2xl: 16px;
  --ec-r-pill: 999px;

  /* Spacing (4pt) */
  --sp-2xs: 4px;
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;
  --sp-4xl: 96px;
}

/* Reset/base within artboards */
.ec {
  font-family: var(--ec-font-body);
  color: var(--ec-text-primary);
  background: var(--ec-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.ec * {
  box-sizing: border-box;
}
.ec img {
  max-width: 100%;
  display: block;
}
.ec button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}
.ec a {
  color: inherit;
  text-decoration: none;
}
.ec h1,
.ec h2,
.ec h3,
.ec h4 {
  margin: 0;
  font-family: var(--ec-font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.ec h2 {
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.25;
}
.ec h3 {
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  font-size: 20px;
}
.ec p {
  margin: 0;
}

/* Reusable */
.ec-price {
  font-family: var(--ec-font-mono);
  font-weight: 500;
  color: var(--ec-text-primary);
  font-variant-numeric: tabular-nums;
}
.ec-mono {
  font-family: var(--ec-font-mono);
}
.ec-label {
  font-family: var(--ec-font-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}
.ec-eyebrow {
  font-family: var(--ec-font-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--ec-primary);
}

.ec-cta {
  font-family: var(--ec-font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ec-primary);
  color: #fff;
  border-radius: var(--ec-r-lg);
  padding: 12px 22px;
  /* Sub-fase 1H Bucket 3 P2: min-height 44px WCAG 2.5.5 (AAA). Padding 12px+12px+13px
   * = ~43px en algunos browsers — min-height garantiza ≥44px cross-browser. */
  min-height: 44px;
  box-sizing: border-box;
  box-shadow: var(--ec-shadow-ambient);
  transition:
    background 0.18s,
    transform 0.12s,
    box-shadow 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ec-cta:hover {
  background: var(--ec-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--ec-shadow-card);
}

.ec-cta-outline {
  font-family: var(--ec-font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ec-primary);
  border: 1px solid var(--ec-primary);
  border-radius: var(--ec-r-lg);
  padding: 11px 22px;
  /* Sub-fase 1H Bucket 3 P2: min-height 44px WCAG 2.5.5 (AAA). */
  min-height: 44px;
  box-sizing: border-box;
  transition: background 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ec-cta-outline:hover {
  background: var(--ec-primary-light);
}

.ec-cta-ghost {
  font-family: var(--ec-font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-r-lg);
  padding: 11px 18px;
  /* Sub-fase 1H Bucket 3 P2: min-height 44px WCAG 2.5.5 (AAA). */
  min-height: 44px;
  box-sizing: border-box;
  color: var(--ec-text-primary);
  transition:
    border-color 0.18s,
    background 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ec-cta-ghost:hover {
  border-color: var(--ec-border-hover);
  background: var(--ec-surface-2);
}

.ec-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--ec-r-pill);
  background: var(--ec-surface-2);
  border: 1px solid var(--ec-border);
  font-family: var(--ec-font-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--ec-text-secondary);
  cursor: pointer;
  /* Sub-fase 1E E8-2: explicit transitions (antes 'all') + micro-interaction
   * translateY -1 + ambient shadow leve para feel responsive en hover. */
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}
.ec-chip:hover {
  border-color: var(--ec-border-hover);
  background: var(--ec-surface);
  transform: translateY(-1px);
  box-shadow: var(--ec-shadow-ambient);
}
.ec-chip.active {
  background: var(--ec-black);
  color: #fff;
  border-color: var(--ec-black);
}
.ec-chip.active:hover {
  background: var(--ec-black-deep);
  border-color: var(--ec-black-deep);
}

.ec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--ec-r-sm);
  font-family: var(--ec-font-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}
.ec-badge.stock {
  background: color-mix(in oklab, var(--ec-success) 10%, transparent);
  color: var(--ec-success);
}
.ec-badge.low {
  background: color-mix(in oklab, var(--ec-warning) 14%, transparent);
  color: var(--ec-warning);
}
.ec-badge.out {
  background: color-mix(in oklab, var(--ec-error) 10%, transparent);
  color: var(--ec-error);
}
.ec-badge.new {
  background: var(--ec-primary-light);
  color: var(--ec-primary-dark);
}
.ec-badge.sale {
  background: var(--ec-black);
  color: #fff;
}

/* Placeholder imagery — subtly striped diagonal */
.ec-ph {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      #f2f4f6 0,
      #f2f4f6 14px,
      #e9ebee 14px,
      #e9ebee 15px
    ),
    #f2f4f6;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--ec-text-hint);
  font-family: var(--ec-font-mono);
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.02em;
}
.ec-ph.dark {
  background:
    repeating-linear-gradient(
      135deg,
      #1a1a1f 0,
      #1a1a1f 14px,
      #141418 14px,
      #141418 15px
    ),
    #17171b;
  color: rgba(255, 255, 255, 0.4);
}
.ec-ph.indigo {
  background:
    repeating-linear-gradient(
      135deg,
      #e7e9fe 0,
      #e7e9fe 14px,
      #dadcfb 14px,
      #dadcfb 15px
    ),
    #e7e9fe;
  color: var(--ec-primary-dark);
}
.ec-ph-label {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
}
.ec-ph.dark .ec-ph-label {
  background: rgba(0, 0, 0, 0.6);
  color: rgba(255, 255, 255, 0.7);
}

/* Input */
.ec-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--ec-r-md);
  border: 1px solid var(--ec-border);
  background: var(--ec-surface);
  font-family: var(--ec-font-body);
  font-size: 14px;
  color: var(--ec-text-primary);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.ec-input:focus {
  outline: 0;
  border-color: var(--ec-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ec-primary) 18%, transparent);
}
.ec-input::placeholder {
  color: var(--ec-text-hint);
}

/* Divider */
.ec-div {
  height: 1px;
  background: var(--ec-border);
}

/* Scroll hide inside artboards */
.ec-scroll {
  overflow: auto;
}
.ec-scroll::-webkit-scrollbar {
  display: none;
}

/* Sub-fase 1F A2 polish — focus-visible rings global ec-* layer.
 * Polish framework §Interaction states: "Every interactive element needs
 * focus state, never remove without replacement". Aplica a todos los CTAs
 * primary/outline/ghost, chips, inputs, links nav, buttons icon. Ring 3px
 * primary @ 18% alpha + outline transparent base = consistente con :focus
 * inputs ya definido. */
.ec-cta:focus-visible,
.ec-cta-outline:focus-visible,
.ec-cta-ghost:focus-visible,
.ec-chip:focus-visible {
  outline: 0;
  box-shadow:
    var(--ec-shadow-ambient),
    0 0 0 3px color-mix(in oklab, var(--ec-primary) 32%, transparent);
}

/* Sub-fase 1F A2 polish — global reduced-motion guard ec-* layer.
 * WCAG 2.3.3 compliance + Apple HIG reduced motion. Existen 2 instancias
 * scoped (ticker home, stock pulse PDP) pero no hay wrapper global para
 * los hover transforms (translateY -1, scale 1.04, etc.) que pueden inducir
 * malestar. Limita transition-duration a casi 0 + animation-duration igual.
 * Solo aplica al ec-* namespace para no afectar 3rd-party plugins. */
@media (prefers-reduced-motion: reduce) {
  .ec-cta,
  .ec-cta-outline,
  .ec-cta-ghost,
  .ec-chip,
  [class*="ec-chrome-"],
  [class*="ec-home-"],
  [class*="ec-archive"],
  [class*="ec-pdp"],
  [class*="ec-product-card"] {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Sub-fase 1F A4 ui-ux-pro-max — utility states skeleton/loading/empty.
 * Quick Reference §3 Performance "progressive-loading skeleton screens".
 * Quick Reference §8 Forms "empty-states helpful message and action".
 * Builder + future enhancements consumen estas classes para wrapping de
 * loading/empty surfaces (archive 0 products, search no results, my-account
 * 0 orders, cart empty). Se mantienen utility-first para reusabilidad. */

/* Skeleton: striped pulse animation neutral, sin colored glow.
 * Asset placeholder mientras carga JS/AJAX async. Brand v2 §7 §9 compliance. */
.ec-skeleton {
  background: linear-gradient(
    90deg,
    var(--ec-surface-2) 0%,
    var(--ec-surface-3) 50%,
    var(--ec-surface-2) 100%
  );
  background-size: 200% 100%;
  animation: ecSkeletonShimmer 1.4s linear infinite;
  border-radius: var(--ec-r-md);
  color: transparent;
  user-select: none;
  pointer-events: none;
}

@keyframes ecSkeletonShimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ec-skeleton {
    animation: none;
    background: var(--ec-surface-2);
  }
}

/* Loading state generic — asignable a cualquier surface durante async
 * (cart update, archive filter, search submit, quote create). Aplica
 * opacity .6 + cursor wait + pointer-events none (UX clarity user no
 * puede interactuar mientras procesa). aria-busy="true" complementa. */
.ec-is-loading,
[aria-busy="true"][class*="ec-"] {
  opacity: 0.6;
  cursor: wait;
  pointer-events: none;
  position: relative;
}

/* Empty state container — utility wrapper para surfaces sin contenido.
 * Centra mensaje + opcional CTA. Brand v2 typography stack + tokens.
 * Quick Reference §8 "empty-states teach the interface". */
.ec-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
  gap: var(--sp-md);
  min-height: 240px;
  color: var(--ec-text-muted);
}

.ec-empty__icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--ec-surface-2);
  border-radius: var(--ec-r-pill);
  color: var(--ec-text-hint);
  margin-bottom: var(--sp-xs);
}

.ec-empty__title {
  font-family: var(--ec-font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ec-text-primary);
  margin: 0;
}

.ec-empty__desc {
  font-family: var(--ec-font-body);
  font-size: 14px;
  line-height: 1.5;
  max-width: 360px;
  margin: 0;
}

/* Error state — para inline form errors o failed async.
 * No usa border-left side stripe (Brand v2 §12 absolute_ban). Background
 * tinted error 10% + border full. */
.ec-error-state {
  background: color-mix(in oklab, var(--ec-error) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--ec-error) 28%, transparent);
  border-radius: var(--ec-r-md);
  padding: var(--sp-sm) var(--sp-md);
  color: var(--ec-error);
  font-family: var(--ec-font-body);
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-xs);
}

.ec-error-state__icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Success state — confirmación inline o toast-like static.
 * Mismo pattern que error, color success. */
.ec-success-state {
  background: color-mix(in oklab, var(--ec-success) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--ec-success) 28%, transparent);
  border-radius: var(--ec-r-md);
  padding: var(--sp-sm) var(--sp-md);
  color: var(--ec-success);
  font-family: var(--ec-font-body);
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-xs);
}
