/* fx.css — efectos visuales Envíatelo (inicio + tienda). Cargar en <head> después del CSS de la página */

/* ===== Cursor "dedito" ===== */
html, body { cursor: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M11 3.5a2.5 2.5 0 0 1 5 0V13h1.2V11a2.3 2.3 0 0 1 4.6 0v2.4h1.1V12a2.2 2.2 0 0 1 4.4 0v2.6h.9a2.2 2.2 0 0 1 2.3 2.2V21c0 5.4-3.9 9.5-9.6 9.5h-2.7c-3 0-5.3-1.1-7-3.3L5.7 20a2.6 2.6 0 0 1 4.1-3.2L11 18.3z' fill='%23fff' stroke='%23111' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 12 3, auto; }
a, button, [role=button], input[type=submit], label[for], summary, select,
.card, .oferta-p, .cat-card, .btn-cart, .theme-toggle a, .cat-nav, .pnav, .cbtn {
  cursor: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M11 5.5a2.5 2.5 0 0 1 5 0V14h1.2v-1.6a2.3 2.3 0 0 1 4.6 0V14h1.1v-.8a2.2 2.2 0 0 1 4.4 0v2.4h.9a2.2 2.2 0 0 1 2.3 2.2V22c0 5.4-3.9 9.5-9.6 9.5h-2.7c-3 0-5.3-1.1-7-3.3L5.7 21a2.6 2.6 0 0 1 4.1-3.2L11 19.3z' fill='%2334d399' stroke='%23052e1a' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 12 5, pointer;
}
@media (hover:none), (pointer:coarse) { html, body, a, button { cursor: auto; } }

/* ===== Barra de progreso de scroll ===== */
#fx-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 99999; pointer-events: none;
  background: linear-gradient(90deg, #10b981, #34d399, #60a5fa); box-shadow: 0 0 12px rgba(52,211,153,.8); transition: width .08s linear; }

/* ===== Transición suave entre temas ===== */
body { transition: background-color .45s ease, color .45s ease; }
body.fx-leaving { opacity: 0; transition: opacity .22s ease; }
body.fx-enter { animation: fxFadeIn .45s ease both; }
@keyframes fxFadeIn { from { opacity: 0 } to { opacity: 1 } }

/* ===== Aparición en cascada al hacer scroll ===== */
.fx-reveal { opacity: 0; transform: translateY(26px) scale(.985); transition: opacity .65s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1); transition-delay: var(--d, 0ms); will-change: opacity, transform; }
.fx-reveal.fx-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .fx-reveal { opacity: 1; transform: none; transition: none } }

/* ===== Tilt 3D + brillo en tarjetas ===== */
.fx-tilt { transform-style: preserve-3d; transition: transform .18s ease, box-shadow .18s ease; position: relative; }
.fx-tilt.fx-tilting { transition: none; }
.fx-tilt > .fx-shine { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(260px circle at var(--sx, 50%) var(--sy, 50%), rgba(255,255,255,.26), transparent 60%); transition: opacity .25s; }
.fx-tilt:hover > .fx-shine { opacity: 1; }
.fx-tilt:hover { box-shadow: 0 22px 50px rgba(0,0,0,.35), 0 0 0 1px rgba(52,211,153,.35) !important; }

/* ===== Botón magnético ===== */
.fx-magnet { transition: transform .22s cubic-bezier(.22,1,.36,1); will-change: transform; display: inline-flex; }

/* ===== Pulso de los badges de descuento ===== */
.oferta-pct, .oferta-b { animation: fxPulse 2.4s ease-in-out infinite; }
@keyframes fxPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.55) } 50% { box-shadow: 0 0 0 9px rgba(239,68,68,0) } }
.oferta-b { animation-name: fxPulseG; }
@keyframes fxPulseG { 0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,.55) } 50% { box-shadow: 0 0 0 10px rgba(52,211,153,0) } }

/* ===== Cuenta atrás de ofertas ===== */
.fx-countdown { display: inline-flex; gap: 4px; align-items: center; margin-left: 8px; font-weight: 800; color: #fbbf24; font-variant-numeric: tabular-nums; }
.fx-countdown b { background: rgba(251,191,36,.14); border: 1px solid rgba(251,191,36,.35); border-radius: 7px; padding: 1px 6px; min-width: 30px; text-align: center; font-size: 12px; }
.fx-countdown.fx-urgent { color: #f87171; } .fx-countdown.fx-urgent b { background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.4); animation: fxBlink 1s steps(2) infinite; }
@keyframes fxBlink { to { opacity: .55 } }
body.theme-light .fx-countdown { color: #b45309 } body.theme-light .fx-countdown b { background: #fff7e6 }

/* ===== Texto que se escribe solo (hero) ===== */
.fx-typed { font-weight: 800; font-size: clamp(15px, 1.8vw, 22px); color: #a7f3d0; letter-spacing: .01em; margin: -6px 0 16px; min-height: 1.5em; text-shadow: 0 2px 16px rgba(0,0,0,.6); }
.fx-typed .fx-caret { display: inline-block; width: 2px; height: 1.05em; background: #34d399; margin-left: 3px; vertical-align: -2px; animation: fxBlink .8s steps(2) infinite; }

/* ===== Contadores bajo el hero ===== */
.fx-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px; padding: 14px 18px 0; }
.fx-stats div { text-align: center; }
.fx-stats .n { font-size: clamp(22px, 3vw, 32px); font-weight: 900; letter-spacing: -.02em; background: linear-gradient(90deg, #10b981, #60a5fa); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-variant-numeric: tabular-nums; }
.fx-stats .l { font-size: 12px; font-weight: 700; color: var(--muted, #9fb3cc); text-transform: uppercase; letter-spacing: .08em; }

/* ===== Catálogos: efecto hojear ===== */
.cat-cover { perspective: 900px; }
.cat-cover img { transform-origin: left center; transition: transform .55s cubic-bezier(.22,1,.36,1), box-shadow .55s; backface-visibility: hidden; }
.cat-card:hover .cat-cover img { transform: rotateY(-22deg) translateX(6px); box-shadow: 18px 0 30px rgba(0,0,0,.35); }

/* ===== Iconos de fondo: linterna que sigue al ratón (inicio) ===== */
.fx-glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s;
  -webkit-mask-image: radial-gradient(240px circle at var(--mx, -500px) var(--my, -500px), #000 0%, transparent 70%);
  mask-image: radial-gradient(240px circle at var(--mx, -500px) var(--my, -500px), #000 0%, transparent 70%); }
body.fx-mouse .fx-glow { opacity: .55; }
body::before { background-position: calc(var(--px, 0) * 1px) calc(var(--py, 0) * 1px); }

/* ===== Producto que vuela al carrito (tienda) ===== */
.fx-fly { position: fixed; z-index: 99998; width: 70px; height: 70px; border-radius: 50%; object-fit: cover; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,.45); border: 2px solid #34d399; background: #fff;
  transition: transform .85s cubic-bezier(.4, 0, .2, 1), opacity .85s ease, width .85s, height .85s; }
.fx-bump { animation: fxBump .5s cubic-bezier(.22,1,.36,1); }
@keyframes fxBump { 0% { transform: scale(1) } 35% { transform: scale(1.35) rotate(-6deg) } 70% { transform: scale(.92) } 100% { transform: scale(1) } }
