/* =========================
FONT & VARIABLES
========================= */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400..900&display=swap');

:root {
    --primary-color: #fffdfe;
    --secondary-color: #4599fe;
    --accent-color: #031e49;
    --danger-color: #ee0405;
    --hover-color: #b8cad1;
    
    --radius: 8px;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

/* =========================
   RESET & BASE
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: "Orbitron", sans-serif;
    background: var(--hover-color);
    color: var(--accent-color);
}

h1, h2, h3, h4 {
    font-weight: 600;
}

h2 {
    margin-bottom: 10px;
}

.maintenance {
    color: var(--primary-color);
}

/*BACK-TO-TOP BUTTON*/
.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 45px;
    height: 45px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: none; /* caché au chargement */
    justify-content: center;
    align-items: center;
    transition: 0.3s ease;
}

.back-to-top:hover {
    background: var(--hover-color);
    transform: translateY(-3px);
}


/* =========================
   LAYOUT
========================= */
.container {
    width: 80%;
    margin: 100px auto;
    padding: 20px;
    background: var(--secondary-color);
}

/* .container--tall {
    min-height: 80vh;
} */

.box {
    background: var(--accent-color);
    padding: 20px;
}

.box--split {
    display: flex;
    gap: 20px;
    min-height: 80%;
}

.box--full {
    display: flex;
}

.split-box {
    flex: 1;
    padding: 20px;
    background: var(--primary-color);
}

/* =========================
   GRID
========================= */
.full_box {
    width: 100%;
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(var(--cols, 1), 1fr);
}

/* Sections */
.lastAdd { --cols: 5; }
.brandBe { --cols: 10; }

/* =========================
   CARD (BASE)
========================= */
.card {
    background: var(--hover-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

/* Lien pleine surface */
.card > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    padding: 10px;
    text-decoration: none;
    color: inherit;
    transition: 0.5s ease;
}

/* Hover clean (sans déformation interne) */
.card:hover {
    transition-delay: 0.3s;
    transform: scale(1.1);
    outline: 2px solid var(--danger-color);
}

/* Focus clavier (accessibilité) */
.card > a:focus-visible {
    outline: 3px solid var(--danger-color);
    outline-offset: 3px;
}

/* =========================
   CARD VARIANTS
========================= */

/* Pièces */
.lastAdd .card {
    height: 200px;
}

.lastAdd .card-img {
    height: 120px;
}

/* Marques */
.brandBe .card {
    max-width: 120px;
    height: 160px;
    margin: 0 auto;
}

.brandBe .card-img {
    height: 100px;
}

/* =========================
   CARD CONTENT
========================= */

.piece-card--empty {
    opacity: 0.5;
    pointer-events: none;
}

.card-img {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.card-img img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.card-title {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-color);
}

/* =========================
   HOME / CONTACT CONTENT
========================= */
.home .left_box,
.contact .right_box {
    background: var(--primary-color);
}

.home .right_box,
.contact .left_box {
    background: var(--hover-color);
}

.home .right_box h3 {
    margin-bottom: 15px;
}

.home .right_box h4 {
    margin: 10px 0;
}

.home .right_box p {
    margin-bottom: 10px;
}

/* =========================
   FORM ELEMENTS
========================= */
label {
    display: block;
    margin: 10px 0 5px;
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-color);
}

select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--accent-color);
    background: var(--hover-color);
    font-size: 14px;
    transition: border var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
}

select:focus {
    outline: none;
    border-color: var(--danger-color);
    box-shadow: 0 0 0 2px var(--danger-color);
}

