/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden; /* Empêche le défilement horizontal */
}

:root {
    --primary-green: #2E7D32;
    --light-green: #4CAF50;
    --dark-green: #1B5E20;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --gray: #E0E0E0;
    --dark-gray: #757575;
}

/* Navigation */
header {
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
}

.logo h1 {
    font-size: 1.5rem;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.2rem;
    }
}

/* Menu burger */
.burger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    padding: 5px;
    z-index: 1001;
}

.burger-menu .bar {
    width: 25px;
    height: 3px;
    background-color: var(--primary-green);
    transition: all 0.3s ease;
}

.burger-menu.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-menu.active .bar:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-links {
    display: none; /* Cache le menu classique sur PC */
    list-style: none;
    gap: 2rem;
    transition: all 0.3s ease;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 1rem;
}

.nav-links a:hover {
    color: var(--primary-green);
}

/* Classes pour responsive */
.desktop-only {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.mobile-only {
    display: none;
}

.mobile-btn {
    width: 100%;
    text-align: center;
    margin: 0.25rem 0;
}

.badge-mobile {
    background: #2E7D32;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.85rem;
    display: inline-block;
    margin: 0.5rem 0;
}

/* Boutons */
.btn {
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-block;
    transition: all 0.3s;
    text-align: center;
}

.btn-outline {
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary-green);
    color: var(--white);
}

.btn-primary {
    background: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--dark-green);
}

.btn-large {
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.25rem 1rem;
    font-size: 0.9rem;
}

/* Hero section */
.hero {
    background: var(--primary-green);
    color: var(--white);
    padding: 2rem 1rem;
    text-align: center;
}

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

.hero h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-bar {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.search-bar input {
    padding: 1rem;
    border: none;
    border-radius: 5px;
    width: min(300px, 100%);
    font-size: 1rem;
}

/* Sections */
section {
    padding: 4rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

section h2 {
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 3rem;
}

/* Grilles responsives */
.categories-grid, 
.traiteurs-grid,
.prestataires-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

/* Cartes */
.category-card, 
.traiteur-card,
.prestataire-card {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s;
    border: 1px solid var(--gray);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.category-card {
    padding: 1.5rem;
}

.category-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.category-icon img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.category-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.traiteur-card {
    background: var(--white);
    padding: 0;
    overflow: hidden;
}

.traiteur-card:hover,
.prestataire-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-green);
    box-shadow: 0 5px 20px rgba(46,125,50,0.2);
}

.traiteur-card img,
.prestataire-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.traiteur-info,
.prestataire-info {
    padding: 1.5rem;
    text-align: left;
    flex: 1;
}

.traiteur-info h3,
.prestataire-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.location {
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.description {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: #666;
}

.price {
    color: var(--primary-green);
    font-weight: 600;
    font-size: 1.1rem;
}

.services-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.service-tag {
    background: var(--light-gray);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--dark-green);
}

/* Comment ça marche */
/* .how-it-works {
    background: var(--light-gray);
} */

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 2rem;
    text-align: center;
}

.step {
    padding: 1rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-green);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1.5rem;
}

.step h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

/* Devenir prestataire */
.become-traiteur {
    background: var(--primary-green);
    color: var(--white);
    text-align: center;
    max-width: none;
    padding: 1rem 1rem;
}

.become-traiteur-content {
    max-width: 600px;
    margin: 0 auto;
}

.become-traiteur h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1rem;
    color: var(--white);
}

.become-traiteur p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.become-traiteur .btn-primary {
    background: var(--white);
    color: var(--primary-green);
    padding: 1rem 2rem;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
}
/* ajoute pour les icon */
i {
    margin-right: 5px;
}

.fa-comments {
    color: #2E7D32;
}

.fa-location-dot {
    color: red;
}

.fa-star {
    color: gold;
}

/* Messages */
.messages {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* Styling du bloc de statistiques dans le Hero */
.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 0.4rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.25);
}

.stat-icon {
    font-size: 1.2rem;
    color: var(--white);
}

.stat-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.stat-number {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--white);
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
    color: var(--white);
    white-space: nowrap;
}


/* ===== STYLES RECHERCHE ET DROPDOWNS DESKTOP ===== */
.desktop-search-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
}

.desktop-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.desktop-search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray);
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.desktop-search-input:focus {
    border-color: var(--primary-green);
}

/* Menus déroulants Desktop */
.desktop-dropdown {
    position: relative;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--white);
    min-width: 220px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: 1px solid var(--gray);
    padding: 0.5rem 0;
    z-index: 1050;
}

/* Classe activée via JavaScript */
.nav-dropdown-content.active {
    display: block;
}

