:root {
    --yellow: #FFC107;      /* Jaune dominant du robot et pneu */
    --blue: #3F51B5;        /* Bleu du "M" */
    --dark-blue: #1E3A8A;   /* Fond navbar, inspiré du contour bleu */
    --gray: #F5F5F5;        /* Fond sections, comme le gris du logo */
    --black: #212529;       /* Détails noirs (pneu) */
    --white: #FFFFFF;
}

body { 
    font-family: 'Arial', sans-serif; 
    scroll-behavior: smooth; 
    background-color: var(--gray);
    color: var(--black);
}

.hero { 
    background: linear-gradient(rgba(255, 193, 7, 0.8), rgba(63, 81, 181, 0.8)), 
                url('../image/logo-mega-pneu.png') center center / contain no-repeat,
                linear-gradient(to right, var(--yellow), var(--blue)); /* Logo en arrière-plan avec gradient par-dessus */
    min-height: 45vh; 
    display: flex; 
    align-items: center; 
    color: var(--white);
    padding-top: 120px; /* Réduction pour compacter */
    padding-bottom: 30px; /* Réduction pour compacter */
}

/* Optimisation pour les boutons */
.hero .btn-lg {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
}

/* Styles spécifiques pour tous les boutons dans les sections hero */
.hero .btn {
    background-color: var(--yellow) !important;
    border-color: var(--yellow) !important;
    color: var(--black) !important;
    font-weight: 700 !important;
}

.hero .btn:hover {
    background-color: var(--blue) !important;
    border-color: var(--blue) !important;
    color: var(--white) !important;
    transform: scale(1.05);
}

/* Effet créatif pour le premier paragraphe */
.hero .hero-main-text {
    font-weight: 700;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.8);
    color: var(--white);
    background: none;
    filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.7));
}

/* Fallback pour navigateurs qui ne supportent pas background-clip */
@supports not (-webkit-background-clip: text) {
    .hero .hero-main-text {
        color: var(--white);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 
                     0 0 15px rgba(255, 193, 7, 0.8);
    }
}

/* Ajustements pour mobile */
@media (max-width: 768px) {
    .hero {
        min-height: 55vh;
        padding-top: 100px; /* Réduction pour compacter le mobile */
        padding-bottom: 25px; /* Réduction pour compacter */
    }
    
    .hero h1 {
        font-size: 2rem !important;
        line-height: 1.3;
    }
    
    .hero .lead {
        font-size: 1rem;
        margin-bottom: 1rem !important;
    }
    
    .hero p:not(.lead) {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero .hero-main-text {
        font-size: 2rem !important;
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9),
                     0 0 12px rgba(255, 193, 7, 0.7);
        color: var(--white);
    }
    
    .hero .btn-lg {
        font-size: 1rem;
        padding: 0.6rem 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero .col-md-4 {
        margin-bottom: 0.5rem;
    }
}

.navbar {
    background-color: var(--dark-blue) !important; /* Bleu foncé pour navbar */
    padding-top: 0.2rem; /* Encore plus compact */
    padding-bottom: 0.2rem; /* Encore plus compact */
}

/* Espacement maximal entre logo et menu */
.navbar .container-fluid {
    padding-left: 10px; /* Réduction maximale des paddings latéraux */
    padding-right: 10px; /* Réduction maximale des paddings latéraux */
}

.navbar-brand {
    margin-right: auto;
    padding-left: 0;
    font-weight: bold;
    font-size: 1.2rem; /* Réduction significative de la taille du texte MEGA PNEU */
    padding-top: 0.2rem; /* Padding vertical réduit */
    padding-bottom: 0.2rem; /* Padding vertical réduit */
}

.navbar-nav {
    margin-left: auto;
    padding-right: 0;
}

/* Espacement entre les éléments du menu */
.navbar-nav .nav-item {
    margin-left: 0.5rem; /* Réduction de l'espacement entre items */
}

.navbar-nav .nav-link {
    padding-left: 0.5rem; /* Réduction du padding horizontal */
    padding-right: 0.5rem; /* Réduction du padding horizontal */
    padding-top: 0.3rem; /* Réduction du padding vertical */
    padding-bottom: 0.3rem; /* Réduction du padding vertical */
    font-weight: 700; /* Plus gras (était 500) */
    font-size: 1rem; /* Réduction de la taille des options du menu */
    color: var(--white) !important; /* Blanc forcé */
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--yellow) !important; /* Jaune au survol et pour la page active */
    text-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
}

