/* ============================================================
   SITE DYMO SHOP — BASE CSS
   Header / Navigation / Mini-cart / Footer / Responsive
============================================================ */


/* ============================================================
   RESET
============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.6;
    overflow-x: hidden;
}


img {
    max-width: 100%;
    height: auto;
    display: block;
}


a {
    color: inherit;
    text-decoration: none;
    transition:
        color 0.25s ease,
        background-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


button,
input,
textarea,
select {
    font: inherit;
}


button {
    cursor: pointer;
}


ul {
    list-style: none;
}


/* ============================================================
   VARIABLES
============================================================ */

:root {

    --primary: #16a34a;
    --primary-dark: #15803d;
    --primary-light: #4ade80;

    --secondary: #0f172a;
    --secondary-light: #1e293b;

    --white: #ffffff;

    --text: #0f172a;
    --text-light: #64748b;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --background: #f8fafc;
    --background-light: #f1f5f9;

    --success: #22c55e;
    --danger: #dc2626;
    --warning: #f59e0b;

    --radius-small: 6px;
    --radius: 10px;
    --radius-large: 16px;

    --shadow-small:
        0 2px 8px rgba(15, 23, 42, 0.06);

    --shadow:
        0 8px 25px rgba(15, 23, 42, 0.08);

    --shadow-large:
        0 20px 50px rgba(15, 23, 42, 0.12);

    --transition:
        all 0.3s ease;

    --container:
        1400px;
}


/* ============================================================
   ACCESSIBILITÉ
============================================================ */

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


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

.header {

    position: sticky;
    top: 0;

    z-index: 1000;

    width: 100%;

    background: rgba(255, 255, 255, 0.97);

    backdrop-filter: blur(12px);

    border-bottom: 1px solid var(--border);

    box-shadow:
        0 2px 12px rgba(15, 23, 42, 0.05);
}


/* ============================================================
   TOP BAR
============================================================ */

.top-bar {

    min-height: 38px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 8px 30px;

    background: var(--primary);

    color: var(--white);

    font-size: 18px;
}


.top-bar-left,
.top-bar-right {

    display: flex;

    align-items: center;

    gap: 8px;
}


.top-bar span {

    display: flex;

    align-items: center;

    gap: 7px;
}


.top-bar i {

    font-size: 12px;
}


.top-bar a {

    color: var(--white);

    font-weight: 500;
}


.top-bar a:hover {

    opacity: 0.8;

    text-decoration: underline;
}


/* ============================================================
   NAVIGATION PRINCIPALE
============================================================ */

.nav-container {

    width: 100%;

    min-height: 78px;

    display: flex;

    align-items: center;

    gap: 25px;

    padding: 12px 30px;

    background: var(--white);
}


/* ============================================================
   LOGO
============================================================ */

.logo {

    flex-shrink: 0;

    display: inline-flex;

    align-items: center;
}


.logo img {

    width: 150px;

    max-height: 58px;

    object-fit: contain;

    transition:
        transform 0.35s ease,
        filter 0.35s ease;
}


.logo:hover img {

    transform: scale(1.04);

    filter:
        drop-shadow(
            0 5px 10px
            rgba(22, 163, 74, 0.15)
        );
}


/* ============================================================
   NAVIGATION PRINCIPALE
============================================================ */

.main-navigation {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 26px;

    flex: 1;
}


.main-navigation a {

    position: relative;

    display: inline-flex;

    align-items: center;

    padding: 8px 2px;

    color: var(--secondary);

    font-size: 14px;

    font-weight: 600;
}


.main-navigation a::after {

    content: "";

    position: absolute;

    left: 0;

    bottom: 1px;

    width: 0;

    height: 2px;

    background: var(--primary);

    border-radius: 999px;

    transition: width 0.3s ease;
}


.main-navigation a:hover {

    color: var(--primary);
}


.main-navigation a:hover::after {

    width: 100%;
}


/* ============================================================
   ACTIONS NAVIGATION
============================================================ */

.nav-actions {

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 10px;

    flex-shrink: 0;
}


.nav-action {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    min-height: 40px;

    padding: 8px 12px;

    border-radius: var(--radius);

    color: var(--secondary);

    font-size: 13px;

    font-weight: 600;
}


.nav-action i {

    font-size: 15px;
}