.nav-dropdown-content a {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.nav-dropdown-content a:hover {
    background-color: var(--light-gray);
    color: var(--primary-green);
}

/* Adaptations Responsive */
@media (max-width: 640px) {
    .hero-stats {
        gap: 0.6rem;
        margin-top: 1.5rem;
    }

    .stat-item {
        padding: 0.2rem 0.6rem;
        flex: 1 1 calc(50% - 0.6rem); /* 2 cartes par ligne sur mobile */
        justify-content: center;
    }

    .stat-number {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-icon {
        font-size: 1.3rem;
    }
}
/* Footer responsive */
footer {
    background: var(--dark-green);
    color: var(--white);
    padding: 3rem 1rem 1rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    font-size: 0.95rem;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-section p {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablettes (768px et moins) */
@media (max-width: 768px) {
    nav {
        padding: 1rem;
    }
    
    .burger-menu {
        display: flex;
    }
    
    .nav-links {
        display: flex; /* Réactive le menu burger pour mobile */
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 1000;
    }

    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links a {
        font-size: 1.1rem;
        display: block;
        padding: 0.5rem 0;
    }
    
    .mobile-only {
        display: block;
        margin-top: 1rem;
        border-top: 1px solid var(--gray);
        padding-top: 1rem;
    }
    
    .desktop-only {
        display: none;
    }
    
    .hero {
        padding: 3rem 1rem;
    }
    
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar input,
    .search-bar .btn {
        width: 100%;
        max-width: none;
    }
    
    .categories-grid,
    .traiteurs-grid,
    .prestataires-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1rem;
        padding: 0rem !important;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1.5rem;
    }
}

/* Petits mobiles (480px et moins) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    section {
        padding: 2rem 1rem;
    }
    
    section h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .categories-grid,
    .traiteurs-grid,
    .prestataires-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 1.5rem;
    }
    
    .steps-container {
        gap: 1.5rem;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section {
        padding: 0 1rem;
    }
    
    .become-traiteur {
        padding: 2rem 1rem;
    }
    
    .become-traiteur h2 {
        font-size: 1.3rem;
    }
    
    .btn-large {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }




}



/* Très petits écrans (360px et moins) */
@media (max-width: 360px) {
    .logo h1 {
        font-size: 1rem;
    }
    
    .hero h1 {
        font-size: 1.2rem;
    }
    
    .nav-links {
        width: 100%;
        max-width: none;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .category-icon img {
        width: 60px;
        height: 60px;
    }
}

/* Mode paysage sur mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .nav-links {
        padding-top: 4rem;
        overflow-y: auto;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 640px) {
    /* On applique le grid directement sur les wrappers <div> enfants de classe "filter-group" */
    #filters-form, 
    .filters-section form {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    /* On cible uniquement les `div` pour ignorer complètement les <input type="hidden"> */
    #filters-form > div:nth-of-type(1),
    .filters-section form > div:nth-of-type(1) { order: 1; grid-column: 1; }

    #filters-form > div:nth-of-type(2),
    .filters-section form > div:nth-of-type(2) { order: 2; grid-column: 2; }

    #filters-form > div:nth-of-type(3),
    .filters-section form > div:nth-of-type(3) { order: 3; grid-column: 1; }

    #filters-form > div:nth-of-type(4),
    .filters-section form > div:nth-of-type(4) { order: 4; grid-column: 2; }
}

/* Grands écrans (1200px et plus) */
@media (min-width: 1200px) {
    .categories-grid,
    .traiteurs-grid,
    .prestataires-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
/* ===== DASHBOARD PRESTATAIRE - RESPONSIVE ===== */

/* Cartes statistiques : passage en 2 colonnes sur mobile */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.8rem !important;
    }
    .stat-card {
        padding: 0.4rem 0.3rem !important;
        border-radius: 10px !important;
    }
    .stat-card .icon {
        font-size: 1.8rem !important;
        margin-bottom: 0.1rem !important;
    }
    .stat-card .number {
        font-size: 1.5rem !important;
    }
    .stat-card .label {
        font-size: 0.75rem !important;
    }
    .stat-card .link {
        font-size: 0.7rem !important;
    }
}

/* Profil : passage en 1 colonne sur mobile */
@media (max-width: 640px) {
    .profile-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }
    .profile-logo {
        width: 100px !important;
        height: 100px !important;
    }
    .profile-description {
        font-size: 0.9rem !important;
    }
    .profile-section .btn {
        padding: 0.3rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
}

/* Ajustements très petits écrans (moins de 400px) */
@media (max-width: 400px) {
    .stat-card .number {
        font-size: 1.2rem !important;
    }
    .stat-card .icon {
        font-size: 1.3rem !important;
    }
    .stat-card .label {
        font-size: 0.65rem !important;
    }
}