@media (max-width: 991px) {
    .navbar .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .navbar-nav .nav-item {
        margin-left: 0;
    }
    
    .navbar-nav {
        text-align: center;
        margin-top: 1rem;
    }
}

.navbar-brand img { 
    height: 45px; /* Réduction significative de la taille du logo pour compacter */
    filter: drop-shadow(0 0 5px var(--yellow)); /* Effet glowing jaune */
}

.btn-primary {
    background-color: var(--yellow);
    border-color: var(--yellow);
    color: var(--black);
}

.btn-primary:hover {
    background-color: var(--blue);
    color: var(--white);
    transform: scale(1.05); /* Zoom motivant sur CTA */
}

.btn-warning {
    background-color: var(--yellow);
    border-color: var(--yellow);
    color: var(--black);
    font-weight: 600;
}

.btn-warning:hover {
    background-color: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    transform: scale(1.05);
}

.btn-info {
    background-color: var(--dark-blue);
    border-color: var(--dark-blue);
    color: var(--white);
    font-weight: 600;
}

.btn-info:hover {
    background-color: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    transform: scale(1.05);
}

/* Personnalisation des boutons outline-primary pour avoir bordure et texte noirs */
.btn-outline-primary {
    color: var(--black) !important;
    border-color: var(--black) !important;
    background-color: transparent;
}

.btn-outline-primary:hover {
    color: var(--white) !important;
    border-color: var(--blue) !important;
    background-color: var(--blue) !important;
}

.btn-outline-primary:active,
.btn-outline-primary.active {
    color: var(--white) !important;
    background-color: var(--blue) !important;
    border-color: var(--blue) !important;
}

.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(63, 81, 181, 0.25);
}

/* Styles pour les cartes de services avec images de fond */
.service-card {
    position: relative;
}

.service-card .card-body {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    margin: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.service-card .card-title {
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    color: var(--dark-blue) !important;
    margin-bottom: 20px !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.service-card .card-text {
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    color: var(--black) !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.service-card ul li {
    font-weight: 600 !important;
    color: var(--black) !important;
    margin-bottom: 8px !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Design Premium en Quinconce pour Services */
.premium-service-section {
    background: linear-gradient(135deg, var(--gray) 0%, #ffffff 50%, var(--gray) 100%);
    position: relative;
    overflow: hidden;
}

.premium-service-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 193, 7, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(63, 81, 181, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.service-row-left, .service-row-right {
    display: flex;
    align-items: center;
    margin: 60px 0;
    position: relative;
}

.service-content {
    flex: 1;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 193, 7, 0.3);
    position: relative;
    z-index: 2;
}

.service-image {
    flex: 1;
    position: relative;
    z-index: 1;
}

.service-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 25px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
    transition: all 0.4s ease;
    filter: brightness(1.1) contrast(1.1) saturate(1.2);
}

.service-image img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.service-row-left .service-content {
    margin-left: -50px;
    transform: perspective(1000px) rotateY(-5deg);
}

.service-row-right .service-content {
    margin-right: -50px;
    transform: perspective(1000px) rotateY(5deg);
}

.service-content:hover {
    transform: perspective(1000px) rotateY(0deg) translateY(-10px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.service-content h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark-blue);
    margin-bottom: 20px;
    position: relative;
}

.service-content h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--yellow), var(--blue));
    border-radius: 2px;
}

.service-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--black);
    margin-bottom: 25px;
    font-weight: 500;
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 25px 0;
}

