/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root { 
    --jaune: #FFD700; 
    --gris-anthracite: #242424; 
    --gris-section: #1a1a1a;
    --blanc: #FFFFFF; 
    --noir-footer: #0a0a0a;
}

body, html { 
    margin: 0; padding: 0; 
    background-color: var(--gris-anthracite); 
    color: var(--blanc); 
    font-family: 'Inter', sans-serif; 
    scroll-behavior: smooth; 
}

* { box-sizing: border-box; }

/* =========================================
   2. NAVIGATION (Fixe - 100px)
   ========================================= */
nav {
    position: fixed; top: 0; width: 100%; display: flex; justify-content: space-between; align-items: center;
    padding: 0 60px; background: rgba(36, 36, 36, 0.95); backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(255, 215, 0, 0.5); z-index: 1000; height: 100px;
}

.logo-container a { display: block; height: 98px; }
.logo-container img { height: 100%; width: auto; cursor: pointer; }

.nav-links { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--blanc); text-decoration: none; font-weight: 700; font-size: 0.85rem; letter-spacing: 1px; transition: 0.3s; }
.nav-links a:hover { color: var(--jaune); }

.btn-devis { background: var(--jaune); color: #000; padding: 12px 25px; border-radius: 5px; text-decoration: none; font-weight: 900; transition: 0.3s; }
.btn-devis:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }


/* MENU DÉROULANT */
.nav-item {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(36, 36, 36, 0.98);
    min-width: 250px;
    padding: 20px 0;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-top: 2px solid var(--jaune);
    z-index: 1001;
}

.nav-item:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 25px;
    color: var(--blanc);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.dropdown-menu a:hover {
    background: rgba(255, 215, 0, 0.1);
    border-left-color: var(--jaune);
    padding-left: 30px;
}

.dropdown-icon {
    font-size: 0.7rem;
    margin-left: 5px;
}

/* =========================================
   3. HEADER DE PAGE
   ========================================= */
.page-header { 
    background: #242424; 
    padding: 180px 60px 80px; 
    text-align: center; 
}
.page-header h1 { 
    font-family: 'Archivo Black'; 
    font-size: 5rem; 
    margin: 0; 
    text-transform: uppercase; 
    line-height: 1; 
    letter-spacing: -2px; 
}
.page-header p { 
    color: #FFD700; 
    font-weight: 900; 
    letter-spacing: 5px; 
    text-transform: uppercase; 
    margin-top: 15px; 
    font-size: 1.2rem; 
}

/* =========================================
   4. NAVIGATION CATÉGORIES
   ========================================= */
.category-nav { 
    position: sticky; 
    top: 100px; 
    z-index: 999; 
    background: rgba(255,255,255,0.98); 
    border-bottom: 1px solid #eee; 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    padding: 20px; 
}
.filter-btn { 
    padding: 12px 24px; 
    border: 1px solid #e0e0e0; 
    background: #fff; 
    color: #666; 
    cursor: pointer; 
    font-weight: 800; 
    font-size: 0.7rem; 
    text-transform: uppercase; 
    transition: 0.3s; 
    text-decoration: none; 
}
.filter-btn:hover { 
    background: #FFD700; 
    color: #000; 
    border-color: #FFD700; 
}
/* =========================================
   FIX MOBILE : Category nav ne déborde plus
   ========================================= */
@media (max-width: 600px) {
  .category-nav {
    flex-wrap: wrap;               /* autorise le retour à la ligne */
    justify-content: center;
    padding: 12px 10px;
    gap: 10px;
  }

  .category-nav .filter-btn {
    flex: 1 1 calc(50% - 10px);    /* 2 par ligne */
    text-align: center;
    padding: 10px 12px;
    font-size: 0.65rem;
    white-space: normal;           /* autorise le retour à la ligne du texte */
  }
}
/* =========================================
   5. CATALOGUE - SUPPRESSION VIGNETTE NOIRE
   ========================================= */
.catalog-container { 
    padding: 40px 60px 100px; 
    max-width: 1400px; 
    margin: 0 auto; 
    background-color: #fff; 
    color: #000; 
}

.category-section { 
    scroll-margin-top: 200px; 
    margin-top: 60px; 
}

.category-title { 
    font-family: 'Archivo Black'; 
    font-size: 1.8rem; 
    margin-bottom: 40px; 
    border-left: 6px solid #FFD700; 
    padding-left: 20px; 
    text-transform: uppercase; 
    color: #000; 
}

.machine-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); 
    gap: 30px; 
}

.machine-card { 
    background: #fff; 
    border: 1px solid #eee; 
    transition: 0.4s; 
    display: flex; 
    flex-direction: column; 
    cursor: pointer; 
}

.machine-card:hover { 
    box-shadow: 0 30px 60px rgba(0,0,0,0.1); 
    transform: translateY(-8px); 
    border-color: #FFD700; 
}

.machine-img-box { 
    height: 260px; 
    background: #f8f9fa; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
}

.machine-img-box img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.machine-info { 
    padding: 30px; 
}

.machine-info h3 { 
    font-family: 'Archivo Black'; 
    font-size: 1.8rem; 
    margin: 0 0 20px 0; 
    color: #000; 
}

.specs-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    margin-bottom: 25px; 
    border-top: 1px solid #eee; 
    padding-top: 20px; 
}

.spec-item { 
    display: flex; 
    flex-direction: column;
}

.spec-label, .label { 
    font-size: 0.6rem; 
    color: #999; 
    text-transform: uppercase; 
    font-weight: 700; 
}

