/* === RESET & GLOBAL === */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(180deg, #e8ecf5, #f5f7fa);
    color: #212121;
}

.wrapper {
    min-height: 100vh; /* prend tout l'écran */
    display: flex;
    flex-direction: column;
}

main {
    flex: 1; /* pousse le footer vers le bas */
    display: block;
}

/* ================= HEADER ================= */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1A237E;
    padding: 10px 20px;
    color: #fff;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    padding: 5px 10px;
    width: 200px;
    max-width: 100%;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.search-form button {
    padding: 5px 10px;
    cursor: pointer;
    background: #1976D2;
    color: #fff;
    border: none;
    border-radius: 3px;
}

.user-links a {
    color: #fff;
    margin-left: 10px;
    text-decoration: none;
}

.user-links a:hover {
    color: #E3F2FD;
}

/* ================= MENU PRINCIPAL ================= */
.menu-principal {
    list-style: none;
    display: flex;
    gap: 20px;
    padding-left: 20px;
    background: #3949AB;
    flex-wrap: wrap;
    margin: 0;
}

.menu-principal li {
    position: relative;
}

.menu-principal li a {
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    display: block;
    transition: 0.2s;
}

.menu-principal li a:hover {
    background: #5C6BC0;
    border-radius: 3px;
}

/* Sous-menu */
.menu-principal .sousmenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    background: #5C6BC0;
    min-width: 180px;
    z-index: 1000;
    border-radius: 4px;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.menu-principal li:hover > .sousmenu {
    display: block;
    opacity: 1;
}

/* Sous-sous-menu */
.menu-principal .sousmenu .sousmenu {
    top: 0;
    left: 100%;
}

/* Liens du sous-menu */
.menu-principal .sousmenu li a {
    padding: 5px 10px;
    color: #fff;
}

.menu-principal .sousmenu li a:hover {
    background: #7986CB;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-principal {
        flex-direction: column;
        padding-left: 10px;
    }
    .menu-principal li {
        width: 100%;
    }
    .menu-principal li .sousmenu {
        position: relative;
        left: 0;
        top: 0;
    }
}

/* ================= PRODUITS ================= */
.produits {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
    justify-items: center;
}

.produit-card {
    border: 1px solid #cfd8dc;
    padding: 10px;
    text-align: center;
    background: #ffffffcc;
    backdrop-filter: blur(4px);
    transition: 0.2s;
    border-radius: 5px;
}

.produit-card:hover {
    background: #dde7ff;
    transform: translateY(-5px);
}

.produit-card img {
    max-width: 100%;
    height: auto;
}

.btn-detail {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    background: #1976D2;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    transition: 0.3s;
}

.btn-detail:hover {
    background: #1565C0;
}

/* ================= FOOTER ================= */
footer {
    background: #212121;
    color: #fff;
    padding: 20px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

footer a {
    color: #4e89ff;
    text-decoration: none;
    margin: 0 5px;
}

footer a:hover {
    color: #90caf9;
}

/* ================= FORMULAIRES ================= */
form {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form select,
form textarea {
    width: 100%;
    padding: 12px;
    margin: 12px 0;
    border: 1px solid #b0bec5;
    border-radius: 6px;
    background: #f0f4ff;
    transition: 0.3s;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: #3949AB;
    background: #e8edff;
    box-shadow: 0 0 6px rgba(57, 73, 171, 0.4);
}

form button,
.btn {
    background: #3949AB;
    color: #fff;
    padding: 12px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 15px;
}

form button:hover,
.btn:hover {
    background: #283593;
    transform: scale(1.05);
}

/* ================= TITRES ================= */
h1, h2, h3 {
    text-align: center;
    color: #1A237E;
    margin-top: 20px;
}

/* ================= LOGIN / REGISTER ================= */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #1e3c72, #2a5298, #4e89ff);
}

.auth-box {
    background: #fff;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    width: 360px;
    max-width: 90%;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

.auth-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(0,0,0,0.4);
}

.auth-box h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 28px;
}

