/* Styles améliorés pour GalsenArduino - OPTIMISÉ MOBILE */

/* Bannière défilante - Solution simple */
.top-banner {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    padding: 0.6rem 0;
    overflow: hidden;
    position: relative;
}

.scrolling-text {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: scrollText 20s linear infinite;
}

@keyframes scrollText {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ================= ANIMATIONS OPTIMISÉES POUR MOBILE ================= */

/* Cartes produits - ANIMATIONS OPTIMISÉES */
.product-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none !important;
    transform: translateZ(0); /* Activation GPU */
    backface-visibility: hidden; /* Optimisation performance */
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15) !important;
}

.product-image {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 200px;
    object-fit: cover;
    transform: translateZ(0); /* Activation GPU */
}

.product-card:hover .product-image {
    transform: scale(1.08); /* Légèrement réduit pour mobile */
}

/* Désactiver les animations lourdes sur mobile */
@media (max-width: 768px) {
    .product-card {
        transition: all 0.3s ease-out; /* Transition plus courte */
    }
    
    .product-card:hover {
        transform: translateY(-4px) scale(1.01); /* Effet réduit */
        box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
    }
    
    .product-card:hover .product-image {
        transform: scale(1.03); /* Zoom très léger sur mobile */
    }
    
    .top-banner {
        padding: 0.5rem 0;
        font-size: 0.8rem;
    }
    
    .scrolling-text {
        animation: scrollText 15s linear infinite;
    }
}

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

/* Animations personnalisés - OPTIMISÉS */
.pulse-animation {
    animation: pulse 2s infinite ease-in-out;
    transform: translateZ(0);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); } /* Réduit pour mobile */
    100% { transform: scale(1); }
}

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateZ(0);
}

.hover-lift:hover {
    transform: translateY(-4px); /* Réduit pour mobile */
}

/* Feature icons - OPTIMISÉ */
.feature-icon {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateZ(0);
}

.feature-icon:hover {
    transform: scale(1.15); /* Réduit pour mobile */
}

/* Sidebar collante */
.sticky-sidebar {
    position: sticky;
    top: 100px;
}

/* Navigation */
.navbar {
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
}

/* Footer amélioré */
footer a.footer-link {
    transition: all 0.3s ease;
    text-decoration: none;
}

footer a.footer-link:hover {
    color: #ffc107 !important;
    padding-left: 5px;
}

.social-icon {
    transition: all 0.3s ease;
    transform: translateZ(0);
}

.social-icon:hover {
    color: #ffc107 !important;
    transform: translateY(-2px); /* Réduit pour mobile */
}

/* Badges */
.badge {
    font-size: 0.7em;
    transition: all 0.3s ease;
}

/* ================= BOUTONS OPTIMISÉS ================= */

.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    transform: translateZ(0);
}

.btn-dark {
    background: linear-gradient(135deg, #212529 0%, #495057 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #000;
    font-weight: 600;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3); /* Ombre réduite */
}

.btn-dark:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 37, 41, 0.25); /* Ombre réduite */
}