select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button {
    margin-top: 10px;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    background: var(--danger-color);
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

button:hover:not(:disabled) {
    background: #ff6b6b;
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================
   HEADER
========================= */

header {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--secondary-color);
    align-items: center;
    font-family: "Orbitron", sans-serif;
    outline: 20px solid red;
}

/* Groupe principal : logo + menu */
.head-group {
    width: 90%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: var(--primary-color);
}

.head-group a {
    padding: 10px;
}

/* Logo */
.logo img {
    height: 55px;
    display: block;
}

/* Menu principal */
nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav a {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 15px;
    border-radius: 5px;
    transition: 0.25s ease;
}

nav a:hover {
    background-color: var(--hover-color);
    color: var(--accent-color);
    transform: scale(1.1);
}

nav i {
    font-size: 14px;
}

/* Compteur panier */
.cart-count {
    background: var(--last-color);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* ----- BURGER BUTTON ----- */
.menu {
    width: 60px;
    height: 60px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: none; /* desktop */
    align-items: center;
    justify-content: center;
}

.menu svg {
    /* width: 50px;
    height: 50px; */
    stroke: var(--danger-color);
    stroke-width: 4px;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.menu svg path {
    transition: stroke-dasharray .6s ease, stroke-dashoffset .6s ease;
    stroke-dasharray: 26px 100px;
    stroke-dashoffset: 126px;
}

.menu svg path:nth-child(2) {
    stroke-dasharray: 26px 74px;
    stroke-dashoffset: 100px;
}

.menu svg path:nth-child(3) {
    stroke-dasharray: 26px 107px;
    stroke-dashoffset: 133px;
}

.menu.active svg path {
    stroke-dashoffset: 57px;
}

.menu.active svg path:nth-child(2) {
    stroke-dasharray: 1px 74px;
    stroke-dashoffset: 2px;
}

.menu.active svg path:nth-child(3) {
    stroke-dashoffset: 58px;
}

/* =========================
   MENU SECONDAIRE
========================= */

.menu-sec {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--accent-color);
    color: var(--primary-color);
    align-items: center;
    border-bottom: 25px solid var(--last-color);
    font-size: 14px;
}

.menu_secondaire {
    width: 80%;
}

/* Grid lignes secondaires */
.secondaire-top,
.secondaire-bottom {
    display: flex;
    justify-content: space-evenly; /* espace égal entre tous les items */
    flex-wrap: wrap;               /* passe à la ligne si trop d’items */
    gap: 10px;                     /* petit écart entre items si wrap */
    margin: 5px 0;
}


/* Liens secondaire */
.menu_secondaire a {
    display: inline-block;
    padding: 8px 10px;
    font-size: 15px;
    border-radius: 5px;
    transition: 0.25s ease;
    color: var(--primary-color);
    text-decoration: none;
    width: fit-content;
}

.menu_secondaire a:hover {
    background-color: var(--hover-color);
    color: var(--accent-color);
    transform: scale(1.1);
}

/* =========================
   RESPONSIVE (BURGER & MENU)
========================= */

@media (max-width: 768px) {
    /* Affiche le burger */
    .menu {
        display: flex;
    }

    /* Menu principal en mobile */
    nav ul {
        position: absolute;
        top: 10%;
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        background: var(--hover-color);
        padding: 0;
        margin: 0;
        max-height: 0;
        opacity: 0;
        transform: translateY(-10px);
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease;
        z-index: 1000;
    }

    nav ul.open {
        max-height: 500px;
        opacity: 1;
        transform: translateY(0);
        padding: 20px 0;
    }

    nav a {
        font-size: 16px;
    }

    .menu-sec {
        display: none; /* secondaire caché en mobile si besoin */
    }
}


/* =========================
   FOOTER
========================= */
.site-footer {
    background: var(--accent-color);
    color: var(--primary-color);
    margin-top: 60px;
    outline: 20px solid red;
}

.footer-container {
    width: 80%;
    margin: auto;
    padding: 40px 20px;
}

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

.footer-block h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--danger-color);
}

.footer-bottom {
    background: var(--secondary-color);
    text-align: center;
    padding: 15px;
    font-size: 13px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1024px) {
    .lastAdd { --cols: 2; }
    .brandBe { --cols: 5; }
}

@media (max-width: 768px) {
    .box--split {
        flex-direction: column;
    }

    .full_box {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}


/* =========================
   FIX CARDS PAGE PIÈCES
========================= */
.page-pieces .full_box {
    align-items: stretch;
}

.page-pieces .box {
    margin: 20px 0;
    border-radius: 10px;
}

.page-pieces select {
    width: 20%;
}

.page-pieces .piece-card {
    height: 100%;
}

.page-pieces .card {
    height: 100%;
}
.page-pieces .card > a {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* IMAGE : hauteur fixe */
.page-pieces .card-img {
    height: 140px;
    flex-shrink: 0;
}

.page-pieces .card-img img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* TITRE : clamp 2 lignes */
.page-pieces .card-title {
    min-height: 60px;
    margin-top: 8px;
    text-align: center;
    /* Fallback Firefox / Edge */
    display: block;
    display: -moz-box; /* Firefox legacy */
    max-height: 2.4em; /* 2 lignes x 1.2em line-height */
    line-height: 1.2em;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}


/* BADGES : toujours en bas */
.page-pieces .card > a {
    position: relative;
    padding-bottom: 45px;
}

.page-pieces .badge {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Plusieurs badges */
.page-pieces .badge + .badge {
    bottom: 30px;
}

/* Flex horizontal pour label + select */
.form-group-horizontal {
    display: flex;
    align-items: center; /* aligne verticalement */
    gap: 10px;           /* espace entre label et select */
}

/* Facultatif : réduire la largeur du select */
.form-group-horizontal select {
    min-width: 150px;
    padding: 5px;
}

/* Aligner input et form sur la même ligne */
.box.box--filter {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap; /* pour le responsive si l’écran est petit */
}