.spec-value, .value { 
    font-size: 1rem; 
    font-weight: 900; 
    color: #000; 
}

.btn-fiche { 
    display: block; 
    width: 100%; 
    padding: 18px; 
    background: #000; 
    color: #fff; 
    text-align: center; 
    font-weight: 900; 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    border: none; 
    text-decoration: none; 
    cursor: pointer; 
    transition: 0.3s;
}

.btn-fiche:hover {
    background: #FFD700;
    color: #000;
}

/* =========================================
   6. MODALE - SUPPRESSION BANDES NOIRES
   ========================================= */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.95); 
    backdrop-filter: blur(10px); 
    overflow-y: auto;
}

.modal-content { 
    background: #fff; 
    width: 95%; 
    max-width: 1200px; 
    margin: 2vh auto; 
    position: relative; 
    display: grid; 
    grid-template-columns: 1.2fr 1fr; 
    height: 90vh; 
    overflow: hidden; 
}

.close-modal { 
    position: absolute; 
    right: 25px; 
    top: 15px; 
    font-size: 40px; 
    cursor: pointer; 
    color: #000; 
    font-weight: bold; 
    z-index: 100; 
    transition: 0.2s;
}

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

.modal-left { 
    background: #eee; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    border-right: 1px solid #ddd; 
    overflow: hidden; 
}

.main-img-container { 
    flex: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 0;                 /* ✅ SUPPRIME la marge blanche */
    background: #000;           /* optionnel, plus premium */
    overflow: hidden; 
}



.main-img-container img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}

/* Galerie miniatures */
.thumb-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 4px;
    background: #ddd;
    height: auto;              /* ✅ PLUS de hauteur fixe */
}

.thumb-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;      /* ✅ plus de bandes */
  background: transparent;/* ✅ enlève l'effet "marge" */
  display: block;
}


.thumb-gallery img:hover {
    opacity: 1;
    transform: scale(1.05);
}

.modal-right { 
    padding: 40px 60px; 
    color: #000; 
    display: flex; 
    flex-direction: column; 
    overflow-y: auto; 
    position: relative; 
}

.spec-item { 
    border-bottom: 1px solid #eee; 
    padding-bottom: 8px; 
}

.price-notice-modal { 
    margin-top: 20px; 
    padding: 20px 0; 
    border-top: 2px solid #f4f4f4; 
    font-weight: 700; 
    font-size: 0.9rem;
    color: #666;
}

.dl-trigger-container { 
    margin: 15px 0; 
    padding: 15px; 
    background: #f4f4f4; 
    border: 1px solid #ddd; 
    text-align: center; 
}

.btn-dl-trigger { 
    background: #FFD700; 
    color: #000; 
    padding: 12px; 
    width: 100%; 
    border: none; 
    font-weight: 900; 
    cursor: pointer; 
    text-transform: uppercase; 
    font-size: 0.75rem; 
    transition: 0.3s;
}

.btn-dl-trigger:hover {
    background: #000;
    color: #FFD700;
}

.form-overlay { 
    display: none; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: #fff; 
    z-index: 150; 
    padding: 60px; 
    box-sizing: border-box; 
    flex-direction: column; 
    justify-content: center; 
}

.form-overlay input { 
    width: 100%; 
    padding: 15px; 
    margin-bottom: 15px; 
    border: 1px solid #ddd; 
    font-family: 'Inter', sans-serif; 
}

.btn-submit-dl { 
    background: #000; 
    color: #fff; 
    padding: 20px; 
    border: none; 
    font-weight: 900; 
    text-transform: uppercase; 
    cursor: pointer; 
    width: 100%; 
    transition: 0.3s;
}

.btn-submit-dl:hover {
    background: #FFD700;
    color: #000;
}


/* =========================================
   7. FOOTER
   ========================================= */
footer {
    background: var(--noir-footer);
    padding: 60px 60px 20px;
    color: var(--blanc);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-family: 'Archivo Black';
    color: var(--jaune);
    margin-bottom: 20px;
    font-size: 1rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: var(--blanc);
    text-decoration: none;
    transition: 0.3s;
}

.footer-col ul li a:hover {
    color: var(--jaune);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #888;
}

/* =========================================
   8. RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
    nav {
        padding: 0 30px;
        height: 80px;
    }
    
    .logo-container a { height: 78px; }
    
    .nav-links { gap: 15px; }
    .nav-links a { font-size: 0.7rem; }
    
    .modal-content { 
        grid-template-columns: 1fr; 
        overflow-y: auto; 
        height: 100vh; 
        margin: 0; 
        width: 100%; 
    }
    
    .modal-left, .modal-right {
        padding: 30px;
    }
    
    .page-header h1 { 
        font-size: 3rem; 
    }
    
    .machine-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
/* FIX : image principale modale toujours à la bonne taille */
#machineModal .main-img-container {
  height: 100%;
}

#machineModal #mImgMain {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover; /* garde l'image entière sans la couper */
}
/* =========================================
   MODALE MACHINE – FIGER (CSS scopé)
   ========================================= */

/* Empêche le scroll page quand modale ouverte */
body.modal-open {
  overflow: hidden;
}

/* Scope strict : la modale n'est plus impactée par d'autres styles */
#machineModal .modal-content { overflow: hidden; }
#machineModal .modal-left { overflow: hidden; }
#machineModal .main-img-container { padding: 0; overflow: hidden; }

/* Image principale : plein cadre propre */
#machineModal #mImgMain {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Miniatures : plein cadre */
#machineModal .thumb-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}
body.modal-open {
  overflow: hidden;
}
