/**
 * Micro-interactions améliorées
 * Hover effects, feedback visuel, animations boutons
 * Optimisé pour la performance (GPU acceleration, transitions CSS uniquement)
 */

/* ============================================
   BOUTONS - Améliorations hover et feedback
   ============================================ */

/* Boutons principaux - Hover effect amélioré */
.btn-primary,
.btn-outline,
.btn-secondary,
.btn-view-all,
.btn-add-to-cart,
.btn-add-cart-v2,
.btn-preorder {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover state amélioré */
.btn-primary:hover:not(:disabled),
.btn-outline:hover:not(:disabled),
.btn-secondary:hover:not(:disabled),
.btn-view-all:hover,
.btn-add-to-cart:hover:not(:disabled),
.btn-add-cart-v2:hover:not(:disabled),
.btn-preorder:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Active state (clic) - Feedback immédiat */
.btn-primary:active:not(:disabled),
.btn-outline:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.btn-view-all:active,
.btn-add-to-cart:active:not(:disabled),
.btn-add-cart-v2:active:not(:disabled),
.btn-preorder:active:not(:disabled) {
    transform: translateY(-1px) scale(0.97);
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus state - Défini dans accessibility.css pour cohérence */
/* Les styles de focus sont gérés par accessibility.css pour éviter les conflits */

/* Bouton outline - Animation du bord améliorée */
.btn-outline {
    background-clip: padding-box;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary, #D4C5B9);
}

/* ============================================
   ICÔNES ET LIENS - Hover effects
   ============================================ */

/* Icônes header - Animation au hover */
.header-icon {
    position: relative;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-icon:hover {
    transform: scale(1.1);
}

.header-icon:active {
    transform: scale(0.95);
}

/* Liens navigation - Effet de soulignement animé */
.nav-link,
.nav-mobile a {
    position: relative;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link::after,
.nav-mobile a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary, #D4C5B9);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after,
.nav-mobile a:hover::after {
    transform: scaleX(1);
}

/* ============================================
   CARTES PRODUITS - Interactions améliorées
   ============================================ */

/* Carte produit - Hover effect amélioré */
.product-card,
.product-card-large {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover:not(.product-card-large),
.product-card-large:hover {
    transform: translateY(-4px);
}

/* Image produit - Zoom au hover amélioré (pages index, catégories, recherche) */
.product-image {
    overflow: hidden;
}

.product-image img,
.product-card-image,
.products-grid .product-image img,
.featured-products-grid .product-image img,
.products-grid .product-card-large .product-image img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img,
.product-card-large:hover .product-image img,
.products-grid .product-card:hover .product-image img,
.products-grid .product-card-large:hover .product-image img,
.products-grid .product-card-large:hover .product-image img,
.featured-products-grid .product-card:hover .product-image img,
.featured-products-grid .product-card-large:hover .product-image img,
.featured-product-card:hover .featured-product-image img,
.product-card:hover .product-card-image,
.product-card-large:hover .product-card-image {
    transform: scale(1.15) !important;
}

/* Bouton favori - Animation améliorée */
.product-favorite-btn {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-favorite-btn:hover {
    transform: scale(1.15) rotate(5deg);
}

.product-favorite-btn:active {
    transform: scale(1.05) rotate(0deg);
}

.product-favorite-btn.active {
    animation: favoritePop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes favoritePop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   CARTES CATÉGORIES - Hover effects
   ============================================ */

.category-card,
.category-card-equipement {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover,
.category-card-equipement:hover {
    transform: translateY(-6px);
}

.category-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover .category-icon,
.category-card-equipement:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(212, 197, 185, 0.5);
}

/* Carte équipement - Image zoom */
.category-card-equipement .category-image-equipement {
    overflow: hidden;
}

.category-card-equipement .category-image-equipement img {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card-equipement:hover .category-image-equipement img {
    transform: scale(1.05);
}

/* ============================================
   FORMULAIRES - Interactions améliorées
   ============================================ */

/* Inputs - Focus state amélioré */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 197, 185, 0.1);
}

/* Checkbox et Radio - Animation au clic */
input[type="checkbox"],
input[type="radio"] {
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="checkbox"]:active,
input[type="radio"]:active {
    transform: scale(0.9);
}

/* ============================================
   FILTRES - Interactions améliorées
   ============================================ */

/* Filtres checkbox - Hover effect (appliqué partout : boutique, figurine, tableaux-cadre, toutes les pages catégories) */
.filter-checkbox,
.filter-checkboxes .filter-checkbox,
.filters-sidebar .filter-checkbox {
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-checkbox:hover,
.filter-checkboxes .filter-checkbox:hover,
.filters-sidebar .filter-checkbox:hover,
label:has(input[data-filter]):hover,
.filter-group label:hover,
.filter-list label:hover,
.filters-sidebar label:hover,
.filters-sidebar li label:hover {
    background-color: rgba(0, 0, 0, 0.12);
}

.filter-checkbox input[type="checkbox"]:checked + span {
    font-weight: 600;
    transition: font-weight 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Boutons filtres - Animation */
.filter-btn {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
    transform: translateY(-1px);
}

.filter-btn:active {
    transform: translateY(0);
}

/* ============================================
   PAGINATION - Interactions
   ============================================ */

.pagination-btn,
.page-link,
button[data-page="prev"],
button[data-page="next"],
.pagination button,
.pagination-bottom button,
.pagination-top button,
.carousel-arrow,
[data-carousel-prev],
[data-carousel-next] {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination-btn:hover:not(:disabled):not(.active),
.page-link:hover:not(.active),
button[data-page="prev"]:hover:not(:disabled),
button[data-page="next"]:hover:not(:disabled),
.pagination button:hover:not(:disabled):not(.active),
.pagination-bottom button:hover:not(:disabled):not(.active),
.pagination-top button:hover:not(:disabled):not(.active),
.carousel-arrow:hover:not(:disabled),
[data-carousel-prev]:hover:not(:disabled),
[data-carousel-next]:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination-btn:active:not(:disabled),
.page-link:active:not(.active),
button[data-page="prev"]:active:not(:disabled),
button[data-page="next"]:active:not(:disabled),
.pagination button:active:not(:disabled):not(.active),
.pagination-bottom button:active:not(:disabled):not(.active),
.pagination-top button:active:not(:disabled):not(.active),
.carousel-arrow:active:not(:disabled),
[data-carousel-prev]:active:not(:disabled),
[data-carousel-next]:active:not(:disabled) {
    transform: translateY(0);
}

/* ============================================
   THUMBNAILS PRODUIT - Interactions
   ============================================ */

.thumbnail-btn,
.product-thumbnail,
.thumbnail-item {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.thumbnail-btn:hover,
.product-thumbnail:hover,
.thumbnail-item:hover {
    transform: scale(1.08);
    border-color: var(--primary, #D4C5B9);
    box-shadow: 0 4px 12px rgba(212, 197, 185, 0.3);
}

.thumbnail-btn:active,
.product-thumbnail:active,
.thumbnail-item:active {
    transform: scale(1.02);
}

/* Images dans les thumbnails - Zoom au hover */
.thumbnail-btn img,
.product-thumbnail img,
.thumbnail-item img {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-btn:hover img,
.product-thumbnail:hover img,
.thumbnail-item:hover img {
    transform: scale(1.1);
}

/* ============================================
   OPTIMISATIONS PERFORMANCE
   ============================================ */

/* Réduire les animations si l'utilisateur préfère */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* will-change retiré pour économiser la mémoire GPU - les animations fonctionnent sans */

/* ============================================
   FEEDBACK VISUEL - États de chargement
   ============================================ */

/* Bouton en chargement - Animation pulsante */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Animation de rotation pour le spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   AMÉLIORATIONS SPÉCIFIQUES
   ============================================ */

/* Badge compteur - Animation au changement */
.cart-count,
.favorites-count {
    transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-icon:hover .cart-count,
.favorites-icon:hover .favorites-count {
    transform: scale(1.1);
}

/* Menu mobile toggle - Animation */
.menu-toggle {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-toggle:active {
    transform: scale(0.9);
}

/* Liens de recherche - Hover effect */
.search-result-item {
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-result-item:hover {
    transform: translateX(4px);
}

.search-result-item:active {
    transform: translateX(2px);
}