.service-features li {
    padding: 12px 0;
    font-weight: 600;
    color: var(--black);
    position: relative;
    padding-left: 35px;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 12px;
    width: 25px;
    height: 25px;
    background: linear-gradient(135deg, var(--yellow), #ff9800);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.service-icon {
    position: absolute;
    top: -15px;
    right: 20px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--yellow), var(--blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

.service-icon img, .service-icon i {
    width: 35px;
    height: 35px;
    filter: brightness(0) invert(1);
}

.service-icon i {
    font-size: 1.8rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .service-row-left, .service-row-right {
        flex-direction: column;
        margin: 40px 0;
    }
    
    .service-content {
        margin: 0 !important;
        transform: none !important;
        margin-top: 20px !important;
    }
    
    .service-image img {
        height: 250px;
    }
}

.card { 
    transition: transform 0.3s; 
    border-color: var(--yellow);
}

.card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3); /* Ombre jaune glowing */
}

.italic { font-style: italic; color: var(--blue); }

section.bg-light {
    background-color: var(--gray) !important;
}

footer {
    background-color: var(--dark-blue) !important;
}

/* Section Nos Marques - Défilement automatique ULTRA COMPATIBLE */
.logos-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8) 15%, rgba(255,255,255,0.8) 85%, transparent);
    padding: 20px 0;
}

.logos-slide {
    display: inline-block;
    animation: scroll 30s linear infinite;
    -webkit-animation: scroll 30s linear infinite;
    -moz-animation: scroll 30s linear infinite;
    -o-animation: scroll 30s linear infinite;
}

/* Animation avec tous les préfixes pour compatibilité maximale */
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@-webkit-keyframes scroll {
    0% { -webkit-transform: translateX(0); }
    100% { -webkit-transform: translateX(-50%); }
}

@-moz-keyframes scroll {
    0% { -moz-transform: translateX(0); }
    100% { -moz-transform: translateX(-50%); }
}

@-o-keyframes scroll {
    0% { -o-transform: translateX(0); }
    100% { -o-transform: translateX(-50%); }
}

.brand-logo {
    height: 80px;
    min-width: 120px;
    width: auto;
    margin: 0 30px;
    object-fit: contain;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.brand-logo:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Classes spécifiques pour ajuster certains logos */
.brand-logo.logo-hankook {
    height: 60px;
    min-width: 90px;
}

.brand-logo.logo-kapsen {
    height: 60px;
    min-width: 90px;
}

/* Classes pour augmenter certains logos */
.brand-logo.logo-large {
    height: 100px;
    min-width: 140px;
}

/* Responsive mobile pour les logos - ULTRA COMPATIBLE */
@media (max-width: 768px) {
    .brand-logo {
        height: 60px;
        min-width: 90px;
        margin: 0 20px;
    }
    
    .logos-slide {
        animation: scroll 20s linear infinite !important;
        -webkit-animation: scroll 20s linear infinite !important;
        -moz-animation: scroll 20s linear infinite !important;
        -o-animation: scroll 20s linear infinite !important;
    }
    
    /* Force le défilement même sur mobile récalcitrant */
    .logos-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* Design Premium pour les cartes de services index */
.premium-service-cards {
    background: linear-gradient(135deg, var(--gray) 0%, #ffffff 50%, var(--gray) 100%);
    position: relative;
    overflow: hidden;
}

.premium-service-cards::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 193, 7, 0.08) 0%, transparent 60%),
                radial-gradient(circle at 80% 70%, rgba(63, 81, 181, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.premium-service-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 193, 7, 0.4) !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12), 
                0 5px 15px rgba(255, 193, 7, 0.2) !important;
    position: relative;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: perspective(1000px) rotateX(2deg);
}

.premium-service-card:hover {
    transform: perspective(1000px) rotateX(0deg) translateY(-8px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18), 
                0 8px 25px rgba(255, 193, 7, 0.3) !important;
    border-color: rgba(255, 193, 7, 0.7) !important;
}

.premium-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
                rgba(255, 193, 7, 0.05) 0%, 
                transparent 30%, 
                rgba(63, 81, 181, 0.03) 100%);
    border-radius: 18px;
    pointer-events: none;
    z-index: -1;
}

.premium-service-card .card-body {
    position: relative;
    z-index: 3;
}

