/**
 * CAROUSEL PARTENAIRES HORIZONTAL - SONAPIE
 * Défilement horizontal fluide avec boutons de navigation
 */

/* ===== CONTAINER PRINCIPAL ===== */

.partners-carousel-horizontal {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0px 0;
    overflow: hidden;
}

/* ===== CONTAINER DE DÉFILEMENT ===== */

.carousel-scroll-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    margin: 0 50px; /* Espace réduit pour les boutons */
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    gap: 15px; /* Réduit l'espacement pour compenser la taille réduite */
    padding: 20px 0;
}

/* ===== ÉLÉMENTS PARTENAIRES ===== */

.partner-item {
    flex: 0 0 auto;
    width: 120px;  /* Taille optimisée pour remplir la ligne */
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.partner-logo-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.partner-logo-container:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 30px rgba(162, 191, 165, 0.3); /* Ombre avec la couleur #a2bfa5 */
    border-color: #a2bfa5; /* Bordure avec la couleur #a2bfa5 */
}

.partner-logo {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.partner-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* ===== PLACEHOLDERS ===== */

.partner-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    padding: 10px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.partner-placeholder i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #007bff;
}

.partner-placeholder span {
    line-height: 1.2;
    word-wrap: break-word;
}

/* Masquer placeholder si image chargée */
.partner-logo img:not([src=""]):not([src*="placeholder"]) + .partner-placeholder {
    opacity: 0;
}

/* ===== BOUTONS DE NAVIGATION ===== */

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;  /* Réduit de moitié : 50px -> 25px */
    height: 25px; /* Réduit de moitié : 50px -> 25px */
    background: #a2bfa5; /* Nouvelle couleur */
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px; /* Réduit proportionnellement : 18px -> 10px */
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(162, 191, 165, 0.3); /* Ombre adaptée à la nouvelle couleur */
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 3px 12px rgba(162, 191, 165, 0.5); /* Ombre adaptée */
    background: #8fa892; /* Version plus foncée de #a2bfa5 pour le hover */
}

.carousel-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Boutons toujours visibles en mode infini */
.carousel-nav-btn:disabled {
    opacity: 0.8;
    cursor: pointer;
    transform: translateY(-50%) scale(1);
}

/* S'assurer que les boutons sont toujours visibles */
.carousel-nav-left,
.carousel-nav-right {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.carousel-nav-left {
    left: 0;
}

.carousel-nav-right {
    right: 0;
}

/* ===== BARRE DE PROGRESSION ===== */

.carousel-progress {
    width: 100%;
    height: 4px;
    background: rgba(0, 123, 255, 0.2);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ===== ANIMATIONS ===== */

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.partner-item.animate-in-right {
    animation: slideInFromRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.partner-item.animate-in-left {
    animation: slideInFromLeft 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 768px) {
    .carousel-scroll-container {
        margin: 0 50px;
    }

    .partner-item {
        width: 150px;
        height: 120px;
    }

    .carousel-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }

    .partner-placeholder {
        font-size: 11px;
    }

    .partner-placeholder i {
        font-size: 20px;
        margin-bottom: 6px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .carousel-scroll-container {
        margin: 0 45px;
    }

    .partner-item {
        width: 130px;
        height: 100px;
    }

    .carousel-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .partner-placeholder {
        font-size: 10px;
        padding: 8px;
    }

    .partner-placeholder i {
        font-size: 18px;
        margin-bottom: 5px;
    }

    .carousel-track {
        gap: 15px;
    }
}

/* ===== THÈME SONAPIE ===== */

.partners-logos.sonapie-theme .partner-logo-container {
    border: 2px solid #ff7200;
}

.partners-logos.sonapie-theme .partner-logo-container:hover {
    border-color: #ff7200;
    box-shadow: 0 12px 30px rgba(255, 114, 0, 0.2);
}

.partners-logos.sonapie-theme .carousel-nav-btn {
    background: linear-gradient(135deg, #ff7200 0%, #e55a00 100%);
}

.partners-logos.sonapie-theme .carousel-nav-btn:hover {
    background: linear-gradient(135deg, #e55a00 0%, #cc4f00 100%);
}

.partners-logos.sonapie-theme .progress-bar {
    background: linear-gradient(90deg, #ff7200 0%, #e55a00 100%);
}

.partners-logos.sonapie-theme .partner-placeholder i {
    color: #ff7200;
}

/* ===== ACCESSIBILITÉ ===== */

.carousel-nav-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.partner-logo-container:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Réduction des animations pour les utilisateurs sensibles */
@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        transition: none;
    }

    .partner-logo-container {
        transition: none;
    }

    .carousel-nav-btn {
        transition: none;
    }

    .partner-item.animate-in-right,
    .partner-item.animate-in-left {
        animation: none;
    }
}

/* ===== ÉTATS DE CHARGEMENT ===== */

.partners-carousel-horizontal.loading .partner-logo-container {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
