/* Global styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #f4f4f4;
    color: #333;
}

/* Header */
.header {
    background-color: #000; /* Fond noir */
    color: #fff; /* Texte blanc */
    padding: 20px 40px; /* Espacement intérieur */
}

.header-container {
    display: flex;
    justify-content: space-between; /* Sépare le titre et les liens */
    align-items: center; /* Aligne verticalement au centre */
    flex-wrap: wrap; /* Adaptable sur petits écrans */
}

.header-title {
    flex: 1; /* Le titre occupe 1 part d'espace */
    text-align: left; /* Aligne le titre à gauche */
}

.header-title p {
    font-size: 18px;
    margin: 0;
    color: #fff; /* Texte blanc */
}

.header-links {
    display: flex;
    gap: 20px; /* Espacement entre les boutons */
    margin-right: 40px; /* Décale les liens vers la droite */
}

.header-link {
    color: #fff; /* Couleur blanche pour les liens */
    text-decoration: none; /* Retirer le soulignement */
    font-size: 14px;
    font-weight: bold;
    padding: 5px 10px;
    background-color: #28a745; /* Fond vert pour les boutons */
    border-radius: 5px;
    transition: background-color 0.3s ease; /* Effet au survol */
}

.header-link:hover {
    background-color: #1f7c37; /* Vert plus sombre au survol */
}

/* Hero Section */
.hero {
    background: url('images/hero-bg.jpg') no-repeat center center/cover; /* Grande image en fond */
    color: #fff; /* Texte blanc */
    text-align: center;
    padding: 30px 20px; /* Augmentez la hauteur de la section */
    position: relative; /* Position pour le contenu au-dessus de l'image */
    height: 80vh; /* Prend toute la hauteur de l'écran */
}

.hero-content {
    background-color: rgba(0, 0, 0, 0.6); /* Fond semi-transparent pour le contenu */
    padding: 30px;
    border-radius: 10px;
    display: inline-block;
    position: absolute; /* Positionne le contenu au centre de la section */
    top: 50%; /* Place au centre verticalement */
    left: 50%; /* Place au centre horizontalement */
    transform: translate(-50%, -50%); /* Ajuste l'emplacement pour un centrage parfait */
}

.hero h2 {
    font-size: 36px;
    margin: 0 0 15px;
}

.hero p {
    font-size: 18px;
    margin: 10px 0;
}