.premium-service-icon {
    background: linear-gradient(135deg, var(--yellow) 0%, #ffdb4d 100%);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 25px rgba(255, 193, 7, 0.4);
    transition: all 0.3s ease;
}

.premium-service-card:hover .premium-service-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(255, 193, 7, 0.6);
}

/* Optimisation des images */
img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.brand-logo, .premium-service-icon img, .service-image img {
    will-change: transform;
    backface-visibility: hidden;
}

.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}

@media (max-width: 768px) { 
    .navbar-brand img { height: 38px; } /* Réduction pour mobile pour compacter */
    
    /* Services Mobile Optimisés - Images en arrière-plan */
    .service-row-left, 
    .service-row-right {
        flex-direction: column;
        margin: 25px 0;
        min-height: auto;
    }

    .service-content {
        padding: 30px 25px;
        margin: 0;
        border-radius: 20px;
        position: relative;
        min-height: 350px;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
        border: 2px solid rgba(255, 193, 7, 0.6);
        overflow: hidden;
        text-align: center;
        transition: all 0.3s ease;
    }

    /* Overlay pour améliorer la lisibilité du texte */
    .service-content::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.65) 0%,
            rgba(255, 255, 255, 0.55) 50%,
            rgba(255, 255, 255, 0.65) 100%);
        backdrop-filter: blur(0.5px);
        z-index: 1;
        border-radius: 18px;
    }

    /* Images spécifiques pour chaque service */
    .service-row-left:nth-of-type(1) .service-content {
        background-image: url('Image pneu neuf.jpg');
    }

    .service-row-right:nth-of-type(2) .service-content {
        background-image: url('pneu occasion MAJ.png');
    }

    .service-row-left:nth-of-type(3) .service-content {
        background-image: url('Réparation 2025.png');
    }

    .service-content:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    }

    .service-content:hover::before {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.7) 0%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 255, 255, 0.7) 100%);
    }

    /* Masquer les images grandes sur mobile */
    .service-image {
        display: none;
    }

    /* Alternative créative : Améliorer les icônes de service sur mobile */
    .service-icon {
        width: 70px;
        height: 70px;
        margin: 0 auto 20px auto;
        background: linear-gradient(135deg, var(--yellow), #f39c12);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 3;
        box-shadow: 0 10px 30px rgba(255, 193, 7, 0.4);
    }

    .service-icon img {
        width: 40px;
        height: 40px;
        filter: brightness(0) invert(1);
    }

    .service-icon i {
        font-size: 35px;
        color: white;
    }

    /* Optimiser le contenu mobile */
    .service-content h3 {
        font-size: 1.4rem;
        margin-bottom: 15px;
        color: var(--dark-blue);
        position: relative;
        z-index: 2;
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
        font-weight: 700;
    }

    .service-content p {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 15px;
        position: relative;
        z-index: 2;
        color: var(--black);
        font-weight: 600;
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
    }

    .service-features {
        margin-bottom: 20px;
        position: relative;
        z-index: 2;
    }

    .service-features li {
        font-size: 0.9rem;
        margin-bottom: 8px;
        padding-left: 20px;
        color: var(--black);
        font-weight: 500;
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.6);
    }

    .btn {
        padding: 12px 25px;
        font-size: 0.95rem;
        position: relative;
        z-index: 2;
        width: 100%;
        text-align: center;
        font-weight: 600;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    /* Correction espacement boutons CTA en bas de page sur mobile */
    section:last-of-type .btn {
        margin-bottom: 15px !important;
        margin-right: 0 !important;
        width: 100%;
        display: block;
    }

    /* Espacement spécifique pour les sections CTA */
    section[style*="background-color: var(--yellow)"] .btn,
    section[style*="background-color:#ffc107"] .btn {
        margin-bottom: 15px !important;
        margin-right: 0 !important;
        width: 100%;
        display: block;
    }

    /* Conteneur des boutons CTA sur mobile */
    section[style*="background-color: var(--yellow)"] .container,
    section[style*="background-color:#ffc107"] .container {
        text-align: center;
    }
}