/* Lenguaje de movimiento compartido. Sin modificar estados ni esperar para navegar. */
body :is(
  .ffl-hero-cta, .ffl-calculator-callout__button, .ffl-how__button,
  .ffl-c-btn, .ffl-c-channel, .ffl-about-cta-row a,
  .ffl-filter, .ffl-quote-toggle,
  .ffl-nutrition-app button, .ffl-nutrition-app summary,
  .ffl-shop-line-group__summary,
  .ffl-carousel-arrow, .ffl-carousel-thumb, .ffl-carousel-zoom,
  .ffl-lightbox-close, .ffl-lightbox-prev, .ffl-lightbox-next,
  .ffl-dish-modal__close, .ffl-menu-info-modal__close,
  .woocommerce-MyAccount-navigation a
) {
  transition: background-color 140ms ease-out, color 140ms ease-out, border-color 140ms ease-out;
}
/* La respuesta de Contacto mantiene el contraste de los CTA naranjas de Tienda. */
body .ffl-c-btn-primary { color: var(--ffl-ink) !important; }

/* El subrayado refuerza el enlace señalado sin mover ni comprimir la cabecera. */
body #masthead .main-header-menu > .menu-item:not(.ffl-nav-cart):not(.ffl-nav-account) > .menu-link {
  text-decoration-line: underline; text-decoration-color: transparent;
  text-decoration-thickness: 1.5px; text-underline-offset: 5px;
  transition: text-decoration-color 150ms ease-out, color 150ms ease-out, background-color 150ms ease-out;
}
body #masthead .main-header-menu > .menu-item:not(.ffl-nav-cart):not(.ffl-nav-account) > .menu-link:is(:hover,:focus-visible),
body #masthead .main-header-menu > .current-menu-item > .menu-link { text-decoration-color: currentColor; }
body .woocommerce-MyAccount-navigation a:is(:hover,:focus-visible),
body .ffl-nutrition-app summary:is(:hover,:focus-visible) { text-decoration: underline; text-underline-offset: 4px; }

@media (prefers-reduced-motion: no-preference) {
  /* El panel móvil se desprende de su botón. Cerrar sigue siendo inmediato. */
  body.ast-main-header-nav-open #ast-mobile-header .ast-mobile-header-content {
    animation: ffl-nav-open 180ms cubic-bezier(.16,1,.3,1);
  }
  @keyframes ffl-nav-open {
    from { transform: translateY(-5px); opacity: .94; }
    to { transform: translateY(0); opacity: 1; }
  }

  /* Fichas informativas de todos los productos, incluidos Junior y Línea V. */
  body .ffl-dish-modal:not([hidden]) .ffl-dish-modal__dialog,
  body .ffl-menu-info-modal:not([hidden]) .ffl-menu-info-modal__dialog {
    animation: ffl-info-panel-open 260ms cubic-bezier(.16,1,.3,1);
  }
  body .ffl-dish-modal:not([hidden]) .ffl-dish-modal__image,
  body .ffl-menu-info-modal:not([hidden]) .ffl-menu-info-modal__image {
    animation: ffl-info-photo-open 280ms cubic-bezier(.16,1,.3,1);
  }
  @keyframes ffl-info-panel-open {
    from { transform: translateY(8px); opacity: .94; }
    to { transform: translateY(0); opacity: 1; }
  }
  @keyframes ffl-info-photo-open {
    from { clip-path: inset(3% 2% 3% round 10px); }
    to { clip-path: inset(0 round 0); }
  }

  /* Los datos se muestran ya: solo se suaviza su aparición, nunca su altura. */
  body .ffl-nutrition-app details[open] > :not(summary),
  body .ffl-shop-line-group[open] > :not(summary),
  body.single-product .woocommerce-Tabs-panel {
    animation: ffl-detail-open 170ms ease-out;
  }
  @keyframes ffl-detail-open { from { opacity: .82; } to { opacity: 1; } }

  /* La galería conserva su carrusel; solo se acompaña la apertura de la ampliación. */
  body .ffl-carousel-lightbox[aria-hidden="false"] .ffl-lightbox-panel {
    animation: ffl-gallery-panel-open 220ms cubic-bezier(.16,1,.3,1);
  }
  @keyframes ffl-gallery-panel-open { from { opacity: .9; } to { opacity: 1; } }

  /* Una sola fotografía protagonista en Contacto; el texto siempre es visible. */
  body .ffl-c-hero-photo img,
  body .ffl-about-equipo-section:target .ffl-about-team-photo img {
    animation: ffl-team-photo-open 440ms cubic-bezier(.16,1,.3,1);
  }
  @keyframes ffl-team-photo-open {
    from { clip-path: inset(3% 2% 3% round 14px); }
    to { clip-path: inset(0 round 0); }
  }
  body :is(.ffl-hero-cta, .ffl-calculator-callout__button, .ffl-how__button, .ffl-c-btn, .ffl-about-cta-row a):active {
    transform: translateY(1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Sin desplazamientos ni recortes. Permanecen color, subrayado y foco. */
  body #ast-mobile-header .ast-mobile-header-content,
  body .ffl-dish-modal__dialog, body .ffl-dish-modal__image,
  body .ffl-menu-info-modal__dialog, body .ffl-menu-info-modal__image,
  body .ffl-nutrition-app details[open] > :not(summary),
  body .ffl-shop-line-group[open] > :not(summary),
  body.single-product .woocommerce-Tabs-panel,
  body .ffl-carousel-lightbox .ffl-lightbox-panel,
  body .ffl-c-hero-photo img,
  body .ffl-about-equipo-section:target .ffl-about-team-photo img { animation: none; clip-path: none; }
}
