/* 
 * Diametrie Premium Header Styles 
 * Ey-Style, Dark mode, Clean Typography
 */

 :root {
    --dph-bg: #2e2e38; /* Custom dark gray requested by user */
    --dph-bg-dropdown: #222224; /* Slightly lighter for dropdown */
    --dph-text: #ffffff;
    --dph-text-muted: #a0a0a5;
    --dph-accent: #ffe600; /* EY Yellow accent */
    --dph-border: rgba(255, 255, 255, 0.15);
    --dph-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --dph-transition: 0.3s ease;
}

/* Mega Menu Themes */
.diametrie-premium-header.dph-mega-theme-light {
    --mega-bg: rgba(255, 255, 255, 0.90);
    --mega-border: rgba(0, 0, 0, 0.08);
    --mega-text: #1a1a2e;
    --mega-text-muted: #555560;
    --mega-hover: #000;
}
.diametrie-premium-header.dph-mega-theme-dark {
    --mega-bg: rgba(30, 30, 32, 0.90);
    --mega-border: rgba(255, 255, 255, 0.08);
    --mega-text: var(--dph-text);
    --mega-text-muted: var(--dph-text-muted);
    --mega-hover: var(--dph-text);
}

.diametrie-premium-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    background: transparent;
    border-bottom: 1px solid transparent;
    font-family: var(--dph-font);
    color: var(--dph-text);
    transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}

/* Pseudo-element for header background to prevent nested backdrop-filter bug with mega menu */
.diametrie-premium-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: all 0.4s ease;
    pointer-events: none;
}

/* Mode défilement — Liquid Glass sombre sans blanc */
.diametrie-premium-header.is-scrolled {
    background: transparent;
    border-bottom: none;
}

.diametrie-premium-header.is-scrolled::before {
    background: rgba(15, 15, 18, 0.85); /* Solid base, fade handled by mask */
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-bottom: none;
    box-shadow: none;
    height: 140%; /* Extend below the text for a soft cloud effect */
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

/* Textes conservés clairs en mode défilement */

.dph-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

/* Logo */
.dph-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dph-text);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.5px;
}

/* Logo image toggle based on scroll state */
.dph-logo-img-dark {
    display: none;
}


/* Base logo image sizing */
.dph-logo-img {
    max-height: 48px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
}

/* Nav */
.dph-nav {
    display: flex;
    align-items: center;
    height: 100%;
}
.dph-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}
.dph-nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.dph-nav-link {
    text-decoration: none;
    color: var(--dph-text);
    font-size: 14px;
    font-weight: 600;
    padding: 0 18px;
    height: 100%;
    display: flex;
    align-items: center;
    transition: opacity var(--dph-transition);
}
.dph-nav-link:hover,
.dph-nav-item:hover > .dph-nav-link {
    opacity: 0.8;
}

/* Yellow Active/Hover underline */
.dph-nav-item::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--dph-accent);
    transform: scaleX(0);
    transition: transform 0.2s ease;
    transform-origin: left;
    z-index: 2;
}
.dph-nav-item:hover::after,
.dph-nav-item.active::after {
    transform: scaleX(1);
}

/* Right Actions */
.dph-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 100%;
}
.dph-action-link {
    text-decoration: none;
    color: var(--dph-text);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color var(--dph-transition);
}
.dph-action-link:hover {
    color: var(--dph-accent);
}
.dph-action-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.dph-action-country-toggle {
    height: 100%;
    padding: 0 16px;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    border-top: none;
    transition: all var(--dph-transition);
}
.dph-action-country-toggle.is-active {
    background: var(--dph-bg-dropdown);
    border-color: rgba(255,255,255,0.2);
    border-bottom-color: var(--dph-accent);
}

/* Mega Menu Dropdown */
.dph-mega-menu {
    position: fixed; /* Changed from absolute to fixed to span full viewport */
    top: 72px; /* Header height */
    left: 0;
    width: 100vw; /* Full viewport width */
    /* Frosted Glass Background (S'adapte au thème) */
    background: var(--mega-bg);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-top: none; /* Seamless blend with header */
    border-bottom: 1px solid var(--mega-border);
    padding: 60px 0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); /* Smoother animation */
    z-index: 99998;
    pointer-events: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
/* Affichage du mega menu au hover */
.dph-nav-item.has-mega:hover .dph-mega-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dph-mega-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    gap: 80px; /* Increased gap for breathing room */
}

/* 3 Columns Layout */
.dph-mega-left {
    flex: 0 0 300px;
}
.dph-mega-middle {
    flex: 0 0 380px;
    border-right: 1px solid var(--mega-border); /* Subtle divider */
    padding-right: 40px;
}
.dph-mega-right {
    flex: 1;
    position: relative;
    padding-left: 20px;
}

/* Typography in Dropdown */
.dph-mega-left h2 {
    font-size: 24px;
    font-weight: 400;
    margin: 0 0 16px;
    color: var(--mega-text);
}
.dph-mega-left p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--mega-text-muted);
    margin: 0 0 32px;
}
.dph-btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border: 1px solid var(--mega-text);
    color: var(--mega-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.dph-btn-outline:hover {
    background: var(--mega-text);
    color: var(--mega-bg);
}

/* Middle List (Services) */
.dph-mega-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dph-mega-list li {
    border-bottom: 1px solid var(--mega-border);
}
.dph-mega-list li:last-child {
    border-bottom: none;
}
.dph-mega-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    color: var(--mega-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s ease;
}
.dph-mega-list a svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
}
.dph-mega-list li.active a,
.dph-mega-list a:hover {
    color: var(--mega-hover);
}
.dph-mega-list li.active a svg,
.dph-mega-list a:hover svg {
    opacity: 1;
    transform: translateX(0);
}

