/* Styles pour les étoiles de notation */
.star-filled {
    color: #ffd700;
}

.star-half {
    color: #ffd700;
}

.star-empty {
    color: #ddd;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.stars {
    display: flex;
    gap: 0.1rem;
}

.rating-value {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.rating-count {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Styles pour les actions produit */
.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.add-to-cart-btn {
    padding: 0.5rem;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Animation pour l'ajout au panier */
.add-to-cart-btn.adding {
    background: var(--primary-color);
}

.add-to-cart-btn.success {
    background: var(--success-color);
    color: white;
}

.add-to-cart-btn.error {
    background: var(--error-color);
    color: white;
}

.cart-quick-access {
    display: flex; /* Utilisation de Flexbox pour centrer */
    justify-content: center; /* Centrage horizontal */
    align-items: center; /* Centrage vertical (optionnel, si dans un conteneur avec hauteur définie) */
    width: 100%; /* Prend toute la largeur pour centrer correctement */
    margin: 20px 0; /* Marge verticale pour un espacement */
}

.btn-outline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    background-color: transparent;
    border: 2px solid #333;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-large {
    padding: 14px 24px;
    font-size: 18px;
}

.fas.fa-shopping-cart {
    font-size: 20px;
}

.cart-count {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 24px;
    height: 24px;
    background-color: #ff4d4d;
    color: #fff;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 8px;
    padding: 0 6px;
    transition: background-color 0.3s ease;
}

.btn-outline:hover .cart-count {
    background-color: #e63939;
}

/* Responsive pour petits écrans */
@media (max-width: 768px) {
    .btn-outline {
        padding: 10px 16px;
        font-size: 14px;
    }

    .btn-large {
        padding: 12px 20px;
        font-size: 16px;
    }

    .fas.fa-shopping-cart {
        font-size: 18px;
    }

    .cart-count {
        min-width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* Actions héros */
.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Styles pour les sections de confiance */
.trust-item {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.trust-item:hover {
    transform: translateY(-5px);
}

.trust-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Styles pour les fonctionnalités */
.features {
    padding: 4rem 0;
    background: var(--light-gray);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Ajustements pour les différentes langues */
html[lang="de"] .hero h1 {
    font-size: 2.8rem; /* L'allemand peut être plus long */
}

html[lang="en"] .hero h1 {
    font-size: 3.2rem; /* L'anglais est souvent plus court */
}

html[lang="fr"] .hero h1 {
    font-size: 3rem; /* Français standard */
}

/* Ajustements pour les boutons selon la langue */
html[lang="de"] .btn {
    font-size: 0.9rem; /* Texte allemand plus long */
}

html[lang="en"] .btn {
    font-size: 1rem; /* Anglais standard */
}

html[lang="fr"] .btn {
    font-size: 1rem; /* Français standard */
}

/* Ajustements pour les cartes produits */
.product-card h3 {
    min-height: 2.5rem; /* Hauteur minimale pour éviter les décalages */
    display: flex;
    align-items: center;
}

.product-excerpt {
    min-height: 3rem; /* Hauteur minimale pour les descriptions */
}

/* Gestion des images manquantes */
.product-image img {
    transition: opacity 0.3s ease;
}

.product-image img[src*="placeholder"] {
    opacity: 0.7;
    filter: grayscale(0.3);
}

/* Fallback pour produits manquants */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--light-gray, #f8f9fa);
    border-radius: 12px;
    margin: 2rem 0;
}

.no-products p {
    font-size: 1.1rem;
    color: var(--text-light, #666);
    margin-bottom: 2rem;
}

/* Responsive pour les langues */
@media (max-width: 768px) {
    html[lang="de"] .hero h1 {
        font-size: 2.2rem;
    }
    
    html[lang="en"] .hero h1 {
        font-size: 2.5rem;
    }
    
    html[lang="fr"] .hero h1 {
        font-size: 2.3rem;
    }
    
    .product-card h3 {
        min-height: auto;
        font-size: 1.1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .product-actions {
        flex-direction: column;
    }
}

/* Amélioration des performances */
.products-grid {
    contain: layout;
}

.product-card {
    contain: layout style;
}

/* Indicateur de chargement pour les images */
.product-image {
    position: relative;
    overflow: hidden;
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 50%, #f0f0f0 50%, #f0f0f0 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    animation: loading 1s linear infinite;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-image img[src=""] + ::before,
.product-image img:not([src]) + ::before {
    opacity: 1;
}

@keyframes loading {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

/* Notification toastée */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.error {
    background: var(--error-color);
}

.toast-notification.info {
    background: var(--primary-color);
    color: var(--text-dark);
}