.search-bar {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.search-bar input {
    padding: 10px;
    width: 300px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.btn-search {
    padding: 10px 20px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-search:hover {
    background-color: #1f7c37;
}

/* Carte Interactive */
#map {
    height: 500px; /* Hauteur de la carte */
    width: 100%; /* Carte pleine largeur */
    margin: 20px 0; /* Espacement autour de la carte */
    border: 2px solid #28a745; /* Bordure verte */
    border-radius: 10px; /* Coins arrondis */
    display: none; /* La carte est masquée par défaut */
}

.leaflet-container {
    border-radius: 10px; /* Arrondi des bords de la carte */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Ombre légère */
}

.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-tip {
    background: #28a745; /* Couleur de la pointe des pop-ups */
}

/* Features Section */
.features {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
    color: #333;
}

.features h3 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #28a745; /* Titre vert */
}

.features-grid {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature {
    text-align: center;
    flex: 1;
    margin: 0 10px;
}

.feature-img {
    max-width: 80px; /* Taille des images ajustée */
    margin-bottom: 15px;
}

.feature h4 {
    font-size: 20px;
    margin: 10px 0;
    color: #28a745; /* Sous-titres verts */
}

/* Témoignage Section */
.testimonial {
    background-color: #f9f9f9; /* Fond gris clair */
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.testimonial-container {
    display: flex;
    align-items: center; /* Aligne verticalement l'image et le texte */
    gap: 40px; /* Espacement entre l'image et le contenu */
    max-width: 1200px;
    margin: 0 auto; /* Centrer la section */
    flex-wrap: wrap; /* S'adapte sur les petits écrans */
}

.testimonial-image {
    flex: 1; /* Prend 50% de l'espace */
    max-width: 50%; /* Fixe la largeur à 50% */
}

.testimonial-image img {
    width: 100%; /* L'image prend toute la largeur disponible */
    border-radius: 10px; /* Coins arrondis */
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* Ombre légère */
}

.testimonial-content {
    flex: 1; /* Prend 50% de l'espace */
    max-width: 50%; /* Fixe la largeur à 50% */
    color: #333; /* Texte gris foncé */
}

.testimonial-content h3 {
    font-size: 24px;
    color: #28a745; /* Titre en vert */
    margin-bottom: 15px;
}

.testimonial-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.testimonial-content strong {
    font-size: 16px;
    color: #000; /* Nom en noir */
}

/* Section de Téléchargement */
.download-app {
    background-color: #fff; /* Fond blanc */
    padding: 40px 20px; /* Espace intérieur */
    text-align: center; /* Centrage du contenu */
    color: #333; /* Couleur du texte */
}

.download-app h3 {
    font-size: 24px;
    color: #28a745; /* Couleur verte pour le titre */
    margin-bottom: 20px;
}

.app-buttons {
    display: flex;
    justify-content: center; /* Centre les boutons horizontalement */
    gap: 20px; /* Espace entre les boutons */
}

.app-buttons a img {
    width: 150px; /* Largeur des images */
    transition: transform 0.3s ease; /* Ajout d'un effet au survol */
}

.app-buttons a img:hover {
    transform: scale(1.1); /* Agrandissement léger au survol */
}

/* Footer */
.footer {
    background-color: #000; /* Fond noir */
    color: #fff; /* Texte blanc */
    padding: 20px 40px; /* Espace intérieur */
}

.footer-container {
    display: flex;
    justify-content: space-between; /* Espacement entre les colonnes */
    align-items: flex-start; /* Alignement en haut */
    flex-wrap: wrap; /* Permet l'adaptation sur les petits écrans */
    gap: 20px; /* Espacement entre les colonnes */
}

.footer-column {
    flex: 1; /* Chaque colonne prend une part égale de l’espace */
    min-width: 200px; /* Largeur minimale d'une colonne */
}

.footer-column p {
    font-size: 14px; /* Taille du texte */
    margin: 5px 0; /* Espacement vertical entre les lignes */
    color: #ddd; /* Couleur du texte gris clair */
}

.footer-column p:hover {
    color: #28a745; /* Couleur verte au survol */
    cursor: pointer;
}

.footer-column strong {
    font-size: 16px;
    color: #fff; /* Blanc pour les titres */
}

/********************************************************************************************************************************************/
/* Form Sections (Inscription & Connexion) */
.form-section {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f4f4f4;
}

.form-container {
    width: 400px;
    padding: 30px;
    background-color: #fff;
    border: 2px solid #28a745;
    border-radius: 10px;
    text-align: left;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.form-container label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.form-container input {
    flex: 1;
    margin-left: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

.submit-button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background-color: #28a745;
    color: #fff;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #1f7c37;
}

/* Social Login Buttons */
.social-login {
    text-align: center;
    margin-top: 20px;
}

.social-login p {
    font-size: 14px;
    margin-bottom: 10px;
    color: #555;
}

.social-button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    color: #fff;
}

.social-button.google {
    background-color: #4285f4;
}

.social-button.google:hover {
    background-color: #357ae8;
}

.social-button.apple {
    background-color: #333;
}

.social-button.apple:hover {
    background-color: #000;
}

/* Page Je suis producteur */
textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    resize: none; /* Désactiver le redimensionnement */
}

/* Ajoutez des marges spécifiques pour le formulaire producteur */
.form-container {
    width: 500px;
    padding: 30px;
    background-color: #fff;
    border: 2px solid #28a745;
    border-radius: 10px;
    text-align: left;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}


/**************************************************** PAGE INTERFACE PRODUCTEURS *************************************************************/
.product-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

.product-table th, .product-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.product-table th {
    background-color: #4CAF50;
    color: white;
}

.product-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.edit-btn, .delete-btn {
    padding: 5px 10px;
    border: none;
    cursor: pointer;
    margin: 2px;
}

.edit-btn {
    background-color: #f0ad4e;
    color: white;
}

.delete-btn {
    background-color: #d9534f;
    color: white;
}

/* 🎯 Partie 1 : Titre et Barre de Recherche */
.dashboard-container h2 {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.dashboard-container p {
    font-size: 16px;
    color: #555;
    margin-bottom: 15px;
}

#search-bar {
    width: 100%;
    max-width: 350px;
    padding: 10px 12px;
    border: 2px solid #3a7d34; /* Vert MarchéLocal */
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}

#search-bar:focus {
    border-color: #2e5e27;
    outline: none;
    box-shadow: 0px 2px 6px rgba(58, 125, 52, 0.3);
}

/* 🎯 Partie 2 : Pagination et Bouton */
.pagination {
    margin-top: 15px;
    text-align: center;
}

.pagination-button {
    background-color: #3a7d34;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 5px;
    font-weight: bold;
    transition: background 0.3s ease-in-out;
}

.pagination-button:hover {
    background-color: #2e5e27;
}

.pagination-button.active {
    background-color: #f39c12;
}

/* 🎯 Bouton "Ajouter un produit" */
#add-product-button {
    background-color: #f39c12;
    color: white;
    font-weight: bold;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    display: inline-block;
    margin-top: 10px;
}

