/**
 * ROY KAPAK - Header CSS
 * Yeni Tasarım Dili - Brief'e Göre
 * Global Fix - Tüm Sayfalarda Dropdown Sorununu Çözer
 */

/* Neon Effect Variables */
:root {
    --neon-primary: rgba(221, 127, 47, 1); /* Ana neon rengi */
    --neon-primary-90: rgba(221, 127, 47, 0.9);
    --neon-primary-80: rgba(221, 127, 47, 0.8);
    --neon-primary-70: rgba(221, 127, 47, 0.7);
    --neon-primary-60: rgba(221, 127, 47, 0.6);
    --neon-primary-50: rgba(221, 127, 47, 0.5);
    --neon-primary-40: rgba(221, 127, 47, 0.4);
    --neon-primary-30: rgba(221, 127, 47, 0.3);
    --neon-primary-20: rgba(221, 127, 47, 0.2);
    --neon-primary-10: rgba(221, 127, 47, 0.1);
    --neon-primary-05: rgba(221, 127, 47, 0.05);
}

/* Global CSS Reset - Sayfa bazında çakışmaları önle */
* {
    box-sizing: border-box;
}

/* Header Container */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--secondary-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    /* Header'ın dropdown altında kalmasını engelle */
    transform: translateZ(0);
    will-change: transform;
    /* Dropdown'ın tam görünmesini sağla */
    overflow: visible;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: var(--header-height);
    /* Dropdown'ın tam görünmesini sağla */
    overflow: visible;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    transition: var(--transition);
    height: 100%;
    padding: 10px 0;
    position: relative;
    grid-column: 1;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: 65px;
    width: auto;
    transition: var(--transition);
    object-fit: contain;
    display: block;
}



/* Logo Hover Neon Effect */
.logo:hover img {
    filter: drop-shadow(0 0 15px rgba(221, 127, 47, 0.8)) 
            drop-shadow(0 0 25px rgba(221, 127, 47, 0.7))
            drop-shadow(0 0 35px rgba(221, 127, 47, 0.5))
            drop-shadow(0 0 45px rgba(221, 127, 47, 0.3));
}



.logo-text {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-left: 12px;
}

/* Ana Navigasyon */
.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-left: 2rem;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Dropdown Menü */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--white);
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9997;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--secondary-color);
    position: relative;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--light);
    color: var(--primary-color);
    /* padding-left: 25px; - Yazı kaymasını önlemek için kaldırıldı */
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.dropdown-item:hover::before {
    transform: scaleY(1);
}

/* Sağ Taraf - Kullanıcı Menüsü */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    grid-column: 3;
    justify-self: end;
    /* Dropdown'ın tam görünmesini sağla */
    overflow: visible;
}

/* Arama */
.search-container {
    position: relative;
    grid-column: 2;
    justify-self: start;
    margin-left: 2rem;
}

.search-input {
    width: 250px;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    background: var(--light);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(221, 127, 47, 0.1);
    background: var(--white);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    color: var(--primary-color);
}

/* Kullanıcı Menüsü */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    text-decoration: none;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: var(--border-radius);
}

.user-link:hover {
    background: var(--light);
    color: var(--primary-color);
}

.user-icon {
    font-size: 1.2rem;
}

/* User Profile Dropdown */
.user-profile-dropdown {
    position: relative;
}

.user-profile-dropdown .user-link {
    min-width: 80px;
    flex-direction: column;
    text-align: center;
}

/* Yeni Sepet Sistemi */
.header-cart {
    position: relative;
    z-index: 9999;
}

/* Sepet Trigger */
.cart-trigger {
    position: relative;
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    text-decoration: none;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    position: relative;
}

.cart-link:hover {
    background: var(--light);
    color: var(--primary-color);
}

.cart-link i {
    font-size: 1.2rem;
}

.cart-text {
    font-weight: 500;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cartBadgePulse 0.3s ease-out;
}

/* Sepet Panel */
.cart-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 380px;
    background: white;
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
}

.cart-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Panel Header */
.cart-panel-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
}

.cart-panel-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Panel Body */
.cart-panel-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--secondary-color);
    transition: var(--transition);
}

.cart-item:hover {
    background: var(--secondary-light);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--border-radius);
    border: 1px solid var(--secondary-color);
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.3;
}

.cart-item-price {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.cart-item-quantity {
    margin: 0;
    font-size: 0.8rem;
    color: var(--gray);
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--light-gray);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:hover {
    background: #f8d7da;
    color: #721c24;
    transform: scale(1.1);
}

/* Boş Sepet */
.cart-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray);
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: var(--light-gray);
}

.cart-empty p {
    margin: 0;
    font-size: 1rem;
    color: var(--gray);
}

/* Panel Footer */
.cart-panel-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--secondary-color);
    background: var(--secondary-light);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.cart-total strong {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    transition: var(--transition);
}

.cart-checkout-btn:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Animasyonlar */
@keyframes cartBadgePulse {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    text-decoration: none;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    position: relative;
}

.cart-link:hover {
    background: var(--light);
    color: var(--primary-color);
}