/* Optimisation mobile pour les boutons */
@media (max-width: 768px) {
    .btn-warning:hover,
    .btn-dark:hover {
        transform: translateY(-1px); /* Effet très léger sur mobile */
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
}

/* Cards */
.card {
    border-radius: 0.75rem;
    overflow: hidden;
}

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* Animation des listes */
.list-group-item {
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    padding-left: 15px; /* Réduit pour mobile */
}

/* Image détail produit */
.product-detail-image {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: zoom-in;
    transform: translateZ(0);
}

.product-detail-image:hover {
    transform: scale(1.03); /* Réduit pour mobile */
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animation du panier */
.cart-animation {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateZ(0);
}

.cart-animation:hover {
    transform: scale(1.08); /* Réduit pour mobile */
}

/* ================= OPTIMISATIONS MOBILE GÉNÉRALES ================= */

@media (max-width: 768px) {
    .navbar-nav .dropdown-menu {
        border: none;
        box-shadow: none;
    }
    
    .top-banner .container {
        padding: 0;
    }
    
    .sticky-sidebar {
        position: relative;
        top: 0;
    }
    
    /* Désactiver certaines animations sur mobile pour les performances */
    .product-card:hover {
        transform: translateY(-3px); /* Effet très subtil */
    }
    
    /* Réduire les transitions sur mobile */
    .feature-icon:hover {
        transform: scale(1.08);
    }
    
    .hover-lift:hover {
        transform: translateY(-2px);
    }
    
    .social-icon:hover {
        transform: translateY(-1px);
    }
}

/* ================= ANIMATIONS AVEC WILL-CHANGE ================= */

/* Éléments qui auront des animations - optimisation anticipée */
.product-card,
.product-image,
.btn,
.feature-icon {
    will-change: transform; /* Préparation pour animations */
}

/* ================= SLIDER RESPONSIVE AMÉLIORÉ ================= */

/* Conteneur principal du slider */
#galsenSlider {
    max-height: 500px;
    overflow: hidden;
}

.carousel-item {
    transition: transform 0.8s ease-in-out;
    max-height: 500px;
}

/* Images du slider */
.slider-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center;
    border-radius: 0.5rem;
}

/* Captions améliorés */
.slider-caption {
    background: rgba(0,0,0,0.7);
    border-radius: 15px;
    padding: 1.5rem !important;
    bottom: 20%;
    left: 10%;
    right: 10%;
    text-align: center;
}

.slider-caption h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.slider-caption p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.slider-caption .btn {
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

/* Indicateurs personnalisés */
.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 8px;
    border: 2px solid #fff;
    background: transparent;
}

.carousel-indicators button.active {
    background: #ffc107;
    border-color: #ffc107;
}

/* Contrôles de navigation */
.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    background: rgba(0,0,0,0.2);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: #ffc107;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background-size: 60%;
}

/* ================= SLIDER DÉFINITIF - OVERLAY UNIQUEMENT MOBILE ================= */
/* ================= SLIDER DÉFINITIF - CAPTION TRANSPARENT SUR TOUS ÉCRANS ================= */

/* Captions améliorés - TRANSPARENT SUR TOUS ÉCRANS */
.slider-caption {
    background: rgba(0,0,0,0.5); /* TRÈS TRANSPARENT - était 0.75 */
    border-radius: 15px;
    padding: 1.5rem !important;
    text-align: center;
    backdrop-filter: blur(8px); /* Plus de flou pour compenser la transparence */
    border: 1px solid rgba(255,255,255,0.15);
    z-index: 2;
    bottom: 15%;
    left: 10%;
    right: 10%;
}

.slider-caption h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.7); /* Ombre plus forte pour meilleure lisibilité */
    color: #fff;
}

.slider-caption p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7); /* Ombre plus forte */
    color: #f8f9fa;
}

.slider-caption .btn {
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
    font-weight: 600;
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border: none;
}

/* ================= RESPONSIVE SLIDER ================= */

/* PC/Desktop - TRANSPARENT */
@media (min-width: 769px) {
    .carousel-item::before {
        display: none;
    }
    
    .slider-caption {
        background: rgba(0,0,0,0.45); /* TRÈS TRANSPARENT sur PC */
        bottom: 10%;
        left: 10%;
        right: 10%;
        backdrop-filter: blur(10px); /* Plus de flou sur PC */
    }
}

/* Grands écrans - transparent uniforme */
@media (min-width: 1200px) {
    .slider-caption {
        background: rgba(0,0,0,0.4); /* ENCORE PLUS TRANSPARENT */
        bottom: 8%;
        left: 15%;
        right: 15%;
    }
}

/* Tablet (écrans moyens) */
@media (max-width: 992px) {
    .slider-img {
        height: 350px !important;
    }
    
    .slider-caption {
        background: rgba(0,0,0,0.55); /* TRANSPARENT sur tablette */
        bottom: 12%;
        left: 5%;
        right: 5%;
        padding: 1rem !important;
        backdrop-filter: blur(6px);
    }
    
    .slider-caption h3 {
        font-size: 1.4rem;
    }
    
    .slider-caption p {
        font-size: 1rem;
    }
    
    .slider-caption .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.5rem;
    }
}

