/* ==========================================================================
   MP RÉNOV - SYSTEME DE DESIGN & STYLES GLOBAUX
   Palette : Fond Sombre (#121212), Accents Dorés (#D4AF37), 
             Textes Clairs (#F5F5F5) & Cartes Blanches (#FFFFFF)
   ========================================================================== */

/* 1. RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #121212;
    --bg-card-dark: #1a1a1a;
    --bg-light: #f9f9f9;
    --bg-card-light: #ffffff;
    --primary-gold: #d4af37;
    --primary-gold-hover: #b89528;
    --text-dark: #1a1a1a;
    --text-muted: #666666;
    --text-light: #f5f5f5;
    --border-gold: #d4af37;
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition-fast: 0.3s ease;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-dark: 0 10px 30px rgba(0, 0, 0, 0.3);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Évite que le header fixe ne cache le titre de la section ciblée par une ancre */
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 2. TYPOGRAPHIE & BOUTONS
   ========================================================================== */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.section-title {
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--primary-gold);
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.text-center { text-align: center; }
.mt-2 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1.5rem; }

/* BOUTONS SUR MESURE */
.btn {
    display: inline-block;
    padding: 0.85rem 1.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-gold, .btn-primary {
    background-color: var(--primary-gold);
    color: #121212;
    border-color: var(--primary-gold);
}

.btn-gold:hover, .btn-primary:hover {
    background-color: var(--primary-gold-hover);
    border-color: var(--primary-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.btn-outline-gold {
    background-color: transparent;
    color: var(--primary-gold);
    border-color: var(--primary-gold);
}

.btn-outline-gold:hover {
    background-color: var(--primary-gold);
    color: #121212;
    transform: translateY(-2px);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-gold);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-link:hover {
    color: var(--primary-gold-hover);
}

/* 3. HEADER & NAVIGATION
   ========================================================================== */
.main-header {
    background-color: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-light);
    letter-spacing: 2px;
}

.logo span {
    color: var(--primary-gold);
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.logo-img:hover {
    transform: scale(1.03);
}

.main-nav ul {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-nav a:hover {
    color: var(--primary-gold);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.burger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-gold);
    transition: var(--transition-fast);
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.burger-menu.active span:nth-child(2) {
    opacity: 0;
}
.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 4. HERO SECTION & COMPARISON SLIDER AUTOMATIQUE
   ========================================================================== */
.hero {
    background-color: var(--bg-dark);
    color: var(--text-light);
    position: relative;
    overflow: hidden;
    padding: 4rem 0 6rem 0;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

.hero-title {
    font-size: 2.8rem;
    line-height: 1.15;
    margin-bottom: 1rem;
    color: #ffffff;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #cccccc;
    margin-bottom: 2.5rem;
    max-width: 540px;
}

/* 4 Icônes points forts */
.hero-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.3;
    text-transform: uppercase;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* --- HERO COMPARISON SLIDER (AUTOMATIQUE) --- */
.hero-media {
    position: relative;
    width: 100%;
}

.hero-comparison-slider,
.comparison-container {
    position: relative;
    width: 100% !important;
    height: 400px;
    border-radius: 8px;
    overflow: hidden !important;
    border: 2px solid var(--primary-gold);
    background-color: #000;
    display: block !important;
}

.hero-comparison-slider .slider-track {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    will-change: transform;
}

.hero-slide-item,
.comparison-slide {
    min-width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    height: 100% !important;
    position: relative;
    display: flex;
    background-color: var(--primary-gold);
    box-sizing: border-box;
    gap: 0;
    overflow: hidden;
}

/* Règle robuste : si la slide contient 2 enfants, 50% chacun ; si 1 seul enfant, 100% */
.hero-slide-item > *:nth-last-child(2):first-child,
.hero-slide-item > *:nth-last-child(2):first-child ~ *,
.comparison-slide > *:nth-last-child(2):first-child,
.comparison-slide > *:nth-last-child(2):first-child ~ * {
    width: 50% !important;
    max-width: 50% !important;
    flex: 0 0 50% !important;
    height: 100%;
    object-fit: cover;
}

.hero-slide-item > *:only-child,
.comparison-slide > *:only-child {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    height: 100%;
    object-fit: cover;
}

.hero-slide-item img,
.comparison-slide img,
.hero-slide-item .comparison-image,
.comparison-slide .comparison-image {
    width: 100% !important;
    max-width: 100% !important;
    height: 100%;
    object-fit: cover;
    position: relative;
    overflow: hidden;
    display: block;
    flex: 1;
}

/* Style des conteneurs de côtés (Avant / Après) et de leurs badges */
.slide-side {
    position: relative;
    width: 50% !important;
    height: 100% !important;
    overflow: hidden;
}

.comparison-badge {
    position: absolute;
    bottom: 12px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    z-index: 5;
    pointer-events: none;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.badge-before {
    left: 12px;
    background-color: rgba(220, 53, 69, 0.9);
    color: #fff;
}

.badge-after {
    right: 12px;
    background-color: rgba(40, 167, 69, 0.9);
    color: #fff;
}

/* 5. NOS PRESTATIONS (CARTES BLANCHES SUR FOND CLAIR)
   ========================================================================== */
.prestations-section {
    padding: 6rem 0;
    background-color: #ffffff;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.card-service {
    background-color: #ffffff;
    border: 1px solid #eeeeee;
    padding: 2.5rem 1.8rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-service:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    border-top: 3px solid var(--primary-gold);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.2rem;
}

.card-service h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.card-service p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.8rem;
    line-height: 1.5;
}

.card-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-gold);
    letter-spacing: 1px;
}

.card-link:hover {
    color: var(--primary-gold-hover);
}

/* 6. RÉALISATIONS & SLIDER (FOND SOMBRE)
   ========================================================================== */
.realisations-section {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 6rem 0;
}

.slider-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow-dark);
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide-item {
    min-width: 33.333%;
    padding: 0 10px;
    box-sizing: border-box;
    cursor: pointer;
}

.slide-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    transition: transform var(--transition-fast);
}

.slide-item img:hover {
    transform: scale(1.02);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(18, 18, 18, 0.8);
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
    transition: background var(--transition-fast);
}

.slider-btn:hover {
    background: var(--primary-gold);
    color: #121212;
}

.prev-btn { left: 15px; }
.next-btn { right: 15px; }

/* 7. SECTION AVIS CLIENTS (GRILLE DÉDIÉE)
   ========================================================================== */
.section-reviews-grid {
    padding: 6rem 0;
    background-color: #ffffff;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.card-review {
    background-color: var(--bg-light);
    border: 1px solid #e0e0e0;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-fast);
}

.card-review:hover {
    transform: translateY(-5px);
}

.stars {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    letter-spacing: 2px;
}

.card-review .review-comment {
    font-style: italic;
    color: var(--text-dark);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
}

.card-review .review-author {
    font-weight: 700;
    color: var(--primary-gold);
    font-size: 0.9rem;
    text-align: right;
}

/* 8. INFOS, AVIS & SECTION BAS DE PAGE
   ========================================================================== */
.infos-section {
    padding: 6rem 0;
    background-color: #f4f4f4;
}

.infos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.info-block {
    background-color: #ffffff;
    padding: 2rem 1.5rem;
    border-radius: 6px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.info-block h3 {
    font-size: 1.1rem;
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

.info-block p, .info-block strong {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.info-block a {
    color: var(--primary-gold);
}

.info-block a:hover {
    text-decoration: underline;
}

.devis-box {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 2rem 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--primary-gold);
    box-shadow: var(--shadow-dark);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.devis-box h3 {
    color: var(--primary-gold);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.devis-box p {
    font-size: 0.85rem;
    color: #cccccc;
    margin-bottom: 1.5rem;
}

/* 9. FOOTER
   ========================================================================== */
.main-footer {
    background-color: #0a0a0a;
    color: #888888;
    padding: 4rem 0 0 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-col h3 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.footer-col h4 {
    color: var(--primary-gold);
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.footer-col p, .footer-col li {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}

.footer-col a:hover {
    color: var(--primary-gold);
}

.footer-bottom {
    background-color: #050505;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-links .admin-link,
.footer-bottom .admin-link {
    color: #666666;
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.5;
    margin-left: 10px;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}

.footer-links .admin-link:hover,
.footer-bottom .admin-link:hover {
    opacity: 1;
    color: var(--primary-gold);
}

/* 10. MODALES (CONTACT & AVIS) ET LIGHTBOX
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    right: 1.2rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #888;
    line-height: 1;
    background: none;
    border: none;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #111;
}

.modal-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-header h2, .modal-title-spacing {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.modal-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal .form-group {
    margin-bottom: 1rem;
}

.modal label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.modal input,
.modal select,
.modal textarea,
.form-control-styled {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition-fast);
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.form-control-styled:focus {
    outline: none;
    border-color: var(--primary-gold);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Lightbox pour les images du slider */
.slider-lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.slider-lightbox-overlay.active {
    display: flex;
}

.lightbox-image-styled {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 6px;
    border: 2px solid var(--primary-gold);
    object-fit: contain;
}

.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.lightbox-close-btn:hover {
    color: var(--primary-gold);
}

/* 11. BOUTON RETOUR EN HAUT (AVEC ÉCHELLE DE CHANTIER STYLISÉE) */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 60px;
    background-color: var(--bg-dark);
    border: 2px solid var(--primary-gold);
    border-radius: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: var(--shadow-dark);
    transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.back-to-top:hover {
    background-color: var(--primary-gold);
    transform: translateY(-3px);
}

.back-to-top:hover .ladder-arrow-icon {
    color: var(--bg-dark);
}

.scaffolding-ladder {
    position: relative;
    width: 24px;
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ladder-side {
    width: 3px;
    height: 100%;
    background-color: var(--primary-gold);
    border-radius: 1px;
}

.back-to-top:hover .ladder-side {
    background-color: var(--bg-dark);
}

.ladder-rung {
    position: absolute;
    left: 3px;
    right: 3px;
    height: 2px;
    background-color: var(--primary-gold);
}

.back-to-top:hover .ladder-rung {
    background-color: var(--bg-dark);
}

.ladder-rung:nth-of-type(3) { top: 10px; }
.ladder-rung:nth-of-type(4) { top: 20px; }
.ladder-rung:nth-of-type(5) { top: 30px; }
.ladder-rung:nth-of-type(6) { top: 40px; }

.ladder-arrow-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--primary-gold);
}

/* 12. RESPONSIVE DESIGN (MOBILE & TABLETTE)
   ========================================================================== */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
    }
    .infos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .slide-item {
        min-width: 50%;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-features {
        grid-template-columns: repeat(2, 1fr);
    }
    .comparison-container,
    .hero-comparison-slider {
        height: 300px;
    }
    .slide-item {
        min-width: 100%;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .burger-menu {
        display: flex;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-dark);
        padding: 1.5rem;
        border-bottom: 1px solid var(--primary-gold);
        box-shadow: var(--shadow-dark);
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .hero-title { 
        font-size: 1.8rem; 
    }
    .hero-features { 
        grid-template-columns: 1fr; 
    }
    .comparison-container,
    .hero-comparison-slider {
        height: 250px;
    }
    .infos-grid { 
        grid-template-columns: 1fr; 
    }
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 50px;
    }
}