/* --- Variables et Style de Base --- */
:root {
    --couleur-header: #27408b; /* Ton nouveau bleu pour le header */
    --couleur-texte-header: #ffffff;
    
    /* Pour les liens dans le corps de la page (main, footer, etc.) */
    --couleur-accent: #27408b; /* Un bleu clair classique et lisible */

    /* NOUVELLE VARIABLE : Uniquement pour le surlignement du menu */
    --couleur-menu-hover: #f1c40f; /* Ton idée (le blanc) */
    
    --couleur-principale: #2c3e50;
    --couleur-fond: #f8f9fa;
    --couleur-texte: #333;
    --couleur-bordure: #dee2e6;
    --couleur-footer: #2c3e50;
    --ombre-boite: 0 4px 12px rgba(0, 0, 0, 0.1);
}


@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--couleur-fond);
    color: var(--couleur-texte);
    line-height: 1.6;
    /*padding-top: 100px; */
}

* { 
    box-sizing: border-box; 
}

h1, h2, h3 { 
    color: var(--couleur-principale); 
    padding-left: 20px;
}

a {
    color: var(--couleur-accent);
    text-decoration: none;
    transition: filter 0.2s;
}
a:hover { 
    filter: brightness(1.2); 
}

main {
    max-width: 1200px;
    margin: 0 auto; /* On enlève la marge verticale, le padding s'en chargera */
    padding: 2rem 1rem; /* On met un padding de base */
    transition: padding-top 0.3s ease-in-out; /* Animation douce pour le padding */
}


.container {
    max-width: 1200px;  /* La largeur maximale de ton contenu principal */
    margin-left: auto;  /* Centre le conteneur horizontalement */
    margin-right: auto;
    padding: 0 1.5rem;  /* Ajoute des marges intérieures pour que le texte ne colle jamais les bords */
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}

hr { 
    border: 0; 
    border-top: 1px solid var(--couleur-bordure); 
}

/* --- Header --- */
.header {
    background-color: var(--couleur-header);
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 150px; /* Nouvelle hauteur par défaut (plus grande) */
    transition: height 0.3s ease-in-out, padding 0.3s ease-in-out; /* La magie de l'animation */
   margin-top: -100px; /* On compense la nouvelle hauteur */
}
.logo-container img { 
    max-height: 100px;
    transition: max-height 0.3s ease-in-out; /* Animation sur le logo aussi */

}
.header.scrolled {
    height: 80px; /* On le rétrécit */
    padding: 0.5rem 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* On peut accentuer l'ombre */
}

.header.scrolled .logo-container img {
    max-height: 50px; /* On rétrécit le logo */
}

.nav a {
    margin-left: 1.5rem;
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--couleur-texte-header);
    font-family: 'Zilla Slab', serif; 
    /* effet animation */
    position: relative; /* Nécessaire pour positionner la barre en dessous */
    text-decoration: none; /* On s'assure qu'il n'y a pas de soulignement par défaut */
    padding-bottom: 5px; /* On ajoute un petit espace en dessous pour la barre */
    display: inline-block; /* Important pour que la transformation fonctionne bien */
    transition: transform 0.2s ease-in-out; /* On prépare l'animation du zoom */    
}
.nav a:hover {
    transform: scale(1.1); /* On zoome le texte de 10% */
}
/* On crée la barre cachée avec un pseudo-élément ::after */
.nav a::after {
    content: ''; /* Obligatoire pour un pseudo-élément */
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px; /* L'épaisseur de la barre */
    background-color: var(--couleur-menu-hover);     
    
    /* C'est la magie : on la rend invisible en la "rétrécissant" à zéro */
    transform: scaleX(0); 
    transform-origin: left; /* L'animation partira de la gauche */
    transition: transform 0.3s ease-in-out; /* L'animation douce */
}

/* Quand on passe la souris sur le lien, on "agrandit" la barre */
.nav a:hover::after {
    transform: scaleX(1); /* On la ramène à sa taille normale */
}