.nav-action:hover {

    color: var(--primary);

    background: #f0fdf4;

    transform: translateY(-1px);
}


/* ============================================================
   PANIER
============================================================ */

.cart-action {

    position: relative;

    background: #f8fafc;

    border: 1px solid var(--border);
}


.cart-action:hover {

    background: #f0fdf4;

    border-color: #bbf7d0;
}


/* ============================================================
   INSCRIPTION
============================================================ */

.register-action {

    color: var(--white);

    background: var(--primary);

    border: 1px solid var(--primary);
}


.register-action:hover {

    color: var(--white);

    background: var(--primary-dark);

    border-color: var(--primary-dark);

    box-shadow:
        0 6px 15px rgba(22, 163, 74, 0.22);
}


/* ============================================================
   DÉCONNEXION
============================================================ */

.logout-action:hover {

    color: var(--danger);

    background: #fef2f2;
}


/* ============================================================
   BOUTON MENU MOBILE
============================================================ */

.menu-toggle {

    display: none;

    width: 42px;

    height: 42px;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    background: var(--white);

    color: var(--secondary);

    font-size: 20px;

    transition: var(--transition);
}


.menu-toggle:hover {

    color: var(--primary);

    background: #f0fdf4;

    border-color: #bbf7d0;
}


/* ============================================================
   MINI CART
============================================================ */

.mini-cart {

    width: 100%;

    padding: 0 30px;

    background: #f0fdf4;

    border-top: 1px solid #bbf7d0;

    border-bottom: 1px solid #bbf7d0;
}


.mini-cart-content {

    min-height: 46px;

    max-width: var(--container);

    margin: 0 auto;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 12px;

    color: var(--secondary);

    font-size: 13px;
}


.mini-cart-icon {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: 30px;

    height: 30px;

    border-radius: 50%;

    background: var(--white);

    color: var(--primary);

    box-shadow: var(--shadow-small);
}


.mini-cart-text {

    display: inline-flex;

    align-items: center;

    gap: 4px;
}


.mini-cart-text strong {

    color: var(--primary);

    font-weight: 700;
}


.mini-cart-link {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    margin-left: 8px;

    color: var(--primary);

    font-weight: 700;
}


.mini-cart-link:hover {

    color: var(--primary-dark);

    transform: translateX(2px);
}


/* ============================================================
   MENU DES CATÉGORIES
============================================================ */

.category-nav {

    width: 100%;

    background: var(--white);

    border-top: 1px solid #f1f5f9;

    box-shadow:
        0 5px 20px rgba(15, 23, 42, 0.06);

    overflow: hidden;

    max-height: 0;

    opacity: 0;

    transition:
        max-height 0.4s ease,
        opacity 0.3s ease;
}


/*
   base.js doit ajouter la classe .show
   lorsque le bouton mobile est utilisé.
*/

.category-nav.show {

    max-height: 1200px;

    opacity: 1;
}


.category-nav ul {

    max-width: var(--container);

    margin: 0 auto;

    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 4px 18px;

    padding: 14px 30px;
}


.category-nav li {

    display: flex;

    align-items: center;
}


.category-nav a {

    position: relative;

    display: inline-flex;

    align-items: center;

    gap: 7px;

    padding: 7px 3px;

    color: var(--secondary-light);

    font-size: 13px;

    font-weight: 500;
}


.category-nav a i {

    color: var(--primary);

    font-size: 13px;
}


.category-nav a::after {

    content: "";

    position: absolute;

    left: 0;

    bottom: 1px;

    width: 0;

    height: 2px;

    background: var(--primary);

    transition: width 0.25s ease;
}


.category-nav a:hover {

    color: var(--primary);
}


.category-nav a:hover::after {

    width: 100%;
}


/* ============================================================
   TITRES DE SECTIONS DU MENU
============================================================ */

.category-nav .nav-section-title {

    width: 100%;

    margin-top: 8px;

    padding-top: 10px;

    padding-bottom: 3px;

    border-top: 1px solid var(--border);

    color: var(--primary);

    font-size: 11px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.7px;
}


/* ============================================================
   MAIN
============================================================ */

#main-content {

    min-height: 60vh;

    width: 100%;
}