.cart-icon {
    font-size: 1.2rem;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
    animation: cartCountPulse 0.3s ease-out;
}

/* Responsive sepet panel */
@media (max-width: 767.98px) {
    .cart-panel {
        width: 320px;
        right: -20px;
    }
}

@media (max-width: 575.98px) {
    .cart-panel {
        width: 300px;
        right: -40px;
    }
}

/* Mobil Menü Butonu */
.mobile-menu-btn {
    display: none; /* Varsayılan olarak gizli */
    background: #ffffff;
    border: 2px solid #e5e7eb;
    font-size: 0;
    color: #374151;
    cursor: pointer;
    padding: 0;
    border-radius: 12px;
    transition: all 0.3s ease;
    z-index: 10001;
    position: relative;
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Hamburger Icon - Clean Design */
.mobile-menu-btn::before,
.mobile-menu-btn::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 20px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.mobile-menu-btn::before {
    top: 14px;
}

.mobile-menu-btn::after {
    bottom: 14px;
}

.mobile-menu-btn i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: #f9fafb;
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(221, 127, 47, 0.2);
}

.mobile-menu-btn:hover::before,
.mobile-menu-btn:hover::after,
.mobile-menu-btn:hover i {
    background: var(--primary-color);
    transform: translateX(-50%);
}

.mobile-menu-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.mobile-menu-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(221, 127, 47, 0.3);
}

.mobile-menu-btn.active::before {
    top: 50%;
    width: 20px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: #374151;
}

.mobile-menu-btn.active::after {
    bottom: 50%;
    width: 20px;
    transform: translate(-50%, 50%) rotate(-45deg);
    background: #374151;
}

.mobile-menu-btn.active i {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

/* Mobil Menü */
.mobile-menu {
    display: none; /* Varsayılan olarak gizli */
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e2e8f0;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
    z-index: 10001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    display: block !important;
    transform: translateX(0) !important;
}

.mobile-menu:not(.active) {
    transform: translateX(-100%) !important;
}

/* Mobile Menu Header */
.mobile-menu-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-logo {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #f97316 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(221, 127, 47, 0.3);
}

.mobile-menu-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.mobile-menu-title img {
    height: 50px;
    object-fit: contain;
    max-width: 100%;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 1rem 0;
}

.mobile-nav-item {
    margin: 0.25rem 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #64748b;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    margin: 0.25rem 0;
    border-radius: 0 12px 12px 0;
    background: transparent;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color) 0%, #f97316 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 2px 2px 0;
}

.mobile-nav-link:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(221, 127, 47, 0.1);
}

.mobile-nav-link:hover::before {
    transform: scaleY(1);
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 1200px) {
    .search-input {
        width: 180px;
    }
    
    .nav-list {
        gap: 1.2rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
}

@media (max-width: 1024px) {
    .search-input {
        width: 160px;
    }
    
    .nav-list {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
    }
    
    .header-container {
        padding: 0 20px;
    }
}

@media (max-width: 900px) {
    .search-input {
        width: 140px;
    }
    
    .nav-list {
        gap: 0.8rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
    
    .header-container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .header-container {
        height: var(--header-height-mobile);
        padding: 0 15px;
    }
    
    .nav {
        display: none;
    }
    
    .search-container {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block !important;
        z-index: 10001;
        position: relative;
        background: #ffffff !important;
        color: #374151 !important;
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        width: 48px;
        height: 48px;
    }
    
    .mobile-menu {
        width: 280px;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .logo img {
        height: 55px;
    }
    
    .user-menu {
        gap: 0.5rem;
    }
    
    .user-link span,
    .cart-link span {
        display: none;
    }
}

@media (max-width: 600px) {
    .header-container {
        padding: 0 12px;
    }
    
    .user-menu {
        gap: 0.3rem;
    }
    
    .user-menu-btn {
        padding: 6px;
    }
    
    .cart-btn {
        padding: 6px;
    }
    
    .logo img {
        height: 45px;
    }
    
    .mobile-menu-btn {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 10px;
    }
    
    .logo img {
        height: 45px;
    }
    
    .user-menu {
        gap: 0.3rem;
    }
    
    .user-link,
    .cart-link {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .mobile-menu-btn {
        width: 44px;
        height: 44px;
        padding: 0;
        z-index: 10001;
        background: #ffffff !important;
        color: #374151 !important;
        border: 2px solid #e5e7eb;
        border-radius: 10px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-btn:hover {
        background: #f9fafb !important;
        color: var(--primary-color) !important;
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(221, 127, 47, 0.2);
        border-color: var(--primary-color);
    }
}

@media (max-width: 360px) {
    .header-container {
        padding: 0 8px;
    }
    
    .logo img {
        height: 35px;
    }
    
    .user-menu {
        gap: 0.1rem;
    }
    
    .user-link,
    .cart-link {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
    
    .mobile-menu-btn {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu {
        width: 240px;
    }
}

/* Animasyonlar */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu {
    animation: slideDown 0.3s ease-out;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    z-index: 9996;
    transition: width 0.1s ease;
}