/* --- Page d'Accueil --- */
.hero-split {
    display: flex;
    align-items: center;
    gap: 3rem;
    background-color: var(--couleur-fond-section);
    padding: 4rem;
    max-width: 1400px;
    margin: 0 auto;
}
.hero-image-container, .hero-text-container {
    flex: 1;
}
.hero-image-container img {
    border-radius: 8px;
    box-shadow: var(--ombre-boite);
}
.hero-text-container h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.about-section {
    max-width: 900px;
    margin: 4rem auto;
    padding: 2rem;
    text-align: center;
}
.about-section p {
    white-space: pre-wrap; /* Pour respecter les sauts de ligne */
    text-align: left;      /* Pour aligner le texte à gauche */
}
.about-link {
    margin-top: 1.5rem;
    font-weight: bold;
}

/* --- Catalogue & Galerie --- */
.product-card p {
    white-space: pre-wrap; /* Pour respecter les sauts de ligne */
    text-align: left;      /* Pour aligner le texte à gauche */
}
.catalogue-container, .gallery-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    text-align: center;
}
.catalogue-grid, .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 350px));
    gap: 1.5rem;
    justify-content: center; 
    margin-top: 2rem;
    text-align: left;
}
.product-card {
    background-color: white;
    border: 1px solid var(--couleur-bordure);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--ombre-boite);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}
.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.product-card h3, .product-card p {
    margin: 0;
    padding: 0.5rem 1rem;
}

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--ombre-boite);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* --- Formulaires & Éléments d'Admin --- */

.admin-tabs {
    border-bottom: 2px solid var(--couleur-bordure);
    margin-bottom: 2rem;
}

.tab-button {
    padding: 1rem 1.5rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500; /* Un peu moins gras que les titres */
    color: #888; /* Couleur pour les onglets inactifs */
    border-bottom: 3px solid transparent;
    transform: translateY(2px); /* Petite astuce pour que la bordure de l'onglet actif touche la ligne */
    transition: color 0.2s, border-color 0.2s; /* Animation douce */
}

.tab-button.active {
    color: var(--couleur-accent); /* Utilise la couleur d'accent (bleu clair) */
    border-bottom-color: var(--couleur-accent);
}

.tab-content {
    display: none; /* Tous les panneaux sont cachés par défaut */
}

.tab-content.active {
    display: block; /* Sauf celui qui a la classe "active" */
}

form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--ombre-boite);
    max-width: 600px;
    margin: 2rem auto;
}
.form-group { 
    margin-bottom: 1.5rem; 
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color : #27408b;
}
input[type="text"],
input[type="email"],
input[type="url"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--couleur-bordure);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--couleur-accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}
button[type="submit"] {
    background-color: var(--couleur-accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: filter 0.2s;
}
button[type="submit"]:hover { 
    filter: brightness(1.2); 
}
.delete-btn,
.delete-gallery-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.75rem;
    margin: 1rem auto;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    display: block;
    transition: background-color 0.2s;
}
.delete-btn:hover,
.delete-gallery-btn:hover {
    background-color: #c0392b;
}

/* --- Page Contact --- */

.contact-details-grid {
    display: grid;
    /* 2 colonnes sur grand écran, 1 seule sur petit écran */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 1.1rem;
}

.contact-item i {
    font-size: 1.8rem;
    color: var(--couleur-accent);
    width: 30px; /* Pour un alignement parfait */
    text-align: center;
}

/* Style pour la nouvelle section des réseaux sociaux */
/* --- Mise à jour pour la Page Contact (Grille 2x2) --- */

.contact-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colonnes de taille égale */
    gap: 2.5rem 2rem; /* Espace vertical et horizontal entre les éléments */
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.contact-item {
    display: flex;
    /* align-items: center; Mieux : aligner en haut pour l'adresse multiligne */
    align-items: flex-start; 
    gap: 1.5rem;
    font-size: 1.1rem;
}