/* Mobile (smartphones normaux) - TRANSPARENT */
@media (max-width: 768px) {
    .slider-img {
        height: 250px !important;
    }

    .carousel-item::before {
        display: block;
        background: linear-gradient(
            to bottom,
            rgba(0,0,0,0.2) 0%,    /* Plus transparent */
            rgba(0,0,0,0.02) 30%,  /* Plus transparent */
            rgba(0,0,0,0.25) 100%  /* Plus transparent */
        );
    }

    .slider-caption {
        background: rgba(0,0,0,0.6) !important; /* TRANSPARENT sur mobile */
        bottom: 8%;
        left: 2%;
        right: 2%;
        padding: 0.8rem !important;
        border-radius: 8px !important;
        backdrop-filter: blur(5px);
    }

    .slider-caption h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.8); /* Ombre renforcée */
    }

    .slider-caption p {
        display: none;
    }

    .slider-caption .btn {
        padding: 0.4rem 1rem !important;
        font-size: 0.8rem !important;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 30px;
        height: 30px;
    }
}

/* Très petits smartphones */
@media (max-width: 480px) {
    .slider-img {
        height: 200px !important;
    }
    
    .carousel-item::before {
        background: linear-gradient(
            to bottom,
            rgba(0,0,0,0.25) 0%,   /* Plus transparent */
            rgba(0,0,0,0.05) 30%,  /* Plus transparent */
            rgba(0,0,0,0.35) 100%  /* Plus transparent */
        );
    }
    
    .slider-caption {
        background: rgba(0,0,0,0.65) !important; /* TRANSPARENT sur petit mobile */
        bottom: 5%;
        padding: 0.5rem !important;
        backdrop-filter: blur(4px);
    }
    
    .slider-caption h3 {
        font-size: 0.9rem;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.9); /* Ombre très forte */
    }
    
    .slider-caption .btn {
        padding: 0.3rem 0.8rem !important;
        font-size: 0.7rem !important;
    }
}
/* ================= OPTIMISATIONS DE PERFORMANCE ================= */

/* Réduire les animations sur les appareils qui préfèrent les réductions */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-image,
    .btn,
    .feature-icon,
    .social-icon,
    .cart-animation {
        transition: none !important;
        animation: none !important;
    }
    
    .scrolling-text {
        animation: none !important;
        padding-left: 0;
        text-align: center;
    }
}

/* Rendre toutes les images ajoutées dans CKEditor responsives */
/* Images provenant de CKEditor */
.ck-content img,
.product-description img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}

/*similaire*/
/* Pour que les produits similaires aient le même style que product_list */
.fixed-related-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .fixed-related-img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .fixed-related-img {
        height: 150px;
    }
}


/* Image principale */
.product-detail-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Miniatures */
.product-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-thumb:hover {
    transform: scale(1.05);
    border-color: #0d6efd;
}

/* Responsive mobile : miniatures en pleine largeur */
@media (max-width: 768px) {
    .product-thumb {
        width: 60px;
        height: 60px;
    }
}

/* ================= GALERIE IMAGES PRODUIT ================= */

/* Animation de zoom au clic */
.product-detail-image {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.product-detail-image.zoomed {
    transform: scale(1.8);
    cursor: zoom-out;
    z-index: 1000;
    position: relative;
}

/* Overlay pour le mode zoom */
.image-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    cursor: zoom-out;
}

.image-zoom-overlay.active {
    display: flex;
}

.image-zoom-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Amélioration responsive de la galerie */
@media (max-width: 576px) {
    .gallery-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .product-thumb {
        width: 50px;
        height: 50px;
    }
    
    .image-counter {
        font-size: 0.7rem;
        padding: 2px 8px;
    }
}

/* Animation de chargement */
.image-loading {
    opacity: 0.7;
    filter: blur(5px);
    transition: all 0.3s ease;
}

.image-loaded {
    opacity: 1;
    filter: blur(0);
}