/* Right List (Sub items / Useful Links) */
.dph-mega-title, .dph-mega-title-sub {
    color: var(--dph-accent);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dph-mega-title-sub svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}
.dph-mega-sub-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dph-mega-sub-list li {
    margin-bottom: 16px;
}
.dph-mega-sub-list a {
    color: var(--mega-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}
.dph-mega-sub-list a:hover {
    color: var(--dph-accent);
}

/* ==============================================
   Mega Menu Open State (Liquid Glass Header)
   ============================================== */
.diametrie-premium-header.mega-is-open::before {
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-bottom: none;
    height: 100%; /* Reset height */
    -webkit-mask-image: none; /* Reset cloud fade */
    mask-image: none;
}

/* Light Theme Gradient Seamless Blend */
.diametrie-premium-header.dph-mega-theme-light.mega-is-open::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.85) 100%);
}
.diametrie-premium-header.dph-mega-theme-light .dph-mega-menu {
    background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.95) 100%);
}

/* Dark Theme Gradient Seamless Blend */
.diametrie-premium-header.dph-mega-theme-dark.mega-is-open::before {
    background: linear-gradient(180deg, rgba(30,30,32,0.98) 0%, rgba(30,30,32,0.85) 100%);
}
.diametrie-premium-header.dph-mega-theme-dark .dph-mega-menu {
    background: linear-gradient(180deg, rgba(30,30,32,0.85) 0%, rgba(30,30,32,0.95) 100%);
}

/* Override Text & Icon Colors when Mega Menu is Open */
.diametrie-premium-header.mega-is-open,
.diametrie-premium-header.mega-is-open .dph-nav-link,
.diametrie-premium-header.mega-is-open .dph-action-link,
.diametrie-premium-header.mega-is-open .dph-logo {
    color: var(--mega-text) !important;
}

.diametrie-premium-header.mega-is-open .dph-nav-link:hover,
.diametrie-premium-header.mega-is-open .dph-action-link:hover {
    opacity: 0.6;
}

/* Logo toggling when Mega Menu is open */
.diametrie-premium-header.mega-is-open.dph-mega-theme-light .dph-logo-img-light {
    display: none !important;
}
.diametrie-premium-header.mega-is-open.dph-mega-theme-light .dph-logo-img-dark {
    display: block !important;
}

.diametrie-premium-header.mega-is-open.dph-mega-theme-dark .dph-logo-img-dark {
    display: none !important;
}
.diametrie-premium-header.mega-is-open.dph-mega-theme-dark .dph-logo-img-light {
    display: block !important;
}

/* Sub-panes logic */
.dph-sub-panes {
    position: relative;
    width: 100%;
}
.dph-sub-pane {
    display: none;
}
.dph-sub-pane.active {
    display: block;
}

/* Hide useful links if a sub-pane is active (handled by JS, but useful links is default) */
.dph-useful-links {
    display: none;
}
.dph-useful-links.active {
    display: block;
}

/* Reset Tatsu margins */
.tatsu-module .diametrie-premium-header {
    margin: 0;
}
body {
    padding-top: 0;
}

/* ==============================================
   Country Sidebar (Modal)
   ============================================== */
.dph-country-overlay {
    position: fixed;
    top: 72px; /* Commence sous le header */
    left: 0;
    width: 100vw;
    height: calc(100vh - 72px);
    background: transparent; /* Pas d'overlay assombri */
    backdrop-filter: none; /* Pas de flou */
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
}
.dph-country-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.dph-country-sidebar {
    position: fixed;
    top: 72px; /* Commence sous le header */
    right: 0;
    width: 400px;
    height: calc(100vh - 72px);
    background: var(--dph-bg-dropdown);
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    color: #fff;
    box-shadow: -10px 10px 30px rgba(0,0,0,0.3);
}
.dph-country-sidebar.is-open {
    transform: translateX(0);
}

.dph-cs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 40px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.dph-cs-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    color: #fff;
}
.dph-cs-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.dph-cs-close svg {
    width: 24px;
    height: 24px;
}
.dph-cs-close:hover {
    transform: scale(1.1);
}

.dph-cs-search {
    padding: 24px 40px;
}
.dph-cs-search input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 15px;
    padding: 8px 0;
    outline: none;
    font-family: var(--dph-font);
    transition: border-color 0.2s;
}
.dph-cs-search input::placeholder {
    color: rgba(255,255,255,0.5);
}
.dph-cs-search input:focus {
    border-color: #ffe600;
}

.dph-cs-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 40px 40px;
}
.dph-cs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dph-cs-list li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin: 0 -40px;
    padding: 0 40px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid transparent;
}
.dph-cs-list li:hover {
    background: rgba(255,255,255,0.03);
}
.dph-cs-list a {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 16px 0;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}
.dph-cs-list a strong {
    color: #fff;
    margin-right: 6px;
    font-weight: 500;
}
.dph-cs-list a:hover {
    color: #fff;
}

.dph-cs-main-locations {
    margin-bottom: 32px;
}
.dph-cs-main-locations li.active {
    background: #2a2a36; /* Plus contrasté */
    border-left: 4px solid #ffe600;
}
.dph-cs-main-locations li.active a,
.dph-cs-main-locations li.active a strong {
    color: #fff;
}
.dph-cs-main-locations li svg {
    width: 20px;
    height: 20px;
    color: #fff;
    margin-left: 16px;
}
.dph-cs-main-locations li:not(.active) svg {
    display: none;
}

.dph-cs-title {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 32px 0 16px;
}

/* Scrollbar for sidebar */
.dph-cs-content::-webkit-scrollbar {
    width: 6px;
}
.dph-cs-content::-webkit-scrollbar-track {
    background: transparent;
}
.dph-cs-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}
.dph-cs-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}