.contact-item i {
    font-size: 1.8rem;
    color: var(--couleur-accent);
    margin-top: 5px; /* Petit ajustement pour l'alignement vertical */
    width: 30px;
    text-align: center;
}

/* Style spécifique pour le dernier bloc (sociaux) pour l'aligner */
.contact-item .social-icons h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* --- L'effet "Funny" sur les icônes sociales --- */

.social-icons a {
    font-size: 1.8rem;
    margin-right: 1.5rem;
    display: inline-block; /* Nécessaire pour que la transition fonctionne bien */
    transition: transform 0.2s ease-in-out; /* L'animation douce */
}

.social-icons a:hover {
    /* Le zoom et la petite rotation "funny" ! */
    transform: scale(1.3) rotate(10deg); 
    color: var(--couleur-principale); /* On peut aussi changer la couleur au survol */
}
/* --- L'effet "Funny" pour le lien vers la carte --- */

/* On prépare le lien pour l'animation */
.find-us-link {
    display: inline-block; /* Nécessaire pour que la transformation fonctionne bien */
    transition: transform 0.1s ease;
}

/* Quand on passe la souris dessus, on déclenche l'animation */
.find-us-link:hover {
    animation: shake-it 0.5s ease-in-out;
}

/* On définit l'animation "shake-it" image par image */
@keyframes shake-it {
    0%, 100% {
        transform: translateX(0) rotate(0);
    }
    25% {
        transform: translateX(-5px) rotate(-3deg);
    }
    50% {
        transform: translateX(5px) rotate(3deg);
    }
    75% {
        transform: translateX(-2px) rotate(-1deg);
    }
}
/*--- L'effet "Funny" pour le lien du téléphone --- */

/* On prépare le lien pour l'animation */
.phone-link {
    display: inline-block;
    /* On enlève la couleur bleue par défaut des liens pour qu'il garde la couleur du texte normal */
    color: inherit; 
}

/* Quand on passe la souris dessus, on déclenche l'animation */
.phone-link:hover {
    animation: ring-it 0.5s ease-in-out;
}

/* On définit l'animation "ring-it" */
@keyframes ring-it {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(-8deg); }
    40%, 80% { transform: rotate(8deg); }
}

/* --- Ajustement pour les petits écrans --- */
@media (max-width: 768px) {
    .contact-details-grid {
        grid-template-columns: 1fr; /* On passe à une seule colonne sur mobile */
    }
}


/* --- Style pour les Zones de Dépôt (Drop Zones) --- */

/* Le style de base de la boîte */
.drop-zone {
    border: 2px dashed var(--couleur-bordure);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    background-color: #f9f9f9;
    transition: border-color 0.3s, background-color 0.3s; /* Pour une animation douce */
}

/* Le style qui s'applique (grâce au JS) quand on survole la zone avec un fichier */
.drop-zone.drag-over {
    border-color: var(--couleur-accent);
    background-color: #e9ecef;
}
.drop-zone:hover {
    border-color: var(--couleur-accent); /* La bordure devient bleue */
}
.drop-zone p {
    margin: 0;
    color: #666;
}

/* Le style pour l'aperçu de l'image en dessous */
.preview-image {
    display: none; /* Caché par défaut */
    max-width: 200px;
    margin: 15px auto 0; /* Centré avec une marge en haut */
    border: 1px solid #ddd;
    border-radius: 4px;
}
/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    background-color: var(--couleur-footer);
    color: white;
}

/* --- RESPONSIVITÉ --- */
@media (max-width: 768px) {
    body { 
        padding-top: 82px; 
    }
    .header {
        padding: 0.75rem 1rem;
    }
    .nav a {
        font-size: 1rem;
        margin-left: 1rem;
    }
    .hero-split {
        flex-direction: column; /* C'est cette ligne qui fait la magie ! */
        padding: 2rem 1rem;
        gap: 2rem;
    }
    .hero-text-container h2 {
        font-size: 2rem;
    }
}
@media (max-width: 480px) {
    .nav a {
        font-size: 0.9rem;
        margin-left: 0.5rem;
    }
}