/* Styles pour les liens WhatsApp */
.whatsapp-link {
    transition: all 0.3s ease;
    border-bottom: 1px dotted transparent;
}

.whatsapp-link:hover {
    color: #25D366 !important;
    border-bottom-color: #25D366;
    transform: translateY(-1px);
}

/* Animation au clic */
.whatsapp-link:active {
    transform: scale(0.95);
}

/* Indicateur visuel */
.whatsapp-link::after {
    content: " 💬";
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.whatsapp-link:hover::after {
    opacity: 1;
}

/* ================= ALERTE SYSTÈME DYNAMIQUE (TOAST) ================= */
.galsen-alert {
    background-color: #212529 !important;
    color: #ffffff !important;
    border-left: 5px solid #ffc107 !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
    padding: 1rem 1.25rem !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    width: 100%;
    transition: opacity 0.4s ease, transform 0.4s ease, margin 0.4s ease, padding 0.4s ease, height 0.4s ease !important;
    opacity: 1;
    transform: translateY(0);
}

.galsen-alert.hide {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.galsen-alert .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.galsen-alert .btn-close:hover {
    opacity: 1;
}

/* Cohérence de la couleur jaune avec l'accueil et lisibilité sur fond blanc */
.text-warning {
    color: #e0a800 !important;
}

/* Style de l'onglet actif dans la barre de navigation */
.navbar-dark .navbar-nav .nav-link.active {
    color: #ffc107 !important;
    font-weight: 700 !important;
}

/* Texte dynamique pour les boutons de collapse mobile (Afficher / Masquer) */
button[data-bs-toggle="collapse"].collapsed .text-hide {
    display: none;
}
button[data-bs-toggle="collapse"]:not(.collapsed) .text-show {
    display: none;
}
button[data-bs-toggle="collapse"].collapsed .text-show {
    display: inline;
}
button[data-bs-toggle="collapse"]:not(.collapsed) .text-hide {
    display: inline;
}

/* Rotation de l'icône chevron des boutons de collapse mobile */
button[data-bs-toggle="collapse"] .toggle-chevron {
    transition: transform 0.3s ease;
}
button[data-bs-toggle="collapse"]:not(.collapsed) .toggle-chevron {
    transform: rotate(180deg);
}

/* Barre de recherche mobile stylisée et arrondie sans bouton à droite */
.search-mobile-wrapper {
    border-radius: 50px !important;
    overflow: hidden;
    border: 2px solid #ffc107 !important;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
    background-color: #f8f9fa;
}

.search-mobile-wrapper .form-control {
    font-size: 0.9rem;
    font-weight: 500;
}

.search-mobile-wrapper .form-control:focus {
    box-shadow: none;
    background-color: #ffffff;
}

/* ================= SUPPRESSION DU BLEU BOOTSTRAP SUR TOUT LE SITE ================= */

/* Focus sur tous les champs de saisie (inputs, select, textarea) */
input:focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus {
    outline: none !important;
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25) !important;
}

/* Focus et état coché pour les cases à cocher (checkboxes) et boutons radio */
.form-check-input:checked {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
}

.form-check-input:focus {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25) !important;
}

/* Liens du site (boutons liens ou texte) */
a:focus-visible {
    outline: 2px solid #ffc107 !important;
}

/* ================= RECHERCHE PC PREMIUM ================= */
.search-input-pc {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    width: 220px !important;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

.search-input-pc::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.search-input-pc:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25) !important;
}

/* ================= EMPÊCHER LE DÉBORDEMENT DE LA NAVBAR SUR PC ================= */
@media (min-width: 992px) {
    .navbar-nav .nav-link {
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
        font-size: 0.92rem;
    }
    
    .navbar-brand {
        font-size: 1.15rem !important;
    }
}

@media (min-width: 992px) and (max-width: 1200px) {
    .navbar-nav .nav-link {
        padding-left: 0.45rem !important;
        padding-right: 0.45rem !important;
        font-size: 0.85rem;
    }
    
    .search-input-pc {
        width: 160px !important;
    }
}