#add-product-button:hover {
    background-color: #d68910;
}

/* 🎯 Section "Suivi de votre activité" */
.analytics-section {
    margin-top: 25px;
    padding-top: 10px;
    border-top: 2px solid #3a7d34;
}

.analytics-section h3 {
    font-size: 18px;
    color: #333;
    font-weight: bold;
}

.analytics-section p {
    font-size: 16px;
    color: #555;
}

/* 🎯 Lien vers Metabase */
.analytics-section a {
    font-size: 16px;
    color: #3a7d34;
    font-weight: bold;
    text-decoration: none;
    padding: 10px 15px;
    border: 2px solid #3a7d34;
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
    display: inline-block;
    margin-top: 10px;
}

.analytics-section a:hover {
    background-color: #3a7d34;
    color: white;
    text-decoration: none;
}

/**************************************************** PAGE INTERFACE UTILISATEURS *************************************************************/
/* Conteneur principal des sections */
/* 🔎 Amélioration de la barre de recherche */
.filter-bar {
    display: flex;
    justify-content: center;
    padding: 20px;
    background-color: #fff;
}

#search-input {
    width: 400px;
    padding: 10px;
    border: 2px solid #3a7d34;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

#search-input:focus {
    border-color: #1f7c37;
    outline: none;
    box-shadow: 0px 2px 6px rgba(31, 124, 55, 0.3);
}

.products-container, .producteurs-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 10px;
}

/* Titre des sections */
.section-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

/* ✅ Conteneur des producteurs */
.producteurs-grid {
    display: flex;
    flex-direction: row; /* ✅ Aligner en ligne */
    flex-wrap: nowrap; /* ✅ Empêcher le retour à la ligne */
    overflow-x: auto; /* ✅ Activer le scroll horizontal si nécessaire */
    white-space: nowrap; /* ✅ Éviter les retours à la ligne */
    gap: 15px; /* ✅ Espacement entre les cartes */
    padding: 10px;
    max-width: 100%;
    scrollbar-width: thin; /* ✅ Affine la barre de scroll */
}

/* ✅ Assurer que la zone entière affiche bien le scroll */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* ✅ S'assurer que les cartes des producteurs ne prennent pas trop de place */
.producteur-card {
    min-width: 220px;
    max-width: 250px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    overflow: hidden; /* ✅ Évite que le texte dépasse */
    white-space: normal; /* ✅ Permet le retour à la ligne */
}

.producteur-card h3 {
    font-size: 16px; /* ✅ Réduit légèrement la taille */
    font-weight: bold;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* ✅ Coupe les noms trop longs */
    width: 100%;
}

.producteur-card p {
    font-size: 14px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* ✅ Coupe les adresses trop longues */
}

.producteur-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* ✅ Boutons de navigation */
.carousel-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 5px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    opacity: 0.8;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

/* ✅ Empêcher plusieurs boutons de s'afficher à droite */
.carousel-btn.right {
    right: 0;
}

