/* ==============================================
   MODERN HEADER STYLES
============================================== */

.modern-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

html[data-theme="light"] .modern-header {
    background: linear-gradient(135deg, #e8e4ff 0%, #f5f7ff 100%);
    border-bottom: 2px solid #667eea;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.1);
}

html[data-theme="light"] .modern-header a {
    color: #1a1a2e;
}

html[data-theme="light"] .modern-header a:hover {
    color: #667eea;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(0.75rem, 2vw, 2rem);
}

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

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    min-height: 80px;
}

/* Brand Section */
.brand-section {
    flex: 1;
}

.brand-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    transition: transform 0.3s ease;
}

.brand-link:hover {
    transform: translateY(-1px);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
}

.brand-link:hover .brand-logo {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    transform: rotate(5deg);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-country {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Peace Message */
.peace-message {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1500px;
    position: relative;
    isolation: isolate;
    will-change: transform;
}

.peace-message::before {
    content: "";
    position: absolute;
    width: 150%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.25) 0%, rgba(240, 147, 251, 0.15) 40%, transparent 70%);
    animation: pulse-aura 4s ease-in-out infinite;
    pointer-events: none;
}

.peace-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: #667eea;
    background: linear-gradient(135deg, 
        #4338ca 0%, 
        #7c3aed 15%,
        #db2777 30%,
        #ea580c 45%,
        #f59e0b 60%,
        #db2777 75%,
        #7c3aed 90%,
        #4338ca 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 300% 300%;
    text-shadow: 
        0 0 20px rgba(67, 56, 202, 0.6),
        0 0 35px rgba(124, 58, 237, 0.5),
        0 0 50px rgba(219, 39, 119, 0.4),
        0 0 65px rgba(245, 158, 11, 0.3);
    filter: drop-shadow(0 8px 16px rgba(67, 56, 202, 0.6)) 
            drop-shadow(0 0 25px rgba(219, 39, 119, 0.4))
            drop-shadow(0 4px 20px rgba(245, 158, 11, 0.3));
    animation: 
        peace-glow 3s ease-in-out infinite, 
        peace-float 4s ease-in-out infinite, 
        gradient-shift 8s ease infinite,
        rotate-3d 6s ease-in-out infinite,
        sparkle 2s ease-in-out infinite;
    transform: translateZ(30px) rotateX(5deg);
    letter-spacing: 0.08em;
    position: relative;
    transform-style: preserve-3d;
}

.peace-text::before {
    content: "Peace and Love ✌️💚";
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(135deg, #4338ca, #7c3aed, #db2777, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(20px);
    opacity: 0.9;
    animation: blur-pulse 3s ease-in-out infinite;
}

.peace-text::after {
    content: "✨";
    position: absolute;
    top: -25px;
    right: -30px;
    font-size: 1.5rem;
    animation: sparkle-float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.9));
}

@keyframes peace-glow {
    0%, 100% { 
        opacity: 1;
        transform: translateZ(30px) rotateX(5deg) scale(1);
    }
    50% { 
        opacity: 0.9;
        transform: translateZ(40px) rotateX(5deg) scale(1.05);
    }
}

@keyframes peace-float {
    0%, 100% {
        transform: translateZ(30px) rotateX(5deg) translateY(0px);
    }
    25% {
        transform: translateZ(35px) rotateX(3deg) translateY(-5px);
    }
    75% {
        transform: translateZ(35px) rotateX(7deg) translateY(-5px);
    }
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    33% {
        background-position: 50% 100%;
    }
    66% {
        background-position: 100% 50%;
    }
}

@keyframes rotate-3d {
    0%, 100% {
        transform: translateZ(30px) rotateX(5deg) rotateY(0deg);
    }
    25% {
        transform: translateZ(35px) rotateX(3deg) rotateY(-2deg);
    }
    50% {
        transform: translateZ(40px) rotateX(5deg) rotateY(0deg);
    }
    75% {
        transform: translateZ(35px) rotateX(7deg) rotateY(2deg);
    }
}

@keyframes sparkle {
    0%, 100% {
        filter: 
            drop-shadow(0 8px 16px rgba(67, 56, 202, 0.6)) 
            drop-shadow(0 0 25px rgba(219, 39, 119, 0.4))
            drop-shadow(0 4px 20px rgba(245, 158, 11, 0.3))
            brightness(1);
    }
    50% {
        filter: 
            drop-shadow(0 10px 20px rgba(67, 56, 202, 0.8)) 
            drop-shadow(0 0 35px rgba(245, 158, 11, 0.6))
            drop-shadow(0 6px 30px rgba(219, 39, 119, 0.5))
            brightness(1.15);
    }
}

@keyframes blur-pulse {
    0%, 100% {
        filter: blur(20px);
        opacity: 0.8;
    }
    50% {
        filter: blur(25px);
        opacity: 0.6;
    }
}

@keyframes pulse-aura {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.6;
    }
}

@keyframes sparkle-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 1;
    }
    25% {
        transform: translateY(-8px) rotate(90deg) scale(1.2);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-12px) rotate(180deg) scale(1);
        opacity: 1;
    }
    75% {
        transform: translateY(-8px) rotate(270deg) scale(1.2);
        opacity: 0.8;
    }
}

html[data-theme="dark"] .peace-message::before {
    background: radial-gradient(circle, rgba(96, 165, 250, 0.2) 0%, transparent 70%);
}