.auth-box input {
    width: 100%;
    padding: 14px;
    margin: 12px 0;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
    transition: 0.3s;
}

.auth-box input:focus {
    border-color: #1e3c72;
    box-shadow: 0 0 8px rgba(30,60,114,0.5);
}

.auth-box button {
    width: 100%;
    padding: 14px;
    background: #1e3c72;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s;
}

.auth-box button:hover {
    background: #2a5298;
    transform: scale(1.03);
}

.auth-box a {
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
    color: #1e3c72;
    font-size: 14px;
}

.auth-box a:hover {
    color: #4e89ff;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .header-top { flex-direction: column; }
    .produits { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
    .produit-card { width: 100%; max-width: 250px; }
}

@media (max-width: 480px) {
    .search-form input[type="text"] { width: 100%; margin-bottom: 5px; }
    .user-links { margin-top: 5px; }
}

@media (max-width: 400px) {
    .auth-box { padding: 30px 20px; }
    .auth-box h2 { font-size: 24px; }
}
/* Animation sous-menu */
.menu-principal .sousmenu {
    display: block; /* on gère l'affichage via opacity + transform */
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none; /* pour éviter les clics quand caché */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu-principal li:hover > .sousmenu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Animation des sous-sous-menus avec delay */
.menu-principal .sousmenu li {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.menu-principal li:hover > .sousmenu li {
    opacity: 1;
    transform: translateX(0);
}

/* Delay en cascade */
.menu-principal li:hover > .sousmenu li:nth-child(1) { transition-delay: 0.05s; }
.menu-principal li:hover > .sousmenu li:nth-child(2) { transition-delay: 0.1s; }
.menu-principal li:hover > .sousmenu li:nth-child(3) { transition-delay: 0.15s; }
/* tu peux continuer selon le nombre max de sous-liens */
footer {
    background: #212121;
    color: #fff;
    padding: 20px;
    font-size: 14px;
    flex-shrink: 0;
}

.footer-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    text-align: left;
}

.footer-grid h4 {
    margin-bottom: 10px;
}

.footer-grid a {
    display: block;
    margin-bottom: 5px;
    color: #4e89ff;
    text-decoration: none;
}

.footer-grid a:hover {
    color: #90caf9;
}

/* Mobile */
@media (max-width: 768px) {
    .footer-grid {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
.produits {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 20px;
    justify-items: center;
}

@media (max-width: 480px) {
    .produits {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    .produit-card {
        padding: 8px;
    }
}
.hero {
    background: url('assets/img/hero-bg.jpg') center/cover no-repeat;
    color: #fff;
    text-align: center;
    padding: 80px 20px;
    border-radius: 10px;
    margin: 20px;
}

.hero .btn {
    margin-top: 20px;
}

.categories-home {
    text-align: center;
    margin: 40px 0 20px 0;
}

.categories-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.category-card {
    background: #3949AB;
    color: #fff;
    padding: 20px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s, background 0.3s;
}

.category-card:hover {
    background: #5C6BC0;
    transform: translateY(-5px);
}
/* Wrapper prend toute la hauteur de la page */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main prend tout l'espace restant pour pousser le footer */
main {
    flex: 1 0 auto; /* grandit selon le contenu */
}

/* Footer toujours collé */
footer {
    background: #212121;
    color: #fff;
    padding: 20px;
    font-size: 14px;
    flex-shrink: 0; /* jamais rétréci */
}

/* Optionnel : centrage des liens du footer */
.footer-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    text-align: left;
}

@media (max-width: 768px) {
    .footer-grid {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
.legal-text {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    line-height: 1.6;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
/* === RESET & GLOBAL === */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(180deg, #e8ecf5, #f5f7fa);
    color: #212121;
}

/* Wrapper flex pour footer sticky */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main prend tout l'espace */
main {
    flex: 1 0 auto;
}

/* Header */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1A237E;
    padding: 10px 20px;
    color: #fff;
    flex-wrap: wrap;
}

.header-top .logo a {
    color: #fff;
    font-weight: bold;
    font-size: 22px;
    text-decoration: none;
}

.search-form input[type="text"] {
    padding: 5px 10px;
    width: 200px;
    max-width: 100%;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.search-form button {
    padding: 5px 10px;
    cursor: pointer;
    background: #1976D2;
    color: #fff;
    border: none;
    border-radius: 3px;
}

.user-links a {
    color: #fff;
    margin-left: 10px;
    text-decoration: none;
}

.user-links a:hover,
.logout-link {
    color: #ffcccb;
}

/* Menu principal */
.menu-principal {
    list-style: none;
    display: flex;
    gap: 20px;
    padding-left: 20px;
    background: #3949AB;
    flex-wrap: wrap;
    margin: 0;
}

.menu-principal li a {
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    display: block;
    transition: 0.2s;
}

.menu-principal li a:hover {
    background: #5C6BC0;
    border-radius: 3px;
}

/* Sous-menu animations */
.menu-principal .sousmenu {
    display: block;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #5C6BC0;
    min-width: 180px;
    border-radius: 4px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu-principal li:hover > .sousmenu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-principal .sousmenu li {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.menu-principal li:hover > .sousmenu li {
    opacity: 1;
    transform: translateX(0);
}

.menu-principal li:hover > .sousmenu li:nth-child(1) { transition-delay: 0.05s; }
.menu-principal li:hover > .sousmenu li:nth-child(2) { transition-delay: 0.1s; }
.menu-principal li:hover > .sousmenu li:nth-child(3) { transition-delay: 0.15s; }

/* Footer */
footer {
    background: #212121;
    color: #fff;
    padding: 20px;
    font-size: 14px;
    flex-shrink: 0;
}

.footer-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    text-align: left;
}

.footer-grid h4 {
    margin-bottom: 10px;
}

.footer-grid a {
    display: block;
    margin-bottom: 5px;
    color: #4e89ff;
    text-decoration: none;
}

.footer-grid a:hover {
    color: #90caf9;
}

/* Responsive footer et menu */
@media (max-width: 768px) {
    .header-top { flex-direction: column; }
    .menu-principal { flex-direction: column; padding-left: 10px; }
    .menu-principal li { width: 100%; }
    .menu-principal li .sousmenu { position: relative; left:0; top:0; }

    .footer-grid { flex-direction: column; align-items: center; text-align: center; }
}
/* HERO */
.hero {
    position: relative;
    background: url('assets/img/hero-bg.jpg') center/cover no-repeat;
    color: #fff;
    text-align: center;
    padding: 80px 20px;
    border-radius: 10px;
    margin: 20px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Fond sombre semi-transparent derrière le texte */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5); /* ajuster l'opacité si nécessaire */
    z-index: 1;
}

.hero-text {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.hero-text h1 {
    font-size: 36px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.hero-text p {
    font-size: 18px;
    margin-bottom: 25px;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.7);
}

.hero-text .btn {
    background: #1976D2;
    color: #fff;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.hero-text .btn:hover {
    background: #1565C0;
    transform: scale(1.05);
}

/* Responsive hero */
@media (max-width: 768px) {
    .hero-text h1 { font-size: 28px; }
    .hero-text p { font-size: 16px; }
    .hero { padding: 60px 15px; }
}
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dégradé semi-transparent : du haut sombre vers le bas plus clair */
    background: linear-gradient(
        to bottom, 
        rgba(0, 0, 0, 0.4) 0%,   /* haut plus sombre */
        rgba(30, 60, 114, 0.2) 50%, /* milieu bleu clair */
        rgba(255, 255, 255, 0.1) 100% /* bas presque transparent */
    );
    z-index: 1;
    border-radius: 10px; /* optionnel, pour arrondir comme le hero */
}
