/* Efectos adicionales del sitio — responsive y accesibles */

/* --- Cursor (solo escritorio; JS añade .fx-cursor-ready) --- */
.fx-cursor-dot,
.fx-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.fx-cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--color-live-green);
  mix-blend-mode: multiply;
}

.fx-cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--color-live-green);
  opacity: 0.45;
  transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease;
}

.fx-cursor-ring.is-hover {
  width: 52px;
  height: 52px;
  opacity: 0.7;
}

@media (pointer: coarse), (max-width: 1023px) {
  .fx-cursor-dot,
  .fx-cursor-ring { display: none !important; }
}

body.fx-cursor-ready {
  cursor: none;
}

body.fx-cursor-ready a,
body.fx-cursor-ready button,
body.fx-cursor-ready .btn,
body.fx-cursor-ready .catalog-card,
body.fx-cursor-ready .category-card {
  cursor: none;
}

/* --- Barra de progreso --- */
.fx-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 100;
  background: linear-gradient(90deg, var(--color-live-green), var(--color-harvest-yellow));
  pointer-events: none;
  transform-origin: left center;
}

/* --- Hero spotlight --- */
.hero.fx-spotlight-active .hero__overlay {
  background:
    radial-gradient(
      circle 180px at var(--fx-spot-x, 50%) var(--fx-spot-y, 50%),
      rgba(255, 255, 255, 0.12) 0%,
      transparent 70%
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
}

@media (max-width: 1023px) {
  .hero.fx-spotlight-active .hero__overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
  }
}

/* --- Ken Burns --- */
.fx-ken-burns .hero__video {
  animation: fxKenBurns 22s ease-in-out infinite alternate;
  transform-origin: center center;
}

@keyframes fxKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* --- Nav shrink --- */
.nav-island.fx-nav-shrink {
  transition: min-height 0.35s ease, padding 0.35s ease, transform 0.35s ease;
}

.nav-island.fx-nav-shrink.is-compact {
  min-height: calc(var(--theme-nav-height, 64px) * 0.82);
  padding-block: 0.35rem;
  transform: scale(0.98);
}

/* --- Nav underline --- */
.fx-nav-underline .nav-links a {
  position: relative;
}

.fx-nav-underline .nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.15rem;
  width: 100%;
  height: 2px;
  background: var(--color-live-green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.fx-nav-underline .nav-links a:hover::after,
.fx-nav-underline .nav-links a:focus-visible::after {
  transform: scaleX(1);
}

/* --- Card shine --- */
.fx-card-shine .catalog-card::after,
.fx-card-shine .category-card::after,
.fx-card-shine .featured-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
  z-index: 3;
}

.fx-card-shine .catalog-card:hover::after,
.fx-card-shine .category-card:hover::after,
.fx-card-shine .featured-card:hover::after {
  transform: translateX(120%);
}

/* --- Card lift toggle --- */
body:not(.fx-card-lift) .catalog-card:hover,
body:not(.fx-card-lift) .category-card:hover .category-card__shell,
body:not(.fx-card-lift) .featured-card--link:hover .featured-card__shell {
  transform: none;
}

body.fx-card-lift .catalog-card:hover {
  transform: translateY(-6px) scale(1.01);
}

/* --- Ripple --- */
.fx-ripple-host {
  position: relative;
  overflow: hidden;
}

.fx-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: fxRipple 0.55s ease-out forwards;
  pointer-events: none;
}

@keyframes fxRipple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* --- Touch feedback --- */
@media (pointer: coarse) {
  body.fx-touch-feedback .btn:active,
  body.fx-touch-feedback .catalog-card:active,
  body.fx-touch-feedback .category-card:active,
  body.fx-touch-feedback .nav-links a:active {
    transform: scale(0.97);
    transition: transform 0.12s ease;
  }
}

/* --- Tema medianoche: ajustes nav --- */
body.theme-midnight .nav-island {
  background: rgba(30, 46, 36, 0.92) !important;
  color: #e8f5e9;
}

body.theme-midnight .nav-links a { color: #c8e6c9; }
body.theme-midnight .grain { opacity: calc(var(--theme-grain-opacity, 0.03) * 1.5); }

/* --- Tema oro: nav y texto en secciones oscuras --- */
body.theme-gold .nav-island {
  background: rgba(26, 26, 26, 0.92) !important;
  color: #f5f5f5;
  border-color: rgba(255, 193, 7, 0.3) !important;
}

body.theme-gold .nav-links a { color: #eeeeee; }
body.theme-gold .nav-logo__text small { color: #9e9e9e; }
body.theme-gold .section-title,
body.theme-gold .category-card__body h3,
body.theme-gold .catalog-card__body h3 {
  color: var(--color-title);
}

body.theme-gold .catalog-card,
body.theme-gold .category-card__inner {
  color: var(--color-text);
}

/* --- Reducir decor en móvil --- */
@media (max-width: 767px) {
  .page-decor {
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-ken-burns .hero__video { animation: none; }
  .fx-cursor-dot,
  .fx-cursor-ring,
  .fx-scroll-progress { display: none !important; }
}