html[data-theme="dark"] .peace-text {
    background: linear-gradient(135deg, 
        #60a5fa 0%, 
        #a78bfa 20%, 
        #f9a8d4 40%,
        #fbbf24 60%,
        #a78bfa 80%,
        #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 300% 300%;
    text-shadow: 
        0 0 20px rgba(96, 165, 250, 0.7),
        0 0 35px rgba(167, 139, 250, 0.6),
        0 0 50px rgba(249, 168, 212, 0.5),
        0 0 70px rgba(251, 191, 36, 0.4);
    filter: drop-shadow(0 8px 16px rgba(96, 165, 250, 0.6)) 
            drop-shadow(0 0 25px rgba(249, 168, 212, 0.4));
}

html[data-theme="dark"] .peace-text::before {
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #f9a8d4, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html[data-theme="dark"] .peace-text::after {
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 1));
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
}

.action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.125rem;
}

.action-btn:hover {
    background: #e2e8f0;
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-btn:active {
    transform: translateY(0);
}

/* Notification Badge */
.notification-badge,
.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Cart Tooltip */
.cart-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1001;
}

.cart-wrapper:hover .cart-tooltip {
    opacity: 1;
}

/* Hamburger Icon */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
    height: 16px;
}

.hamburger-icon span {
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

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

.main-navigation {
    border-top: 1px solid #f1f5f9;
    background: white;
    width: 100%;
}

.nav-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.nav-wrapper::-webkit-scrollbar { /* WebKit */
    height: 0;
    background: transparent;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-nav {
    flex: 0 0 auto;
}

.secondary-nav {
    flex: 0 0 auto;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: clamp(0.4rem, 0.8vw, 0.6rem) clamp(0.5rem, 1vw, 0.8rem);
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: clamp(0.78rem, 1vw, 0.875rem);
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    background: #f1f5f9;
    color: #3b82f6;
    transform: translateY(-1px);
}

.nav-link.active {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.nav-icon {
    font-size: 0.95rem;
    min-width: 14px;
}

.nav-text {
    white-space: nowrap;
}

.nav-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Dropdown Menu */
.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1002;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #3b82f6;
}

/* ==============================================
   MOBILE SEARCH OVERLAY
============================================== */

.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 2000;
}

.mobile-search-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
}

.search-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.15);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: border-color 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    color: #64748b;
    margin-right: 0.75rem;
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
}

.search-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.search-close:hover {
    background: #e2e8f0;
    color: #ef4444;
}

.search-suggestions {
    margin-top: 1.5rem;
}

.search-suggestions h4 {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 600;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-tag {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-tag:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

/* ==============================================
   RESPONSIVE DESIGN
============================================== */

@media (max-width: 768px) {
    .header-top {
        padding: 0.5rem 0;
        min-height: 56px;
    }

    .logo-wrapper {
        gap: 0.5rem;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
    }

    .brand-name {
        font-size: 1.05rem;
    }

    .brand-country {
        font-size: 0.65rem;
    }

    .peace-message {
        display: none;
    }

    .header-actions {
        gap: 0.2rem;
    }

    .action-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
        border-radius: 9px;
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-navigation.active {
        display: block;
    }

    .nav-wrapper {
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 0.1rem;
        width: 100%;
    }

    .primary-nav {
        margin-bottom: 0.4rem;
        padding-bottom: 0.4rem;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-link {
        padding: 0.6rem 1rem;
        justify-content: flex-start;
        border-radius: 6px;
        margin: 0 0.5rem;
    }

    .nav-icon {
        font-size: 0.95rem;
        min-width: 16px;
    }

    .nav-text {
        font-size: 0.875rem;
    }

    .nav-badge {
        font-size: 0.65rem;
        padding: 0.1rem 0.4rem;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        margin: 0;
        padding: 0.25rem 0 0.25rem 2.5rem;
        border-radius: 0;
    }

    .dropdown-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Masquer "Peace and Love" sur les écrans intermédiaires pour libérer de l'espace */
@media (max-width: 1200px) and (min-width: 769px) {
    .peace-message {
        display: none;
    }
    .brand-section {
        flex: 0 0 auto;
    }
    .header-actions {
        flex: 0 0 auto;
    }
    .nav-list {
        gap: 0.2rem;
    }
    .nav-icon {
        font-size: 0.85rem;
    }
}

/* Sur très grands écrans, on peut réafficher "Peace and Love" */
@media (min-width: 1201px) {
    .peace-message {
        display: flex;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 0.6rem;
    }

    .header-actions {
        gap: 0.15rem;
    }

    .action-btn {
        width: 34px;
        height: 34px;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .brand-logo {
        width: 30px;
        height: 30px;
    }

    .brand-name {
        font-size: 0.95rem;
    }

    .brand-country {
        font-size: 0.6rem;
    }

    .nav-link {
        padding: 0.55rem 0.875rem;
    }

    .nav-text {
        font-size: 0.825rem;
    }

    .search-container {
        width: 95%;
        padding: 1.25rem;
    }
}

/* iPhone SE, Galaxy A series et petits écrans */
@media (max-width: 390px) {
    .header-top {
        min-height: 50px;
    }

    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .brand-logo {
        width: 28px;
        height: 28px;
    }

    .brand-name {
        font-size: 0.875rem;
    }

    .brand-country {
        display: none;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
    }

    .nav-text {
        font-size: 0.8rem;
    }
}

/* ==============================================
   UTILITY CLASSES
============================================== */

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
    
    .desktop-only {
        display: none;
    }
}

/* ==============================================
   ANIMATIONS & TRANSITIONS
============================================== */

.modern-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Loading state */
.nav-link.loading {
    opacity: 0.7;
    pointer-events: none;
}

.nav-link.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.5rem;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translateY(-50%);
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ==============================================
   UTILITY CLASSES
============================================== */

.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
    
    .desktop-only {
        display: none;
    }
}