/*
   On évite de mettre un gros padding global ici.
   Les pages comme home.html gèrent elles-mêmes
   leurs espacements.
*/

main {

    width: 100%;
}


/* ============================================================
   FOOTER
============================================================ */

.footer {

    margin-top: 60px;

    background:
        linear-gradient(
            180deg,
            var(--secondary),
            var(--primary-dark)
        );

    color: var(--white);

    padding: 65px 30px 25px;

}


.footer-grid {

    width: 100%;

    max-width: var(--container);

    margin: 0 auto;

    display: grid;

    grid-template-columns:
        1.4fr
        1fr
        1fr
        1fr
        1fr;

    gap: 45px;
}


.footer-column {

    min-width: 0;
}


.footer h3 {

    position: relative;

    margin-bottom: 20px;

    padding-bottom: 10px;

    color: var(--white);

    font-size: 17px;

    font-weight: 700;
}


.footer h3::after {

    content: "";

    position: absolute;

    left: 0;

    bottom: 0;

    width: 35px;

    height: 2px;

    border-radius: 999px;

    background: var(--primary-light);
}


.footer p {

    margin-bottom: 12px;

    color: #cbd5e1;

    font-size: 13px;

    line-height: 1.8;
}


.footer p i {

    width: 18px;

    margin-right: 5px;

    color: var(--primary-light);
}


.footer ul {

    display: flex;

    flex-direction: column;

    gap: 10px;
}


.footer li {

    margin: 0;
}


.footer a {

    color: #cbd5e1;

    font-size: 13px;
}


.footer a:hover {

    color: var(--primary-light);

    transform: translateX(4px);
}


.footer a i {

    width: 20px;

    margin-right: 4px;
}


/* ============================================================
   FOOTER BOTTOM
============================================================ */

.footer-bottom {

    width: 100%;

    max-width: var(--container);

    margin: 45px auto 0;

    padding-top: 22px;

    border-top: 1px solid rgba(255, 255, 255, 0.1);

    text-align: center;
}


.footer-bottom p {

    margin: 0;

    color: #94a3b8;

    font-size: 12px;
}


.footer-bottom strong {

    color: #cbd5e1;
}


/* ============================================================
   ANIMATIONS
============================================================ */

@keyframes fadeIn {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }

}


@keyframes slideDown {

    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }

}


.header {

    animation:
        slideDown 0.45s ease;
}


/* ============================================================
   MENU DES CATÉGORIES — VERSION BUREAU (PC)
   Bouton "Catégories" + méga-menu en colonnes
============================================================ */

