/* ══════════════════════════════════════════════════════════════════════════
   PaellaChef BI · Brand System (shared)
   Tokens + motion + utilities compartidos por las 3 pantallas.
   Acento único de marca: gold #A8923A. Sin dependencias, sin build step.
   Cargar DESPUÉS de la fuente y ANTES del <style> de cada página.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* — Acento de marca (canónico) — */
  --pc-gold:        #A8923A;
  --pc-gold-light:  rgba(168,146,58,0.12);
  --pc-gold-dark:   #8A7630;
  --pc-gold-glow:   rgba(168,146,58,0.28);

  /* — Escala de radios — */
  --pc-r-sm: 8px;
  --pc-r-md: 12px;
  --pc-r-lg: 16px;
  --pc-r-xl: 22px;

  /* — Escala de espaciado (DENSITY 4/10: generoso) — */
  --pc-sp-1: 6px;
  --pc-sp-2: 12px;
  --pc-sp-3: 18px;
  --pc-sp-4: 26px;
  --pc-sp-5: 38px;
  --pc-sp-6: 56px;

  /* — Motion (MOTION 3/10: sutil) — */
  --pc-ease:      cubic-bezier(.22,.61,.36,1);
  --pc-ease-out:  cubic-bezier(.16,1,.3,1);
  --pc-dur-fast:  .16s;
  --pc-dur:       .26s;
  --pc-dur-slow:  .5s;

  /* — Sombras suaves (minimalismo) — */
  --pc-shadow-sm: 0 1px 3px rgba(0,0,0,.18);
  --pc-shadow:    0 6px 22px rgba(0,0,0,.22);
  --pc-shadow-gold: 0 8px 28px rgba(168,146,58,0.16);
}

/* Breakpoints canónicos (referencia, no son CSS): 640 / 768 / 1024 / 1280 */

/* ── Iconos SVG: tamaño consistente (reemplazan emojis) ─────────────────── */
.pc-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pc-ico svg { width: 100%; height: 100%; display: block; }
.pc-ico-lg { width: 1.4em; height: 1.4em; }

/* ── Motion engine: scroll-reveal & entrada ────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--pc-dur-slow) var(--pc-ease-out),
              transform var(--pc-dur-slow) var(--pc-ease-out);
  transition-delay: calc(var(--pc-i, 0) * 60ms);
  will-change: opacity, transform;
}
[data-reveal].pc-in {
  opacity: 1;
  transform: none;
}
[data-reveal="scale"]      { transform: scale(.96); }
[data-reveal="left"]       { transform: translateX(-16px); }
[data-reveal="right"]      { transform: translateX(16px); }
[data-reveal].pc-in        { will-change: auto; }

/* Entradas con keyframes (elementos principales / al montar) */
@keyframes pc-fade-up   { from { opacity:0; transform:translateY(16px);} to { opacity:1; transform:none;} }
@keyframes pc-fade-in   { from { opacity:0;} to { opacity:1;} }
@keyframes pc-scale-in  { from { opacity:0; transform:scale(.94);} to { opacity:1; transform:none;} }
@keyframes pc-pop       { 0%{transform:scale(.8);opacity:0;} 60%{transform:scale(1.04);} 100%{transform:scale(1);opacity:1;} }
@keyframes pc-shimmer   { 0%{background-position:-180% 0;} 100%{background-position:180% 0;} }
@keyframes pc-spin      { to { transform: rotate(360deg);} }

.pc-anim-up    { animation: pc-fade-up   .55s var(--pc-ease-out) both; }
.pc-anim-in    { animation: pc-fade-in   .5s  var(--pc-ease-out) both; }
.pc-anim-scale { animation: pc-scale-in  .5s  var(--pc-ease-out) both; }

/* Transición suave entre vistas/tabs (fallback sin View Transitions API) */
.pc-view-enter { animation: pc-fade-up .4s var(--pc-ease-out) both; }

/* ── Skeleton loading (reserva espacio, evita content jumping) ─────────── */
.pc-skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(160,154,144,0.10);
  border-radius: var(--pc-r-sm);
}
.pc-skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  background-size: 180% 100%;
  animation: pc-shimmer 1.3s infinite;
}

/* ── Spinner inline reutilizable ───────────────────────────────────────── */
.pc-spin { animation: pc-spin .8s linear infinite; transform-origin: center; }

/* ── Microinteracción: lift sutil en tarjetas interactivas ─────────────── */
.pc-lift {
  transition: transform var(--pc-dur) var(--pc-ease),
              box-shadow var(--pc-dur) var(--pc-ease),
              border-color var(--pc-dur) var(--pc-ease);
}
.pc-lift:hover { transform: translateY(-3px); box-shadow: var(--pc-shadow); }

/* ── View Transitions API: cross-fade entre secciones ──────────────────── */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: .28s;
    animation-timing-function: cubic-bezier(.16,1,.3,1);
  }
}

/* ── Accesibilidad: respeta reduced-motion (corta TODO el motion) ──────── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .pc-anim-up, .pc-anim-in, .pc-anim-scale, .pc-view-enter,
  .pc-skeleton::after, .pc-spin { animation: none !important; }
  .pc-lift:hover { transform: none; }
  * { scroll-behavior: auto !important; }
}

/* ── Focus visible coherente (a11y) ────────────────────────────────────── */
:where(a,button,input,select,textarea,[tabindex]):focus-visible {
  outline: 2px solid var(--pc-gold);
  outline-offset: 2px;
  border-radius: var(--pc-r-sm);
}
