/* Galería de la ficha de producto. */
@layer components {
  .gallery {
    display: grid;
    gap: var(--space-xs);
  }

  .gallery__stage {
    border-radius: var(--radius-s);
    touch-action: pan-y;
  }

  .gallery__counter {
    justify-self: end;
    margin-block-start: calc(-1 * var(--space-xs));
    font-size: var(--step--2);
    color: var(--color-text-muted);
  }

  .gallery__counter:empty {
    display: none;
  }

  .gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
  }

  .gallery__thumb {
    inline-size: 4.25rem;
    padding: 0.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-s);
    background: var(--color-surface);
  }

  .gallery__thumb:hover {
    border-color: var(--color-border-strong);
  }

  .gallery__thumb[aria-pressed="true"] {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-accent);
  }

  @media (prefers-reduced-motion: no-preference) {
    .product-img--large {
      animation: image-in 260ms var(--ease-out);
    }
  }

  @keyframes image-in {
    from {
      opacity: 0;
      transform: scale(0.97);
    }
  }
}