@media (min-width: 851px) {

    /* --------------------------------------------------------
       Ordre dans la barre : logo → Catégories → navigation → actions
    -------------------------------------------------------- */

    .logo {
        order: 1;
    }

    .menu-toggle {
        order: 2;
    }

    .main-navigation {
        order: 3;
    }

    .nav-actions {
        order: 4;
    }


    /* --------------------------------------------------------
       Bouton "Catégories"
    -------------------------------------------------------- */

    .menu-toggle {

        display: inline-flex;

        width: auto;

        height: 44px;

        gap: 10px;

        padding: 0 20px;

        border: 1px solid var(--primary);

        border-radius: 999px;

        background: var(--primary);

        color: var(--white);

        font-size: 15px;

        box-shadow:
            0 6px 15px rgba(22, 163, 74, 0.22);
    }


    .menu-toggle::after {

        content: "Catégories \25BE";

        font-size: 14px;

        font-weight: 700;

        letter-spacing: 0.2px;
    }


    .menu-toggle:hover {

        color: var(--white);

        background: var(--primary-dark);

        border-color: var(--primary-dark);

        transform: translateY(-1px);
    }


    /* Bouton actif (menu ouvert) */

    .menu-toggle[aria-expanded="true"],
    .header:has(.category-nav.show) .menu-toggle {

        background: var(--secondary);

        border-color: var(--secondary);

        color: var(--white);

        box-shadow:
            0 6px 15px rgba(15, 23, 42, 0.25);
    }


    /* --------------------------------------------------------
       Panneau du méga-menu (sous le header, par-dessus la page)
    -------------------------------------------------------- */

    .category-nav {

        position: absolute;

        top: 100%;

        left: 0;

        right: 0;

        max-height: calc(100vh - 170px);

        overflow-y: auto;

        border-top: 1px solid var(--border);

        box-shadow:
            0 30px 60px rgba(15, 23, 42, 0.16);

        opacity: 0;

        visibility: hidden;

        transform: translateY(-10px);

        pointer-events: none;

        transition:
            opacity 0.25s ease,
            transform 0.25s ease,
            visibility 0.25s ease;
    }


    .category-nav.show {

        max-height: calc(100vh - 170px);

        opacity: 1;

        visibility: visible;

        transform: translateY(0);

        pointer-events: auto;
    }


    /* --------------------------------------------------------
       Contenu : catégories réparties en colonnes
    -------------------------------------------------------- */

    .category-nav ul {

        display: block;

        column-count: 4;

        column-gap: 36px;

        column-rule: 1px solid #f1f5f9;

        padding: 28px 30px 34px;
    }


    .category-nav li {

        display: block;

        break-inside: avoid;
    }


    /* "Accueil" est déjà dans la navigation principale */

    .category-nav li:first-child {

        display: none;
    }


    /* --------------------------------------------------------
       Titres de sections
    -------------------------------------------------------- */

    .category-nav .nav-section-title {

        margin: 20px 0 8px;

        padding: 0 10px 8px;

        border-top: 0;

        border-bottom: 1px solid var(--border);

        color: var(--primary);

        font-size: 12px;

        font-weight: 800;

        letter-spacing: 0.8px;

        break-after: avoid;
    }


    .category-nav li:first-child + .nav-section-title {

        margin-top: 0;
    }


    /* --------------------------------------------------------
       Liens du menu
    -------------------------------------------------------- */

    .category-nav a {

        width: 100%;

        gap: 12px;

        padding: 7px 10px;

        border-radius: 10px;

        color: var(--secondary-light);

        font-size: 13.5px;

        font-weight: 500;
    }


    .category-nav a::after {

        display: none;
    }


    .category-nav a i {

        width: 30px;

        height: 30px;

        flex-shrink: 0;

        display: inline-flex;

        align-items: center;

        justify-content: center;

        border-radius: 8px;

        background: #f0fdf4;

        color: var(--primary);

        font-size: 13px;

        transition:
            background-color 0.25s ease,
            color 0.25s ease;
    }


    .category-nav a:hover {

        color: var(--primary-dark);

        background: #f0fdf4;

        transform: translateX(3px);
    }


    .category-nav a:hover i {

        background: var(--primary);

        color: var(--white);
    }

}


/* Petits écrans d'ordinateur / tablette paysage : 3 colonnes */

@media (min-width: 851px) and (max-width: 1100px) {

    .category-nav ul {

        column-count: 3;

        column-gap: 28px;

        padding-left: 20px;

        padding-right: 20px;
    }


    .menu-toggle {

        padding: 0 16px;
    }

}


/* ============================================================
   TABLETTE
============================================================ */

@media (max-width: 1100px) {

    .nav-container {

        padding-left: 20px;

        padding-right: 20px;

        gap: 15px;
    }


    .main-navigation {

        gap: 15px;
    }


    .main-navigation a {

        font-size: 13px;
    }


    .nav-action span {

        display: none;
    }


    .nav-action {

        width: 40px;

        height: 40px;

        padding: 0;
    }


    .nav-action i {

        font-size: 16px;
    }


    .footer-grid {

        grid-template-columns:
            repeat(3, 1fr);

        gap: 35px;
    }

}


/* ============================================================
   TABLETTE / MOBILE
============================================================ */

