/* =========================================================
   EcoCuve - app.css (nettoyé / stable / Leaflet-safe)
   Objectifs:
   - style global stable
   - pages formulaires cohérentes
   - page /distributeurs : map confinée, clics OK
   ========================================================= */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base */
:root {
    --black: #000;
    --text: #333;
    --bg: #f5f5f5;
    --white: #fff;
    --brand-red: #c41e3a;
    --brand-blue: #0088cc;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.10);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.06);
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
}

/* =========================================================
   Layout global
   ========================================================= */
.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.main-header {
    background-color: var(--black);
    color: var(--white);
    height: 72px;
    padding: 0;
    position: relative;
    z-index: 50; /* au-dessus de tout contenu (ex: map) */
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    gap: 18px;
}

.logo-section {
    flex: 2;
}

.logo {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 3px;
    margin: 0;
    color: var(--white);
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 50px;
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-button {
    background-color: var(--white);
    color: var(--black);
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-block;
}

    .contact-button:hover {
        background-color: var(--brand-red);
        color: var(--white);
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(196, 30, 58, 0.3);
    }

/* Main */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0;
}

/* Footer */
.main-footer {
    background-color: var(--black);
    color: var(--white);
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

    .main-footer p {
        margin: 0;
        font-size: 14px;
    }

/* =========================================================
   Home (conserve ton look)
   ========================================================= */
.home-container {
    background-color: var(--white);
}

.hero-section {
    padding: 40px 30px;
    background-color: #f9f9f9;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto 30px;
}

.section-title {
    font-size: 28px;
    color: var(--black);
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-description, .hero-subtitle {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 15px;
}

.machine-image {
    max-width: 500px;
    margin: 30px auto;
    text-align: center;
}

    .machine-image img {
        width: 100%;
        height: auto;
        border-radius: var(--radius-sm);
        box-shadow: 0 4px 12px rgba(0,0,0,0.10);
    }

/* Carousel */
.machine-carousel {
    max-width: 500px;
    margin: 30px auto;
    text-align: center;
    position: relative;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 750px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
    background-color: #f5f5f5;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    display: block;
    opacity: 1;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-dot.active {
    background-color: var(--brand-red);
}

.carousel-dot:hover {
    background-color: var(--brand-blue);
}

/* Tiles */
.tiles-section {
    padding: 50px 30px;
    background-color: var(--white);
}

.tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.tile {
    background-color: var(--bg);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    padding: 0px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}

    .tile:hover {
        transform: translateY(-10px) scale(1.02);
        box-shadow: 0 12px 24px rgba(0,0,0,0.15);
        background-color: var(--white);
    }

.tile-icon {
    width: 200px;
    height: 220px;
    margin: 0 auto 0px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .tile-icon img {
        width: 150px;
        height: 150px;
    }

.tile-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 10px;
}

.tile-description {
    font-size: 15px;
    color: #666;
}

/* Mission */
.mission-section {
    padding: 40px 30px;
    background-color: #2c2c2c;
    text-align: center;
}

.mission-banner {
    background-color: #3a3a3a;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

    .mission-banner h3 {
        color: var(--white);
        font-size: 24px;
        font-weight: 700;
        margin: 0;
    }

.mission-text {
    color: var(--white);
    font-size: 18px;
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
}

/* Features */
.features-section {
    padding: 50px 30px;
    background-color: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

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

.feature-image {
    margin-bottom: 20px;
}

    .feature-image img {
        width: 100%;
        max-width: 500px;
        height: auto;
        border-radius: var(--radius-sm);
        box-shadow: 0 4px 12px rgba(0,0,0,0.10);
    }

.feature-title {
    font-size: 24px;
    color: var(--brand-blue);
    font-weight: 700;
}

.feature-details {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.feature-item {
    background-color: #f9f9f9;
    border-radius: var(--radius-sm);
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e3f2fd;
    overflow: hidden;
}

    .feature-icon.natural {
        background-color: #ffebee;
    }

    .feature-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

.feature-item h4 {
    font-size: 20px;
    color: var(--black);
    margin-bottom: 10px;
    font-weight: 700;
}

.feature-item p {
    font-size: 15px;
    color: #666;
    line-height: 1.7;
}

.feature-item.zero-bidon {
    background: linear-gradient(135deg, #fff7e6 0%, #e3f2fd 100%);
    border: 2px solid var(--brand-blue);
}

/* Service */
.service-section {
    padding: 50px 30px;
    background-color: var(--bg);
}

.service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1000px;
    margin: 30px auto;
}

.service-column {
    padding: 30px;
    border-radius: var(--radius-sm);
    color: var(--white);
}

    .service-column.clients {
        background-color: #2e7d32;
    }

    .service-column.objectif {
        background-color: #0277bd;
    }

    .service-column h4 {
        font-size: 22px;
        font-weight: 700;
        margin-bottom: 20px;
        text-align: center;
    }

    .service-column ul {
        list-style: none;
    }

    .service-column li {
        padding: 10px 0 10px 25px;
        position: relative;
        font-size: 15px;
        line-height: 1.6;
    }

        .service-column li::before {
            content: '•';
            position: absolute;
            left: 0;
            font-size: 24px;
            color: var(--white);
        }

.service-footer {
    text-align: center;
    max-width: 900px;
    margin: 30px auto 0;
    font-size: 16px;
    color: var(--text);
    line-height: 1.8;
}

/* =========================================================
   Formulaires (styles communs)
   ========================================================= */
.form-group {
    margin-bottom: 25px;
}

    .form-group label {
        display: block;
        font-weight: 600;
        margin-bottom: 8px;
        color: var(--text);
        font-size: 15px;
    }

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background-color: var(--white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .form-control:focus {
        outline: none;
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 3px rgba(0,136,204,0.12);
    }

    .form-control::placeholder {
        color: #999;
    }

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

    .form-row.three-cols {
        grid-template-columns: 1fr 1fr 1fr;
    }

.form-group.full-width {
    grid-column: 1 / -1;
}

.validation-message {
    color: var(--brand-red);
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

.form-footer {
    margin-top: 30px;
    text-align: center;
}

.required-note {
    color: var(--brand-red);
    font-size: 14px;
    margin-bottom: 20px;
}

.submit-button {
    background-color: var(--brand-red);
    color: var(--white);
    border: none;
    padding: 15px 50px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
}

    .submit-button:hover:not(:disabled) {
        background-color: #a01628;
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(196, 30, 58, 0.3);
    }

    .submit-button:disabled {
        background-color: #ccc;
        cursor: not-allowed;
    }

/* =========================================================
   Page Contact
   ========================================================= */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 30px;
}

.contact-header {
    text-align: center;
    margin-bottom: 40px;
}

    .contact-header h1 {
        font-size: 36px;
        color: var(--black);
        margin-bottom: 15px;
    }

.subtitle {
    font-size: 18px;
    color: var(--brand-red);
    font-weight: 600;
}

.contact-form-wrapper {
    background-color: var(--bg);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}

/* =========================================================
   Page Demande Carte
   ========================================================= */
.carte-container {
    padding: 40px 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.carte-header h1 {
    font-size: 32px;
    text-align: center;
    color: var(--black);
    margin-bottom: 40px;
}

.benefits-section {
    margin: 40px 0;
}

    .benefits-section h2 {
        font-size: 24px;
        color: var(--brand-red);
        text-align: center;
        margin-bottom: 30px;
    }

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.benefit-item {
    background-color: var(--white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    text-align: center;
}

    .benefit-item p {
        font-size: 16px;
        color: var(--text);
        line-height: 1.6;
    }

.benefit-icon img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.trust-banner {
    background: linear-gradient(135deg, var(--brand-blue) 0%, #005599 100%);
    color: var(--white);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
    margin: 30px 0;
}

    .trust-banner h3 {
        font-size: 26px;
        margin: 0;
    }

.network-info {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: var(--radius-sm);
    margin: 30px 0;
}

    .network-info p {
        font-size: 16px;
        line-height: 1.8;
        color: var(--text);
        margin-bottom: 10px;
    }

.carte-form-wrapper {
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
    margin-top: 40px;
}

.form-title {
    font-size: 24px;
    color: var(--black);
    margin-bottom: 10px;
}

.form-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* =========================================================
   Page Partenaire
   ========================================================= */
.partenaire-container {
    padding: 40px 30px;
    max-width: 1500px;
    margin: 0 auto;
}

.partenaire-header {
    text-align: center;
    margin-bottom: 20px;
}

    .partenaire-header h1 {
        font-size: 36px;
        color: var(--black);
        margin-bottom: 20px;
    }

.advantages-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 15px;
}

.advantage-card {
    background-color: var(--bg);
    padding: 30px 20px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: all 0.25s ease;
}

    .advantage-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    }

.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon-img {
    width: 136px;
    height: 136px;
    object-fit: contain;
    display: block;
    margin-bottom: 20px;
}

/* =========================================================
   Page Distributeurs (Leaflet-safe)
   ========================================================= */
.distributeurs-page {
    padding: 40px 30px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: 32px;
    text-align: center;
    color: var(--black);
    margin-bottom: 20px;
    font-weight: 800;
}

.advantages-box {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: var(--radius-md);
    margin: 20px auto 30px;
    max-width: 1100px;
}

.advantages-title {
    font-size: 22px;
    color: var(--brand-red);
    margin-bottom: 15px;
    text-align: center;
    font-weight: 800;
}

.advantages-list {
    list-style: none;
    padding: 0;
}

    .advantages-list li {
        font-size: 16px;
        padding: 10px 0;
        color: var(--text);
    }

/* Search box */
.search-box {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: 0 auto 30px;
    max-width: 1200px;
    position: relative;
    z-index: 5; /* au-dessus de la map */
}

.search-inputs-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 20px;
}

.search-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 15px;
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: var(--white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .search-input:focus {
        outline: none;
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 3px rgba(0,136,204,0.12);
    }

.search-buttons-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 18px;
    flex-wrap: wrap;
}

.search-btn,
.locate-btn,
.reset-btn {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 800;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.search-btn {
    background: var(--brand-red);
    color: var(--white);
}

    .search-btn:hover {
        filter: brightness(0.95);
        transform: translateY(-1px);
    }

.locate-btn {
    background: var(--brand-blue);
    color: var(--white);
}

    .locate-btn:hover {
        filter: brightness(0.95);
        transform: translateY(-1px);
    }

.reset-btn {
    background: var(--brand-blue);
    color: #fff;
}

.reset-btn:hover {
    filter: brightness(0.85);
    transform: translateY(-1px);
}

/* Results + Map grid */
.results-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 18px;
    align-items: start;
    position: relative;
    z-index: 1;
}

.results-sidebar {
    background: var(--white);
    padding: 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    max-height: 650px;
    overflow-y: auto;
    position: relative;
    z-index: 5; /* au-dessus si Leaflet déborde */
}

.results-count {
    font-size: 18px;
    margin: 0 0 14px 0;
    font-weight: 900;
}

.loading-text,
.no-results-text {
    text-align: center;
    padding: 30px 10px;
    color: #666;
}

/* Cards results */
.result-card {
    background: #f9f9f9;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

    .result-card:hover {
        background: var(--white);
        border-color: rgba(0,136,204,0.35);
        box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    }

.result-selected {
    background: #e3f2fd;
    border-color: var(--brand-red);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.result-name {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    color: var(--black);
}

.result-ref {
    font-size: 12px;
    color: #666;
    background: #e0e0e0;
    padding: 4px 8px;
    border-radius: 4px;
}

.result-address {
    margin: 8px 0 10px 0;
    font-size: 14px;
    color: #555;
}

.result-info {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--brand-blue);
}

.print-btn {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--brand-blue);
    color: var(--brand-blue);
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .print-btn:hover {
        background: var(--brand-blue);
        color: var(--white);
    }

/* Map container : confinée, jamais fullscreen */
.map-wrapper {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-height: 650px;
    position: relative;
    z-index: 1;
}

/* IMPORTANT: height obligatoire pour Leaflet */
.map-display,
#map {
    width: 100%;
    height: 650px;
    min-height: 650px;
    position: relative; /* critique: jamais fixed */
    z-index: 1;
}

/* Leaflet font + confinement */
.leaflet-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    z-index: 1;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 968px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .tiles-container {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        padding: 12px 18px;
        height: auto;
    }

    .main-header {
        height: auto;
    }

    .logo {
        font-size: 24px;
    }

    .contact-button {
        width: 100%;
    }
}

@media (max-width: 980px) {
    .search-inputs-row {
        grid-template-columns: 1fr;
    }

    .results-layout {
        grid-template-columns: 1fr;
    }

    .map-wrapper {
        min-height: 460px;
    }

    .map-display,
    #map {
        height: 460px;
        min-height: 460px;
    }
}

@media (max-width: 600px) {
    .section-title {
        font-size: 22px;
    }

    .hero-description, .hero-subtitle {
        font-size: 14px;
    }

    .tile-title {
        font-size: 18px;
    }

    .mission-text {
        font-size: 16px;
    }
}

/* Debug (optionnel)
.debug {
    outline: 3px solid red;
    z-index: 9999;
    position: relative;
}
*/