/* ✅ Empêcher plusieurs boutons de s'afficher à gauche */
.carousel-btn.left {
    left: 0;
}

/* ✅ Effet au survol */
.carousel-btn:hover {
    opacity: 1;
    background-color: #1f7c37;
}

/* Grille de produits */
.products-grid {
    display: flex;
    overflow-x: auto; /* Permet le défilement horizontal */
    gap: 20px;
    padding-bottom: 10px;
}

/* Cartes des produits */
.product-card {
    min-width: 200px;
    max-width: 240px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Image du produit */
.product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
}

/* Nom et prix */
.product-card h4 {
    font-size: 16px;
    margin: 10px 0 5px;
    font-weight: bold;
}

.product-card p {
    font-size: 14px;
    color: #666;
}

/* Bouton "Ajouter au panier" */
.btn-add-to-cart {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.btn-add-to-cart:hover {
    background-color: #1f7c37;
}

.utilisateur-page .pagination {
    margin-top: 15px;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px; 
}

.utilisateur-page .pagination-button {
    background-color: #3a7d34;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 5px;
    font-weight: bold;
    transition: background 0.3s ease-in-out;
}

.utilisateur-page .pagination-button:hover {
    background-color: #2e5e27;
}

.utilisateur-page .pagination-button.active {
    background-color: #f39c12;
}

/* ✅ Applique uniquement sur la page utilisateurs */
.utilisateur-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.utilisateur-page #producteurs-section, 
.utilisateur-page #produits-section {
    flex-grow: 1;
}

.utilisateur-page .footer {
    margin-top: auto;
}

/* ------------------------------------------------------------------- INSCRIPTION PRODUCTEURS -------------------------------------------------- */

/* Carte d'un producteur */
.producteur-card {
    min-width: 220px;
    max-width: 250px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.producteur-card:hover {
    transform: scale(1.05);
}

/* Bouton voir les produits */
.btn-see-products {
    width: 100%;
    padding: 10px;
    background-color: #ff5722;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.btn-see-products:hover {
    background-color: #e64a19;
}


/* ------------------------------------------------------------------- PANIER ---------------------------------------------------------------------- */

/* 🎨 Conteneur principal du panier */
.cart {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* 🎨 Titre du panier */
.cart h2 {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

/* 🎨 Liste des articles dans le panier */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 🎨 Chaque produit dans le panier */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 🎨 Image du produit */
.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

/* 🎨 Infos du produit */
.cart-item .item-info {
    flex: 1;
    margin-left: 15px;
}

/* 🎨 Nom du produit */
.cart-item h4 {
    font-size: 16px;
    font-weight: bold;
    margin: 5px 0;
}

/* 🎨 Prix */
.cart-item .price {
    font-size: 14px;
    color: #666;
}

/* 🎨 Contrôles de quantité */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 🎨 Boutons quantité */
.quantity-controls button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

.quantity-controls button:hover {
    background-color: #1f7c37;
}

/* 🎨 Total du panier */
.cart-total {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
}

/* 🎨 Bouton "Passer commande" */
.btn-checkout {
    width: 100%;
    padding: 12px;
    background-color: #f39c12;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    margin-top: 15px;
}

.btn-checkout:hover {
    background-color: #d68910;
}


/* ------------------------------------------------------------------- MON COMPTE ---------------------------------------------------------------------- */
/* 🌟 Améliorer l'apparence du formulaire du compte */
.account-details {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.account-details h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #333;
}

/* 📦 Améliorer l'affichage des commandes */
.order-history {
    max-width: 800px;
    margin: 30px auto;
}

.order-history h2 {
    text-align: center;
    color: #333;
}

/* 🎨 Conteneur des commandes */
.orders-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 📦 Style des cartes de commande */
.order-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #28a745;
}

/* 🎨 Statut de commande avec couleurs */
.status-pending {
    color: #f39c12; /* Jaune pour En attente */
    font-weight: bold;
}

.status-delivered {
    color: #28a745; /* Vert pour Livrée */
    font-weight: bold;
}

.status-cancelled {
    color: #e74c3c; /* Rouge pour Annulée */
    font-weight: bold;
}