@media (max-width: 850px) {

    .top-bar {

        padding: 7px 15px;

        font-size: 11px;
    }


    .top-bar {

        flex-direction: column;

        justify-content: center;

        gap: 3px;
    }


    .nav-container {

        min-height: 68px;

        padding: 10px 15px;
    }


    .logo img {

        width: 125px;
    }


    .main-navigation {

        display: none;
    }


    .nav-actions {

        margin-left: auto;

        gap: 6px;
    }


    .menu-toggle {

        display: inline-flex;
    }


    /* ========================================================
       MENU MOBILE : CATÉGORIES EN 3 COLONNES
    ======================================================== */

    /*
       Le menu ouvert peut être plus haut que l'écran :
       on limite sa hauteur et on active le défilement
       interne pour que toutes les catégories restent
       accessibles.
    */

    .category-nav.show {

        max-height: 65vh;

        overflow-y: auto;

        -webkit-overflow-scrolling: touch;
    }


    /* Grille de 3 colonnes égales */

    .category-nav ul {

        display: grid;

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        align-items: stretch;

        gap: 8px;

        padding: 10px 12px 18px;
    }


    .category-nav li {

        width: 100%;

        min-width: 0;

        align-items: stretch;
    }


    /* Chaque catégorie devient une petite tuile */

    .category-nav a {

        width: 100%;

        flex-direction: column;

        justify-content: center;

        gap: 6px;

        padding: 10px 4px;

        border: 1px solid #f1f5f9;

        border-radius: 10px;

        background: #f8fafc;

        font-size: 11.5px;

        line-height: 1.3;

        text-align: center;

        overflow-wrap: anywhere;
    }


    .category-nav a i {

        font-size: 18px;
    }


    .category-nav a:hover {

        background: #f0fdf4;

        border-color: #bbf7d0;
    }


    /* Plus de soulignement animé sur les tuiles */

    .category-nav a::after {

        display: none;
    }


    /* "Accueil" : ligne complète en haut du menu */

    .category-nav li:first-child {

        grid-column: 1 / -1;
    }


    .category-nav li:first-child a {

        flex-direction: row;

        gap: 8px;

        font-size: 13px;
    }


    .category-nav li:first-child a i {

        font-size: 15px;
    }


    /* Titres de sections : ligne complète */

    .category-nav .nav-section-title {

        grid-column: 1 / -1;

        margin-top: 8px;

        padding-top: 12px;

        padding-bottom: 0;

        border-top: 1px solid var(--border);
    }


    .mini-cart {

        padding: 0 15px;
    }


    .mini-cart-content {

        flex-wrap: wrap;

        justify-content: center;

        padding: 8px 0;

        gap: 7px;

        text-align: center;
    }


    .mini-cart-link {

        margin-left: 0;
    }


    .footer {

        padding:
            50px 20px 20px;
    }


    .footer-grid {

        grid-template-columns:
            repeat(2, 1fr);

        gap: 35px 25px;
    }

}


/* ============================================================
   PETITS ÉCRANS
============================================================ */

@media (max-width: 600px) {

    .top-bar {

        font-size: 10px;

        line-height: 1.4;
    }


    .top-bar-left,
    .top-bar-right {

        width: 100%;

        justify-content: center;
    }


    .nav-container {

        min-height: 64px;

        gap: 8px;
    }


    .logo img {

        width: 110px;
    }


    .nav-actions {

        gap: 4px;
    }


    .nav-action {

        width: 36px;

        height: 36px;

        min-height: 36px;

        border-radius: 8px;
    }


    .nav-action i {

        font-size: 14px;
    }


    .menu-toggle {

        width: 38px;

        height: 38px;

        font-size: 18px;
    }


    .mini-cart-text {

        font-size: 11px;
    }


    .mini-cart-link {

        font-size: 11px;
    }


    .footer-grid {

        grid-template-columns:
            1fr;

        gap: 30px;
    }


    .footer {

        margin-top: 40px;

        padding:
            45px 18px 20px;
    }


    .footer h3 {

        font-size: 16px;
    }


    .footer-bottom {

        margin-top: 30px;
    }

}


/* ============================================================
   TRÈS PETITS ÉCRANS
============================================================ */

@media (max-width: 400px) {

    .top-bar-left,
    .top-bar-right {

        font-size: 9px;
    }


    .logo img {

        width: 95px;
    }


    .nav-action {

        width: 34px;

        height: 34px;
    }


    .menu-toggle {

        width: 35px;

        height: 35px;
    }


    /* Menu 3 colonnes : tuiles un peu plus compactes */

    .category-nav ul {

        gap: 6px;

        padding: 8px 10px 16px;
    }


    .category-nav a {

        padding: 8px 3px;

        font-size: 10.5px;
    }


    .category-nav a i {

        font-size: 16px;
    }

}


/* ============================================================
   ACCESSIBILITÉ — RÉDUCTION DES ANIMATIONS
============================================================ */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }


    *,
    *::before,
    *::after {

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;

        scroll-behavior: auto !important;
    }

}