/* ============================================================
   DÉCOGRAPH — Header custom
   Accueil : header fixé, transparent avant scroll.
   Autres pages : header sticky, fond crème permanent.
============================================================ */

/* ===== RESET / POSITION ===== */
html, body {
    overflow-x: hidden !important;
    max-width: 100%;
}
body { padding-top: 0; }
#dg-header {
    left: 0;
    width: 100%;
    z-index: 9999;
    font-family: inherit;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Accueil : fixé + transparent avant scroll */
body.home #dg-header {
    position: fixed !important;
    top: 0;
    background-color: transparent !important;
    box-shadow: none !important;
}
body.home #dg-header.scrolled {
    background-color: #FAF5E5 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Autres pages : sticky + fond crème permanent */
body:not(.home) #dg-header {
    position: sticky !important;
    top: 0;
    background-color: #FAF5E5 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== INNER ===== */
.dg-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== LOGO ===== */
.dg-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.dg-logo-img {
    height: 70px !important;
    width: auto;
    transition: all 0.3s ease;
}
.dg-logo-name {
    font-weight: 800;
    font-size: 1.3rem;
    color: #000;
    letter-spacing: 0.5px;
}
.dg-logo-name span { color: #DDB406; }

/* ===== NAV DESKTOP ===== */
.dg-nav { flex: 1; display: flex; justify-content: center; }
.dg-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.dg-item { position: relative; }
.dg-link {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: color 0.3s ease;
}
.dg-link:hover { color: #DDB406 !important; font-weight: bold; }

/* Couleurs menu — accueil (texte blanc avant scroll, noir après scroll) */
body.home #dg-header .dg-link { color: #fff; }
body.home #dg-header.scrolled .dg-link { color: #000 !important; }

/* Couleurs menu — autres pages (texte noir en permanence) */
body:not(.home) #dg-header .dg-link { color: #000; }

/* Item courant (mis à jour en JS via .dg-active) */
.dg-item.dg-active > .dg-link {
    color: #DDB406 !important;
    font-weight: bold;
}

/* ===== FLÈCHE DROPDOWN ===== */
.dg-arrow {
    font-size: 0.6rem;
    margin-left: 4px;
    display: inline-block;
    transition: transform 0.25s ease;
}
.dg-has-dropdown:hover .dg-arrow { transform: rotate(180deg); }

/* ===== SOUS-MENU (DESKTOP) ===== */
.dg-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    min-width: max-content;
    width: auto;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    list-style: none;
    margin: 0;
    padding: 0;
}
.dg-has-dropdown:hover .dg-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dg-dropdown a {
    color: #000 !important;
    padding: 8px 16px !important;
    display: block;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.dg-dropdown a:hover {
    color: #DDB406 !important;
    font-weight: bold;
    background-color: rgba(221, 180, 6, 0.1) !important;
    transform: translateX(4px);
}

/* ===== ACTIONS DROITE ===== */
.dg-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    margin-left: auto;
}

/* ===== TÉLÉPHONE ===== */
.dg-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}
body.home #dg-header .dg-phone { color: #fff; }
body.home #dg-header.scrolled .dg-phone { color: #000; }
body:not(.home) #dg-header .dg-phone { color: #000; }
.dg-phone:hover { color: #DDB406; }

/* ===== CTA DEVIS GRATUIT ===== */
.dg-cta {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #FFDF5EFA;
    color: #000 !important;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 6px;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.15s ease;
}
.dg-cta:hover { background-color: #DDB406; transform: translateY(-1px); }

/* ===== BURGER ===== */
.dg-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    box-shadow: none;
    outline: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
}
.dg-burger span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    transition: background 0.35s ease, transform 0.3s ease, opacity 0.3s ease;
}
.dg-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.dg-burger.open span:nth-child(2) { opacity: 0; }
.dg-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Couleurs burger — accueil : blanc avant scroll (visible sur fond transparent), noir après */
body.home .dg-burger { background-color: #fff !important; }
body.home .dg-burger span { background-color: #000 !important; }
body.home #dg-header.scrolled .dg-burger { background-color: #000 !important; }
body.home #dg-header.scrolled .dg-burger span { background-color: #fff !important; }

/* Couleurs burger — autres pages : noir en permanence */
body:not(.home) .dg-burger { background-color: #000 !important; }
body:not(.home) .dg-burger span { background-color: #fff !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .dg-phone-number { display: none; }
}

@media (max-width: 860px) {
    .dg-burger { display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; }
    .dg-phone, .dg-cta { display: none !important; }

    .dg-nav {
        display: none;
        position: fixed;
        top: 90px;
        left: 0;
        right: 0;
        background: #fff;
        padding: 10px 0 24px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
        max-height: calc(100vh - 90px);
        overflow-y: auto;
        z-index: 9998;
    }
    .dg-nav.open { display: block; }

    .dg-menu { flex-direction: column; gap: 0; align-items: stretch; }
    .dg-item { width: 100%; }

    .dg-link {
        color: #000 !important;
        padding: 14px 24px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        font-size: 0.9rem;
    }
    .dg-link:hover { background-color: rgba(221, 180, 6, 0.1); }

    .dg-dropdown {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        background: #FAF5E5;
        min-width: auto;
        width: 100%;
    }
    .dg-has-dropdown.dg-open .dg-dropdown { display: block; }
    .dg-has-dropdown.dg-open .dg-arrow { transform: rotate(180deg); }
    .dg-dropdown a {
        padding: 12px 24px 12px 36px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
}

@media (max-width: 480px) {
    .dg-header-inner { padding: 0 16px; gap: 10px; }
    .dg-logo-img { height: 56px !important; }
}