/**
 * Header & Mobile Navigation Styles
 * 
 * قابل للتخصيص والاستخدام في أي صفحة
 * Customizable and reusable for any page
 * 
 * @version 1.0
 * @author KuhlGas Team
 */

/* ===== CSS Variables - متغيرات قابلة للتخصيص ===== */
:root {
    /* Header Configuration */
    --header-height: 70px;
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-bg-scrolled: rgba(255, 255, 255, 0.98);
    --header-border: #e2e8f0;
    --header-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    --header-shadow-scrolled: 0 4px 30px rgba(0, 0, 0, 0.12);
    
    /* Colors */
    --primary: #1e293b;
    --primary-light: #334155;
    --accent: #dc2626;
    --accent-dark: #b91c1c;
    --text: #0f172a;
    --text-muted: #64748b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    
    /* Mobile Navigation */
    --mobile-nav-bg: rgba(255, 255, 255, 0.98);
    --mobile-nav-backdrop: rgba(0, 0, 0, 0.3);
    --mobile-nav-width: 100%;
    --mobile-nav-z-index: 1000;
    
    /* Animations */
    --transition-fast: 0.3s ease;
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== Header Styles ===== */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--header-border);
    z-index: var(--mobile-nav-z-index);
    transition: all var(--transition-fast);
    height: auto;
    min-height: var(--header-height);
    box-sizing: border-box;
    box-shadow: var(--header-shadow);
}

.header.scrolled {
    background: var(--header-bg-scrolled);
    backdrop-filter: blur(25px);
    box-shadow: var(--header-shadow-scrolled);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    min-height: var(--header-height);
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* ===== Logo Styles ===== */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.logo-image {
    border-radius: 6px;
    object-fit: contain;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* ===== Desktop Navigation ===== */
.nav {
    display: flex;
    gap: 1.5rem;
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav a:hover {
    color: var(--primary);
    background: var(--bg);
}

/* ===== Header Actions ===== */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Mobile Menu Button ===== */
.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: calc(var(--mobile-nav-z-index) + 1);
    transition: all var(--transition-fast);
    border-radius: 8px;
    padding: 8px;
}

.mobile-menu-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

.mobile-menu-btn span {
    width: 22px;
    height: 2.5px;
    background: var(--text);
    transition: all var(--transition-smooth);
    display: block;
    transform-origin: center;
    border-radius: 2px;
}

.mobile-menu-btn.active span {
    background: var(--accent);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===== Mobile Navigation Menu ===== */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: var(--mobile-nav-width);
    height: 100vh;
    background: var(--mobile-nav-bg);
    backdrop-filter: blur(25px);
    z-index: var(--mobile-nav-z-index);
    transition: right var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    overflow-y: auto;
}

.mobile-nav.active {
    right: 0;
}

/* Mobile Nav Header */
.mobile-nav-header {
    width: 100%;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.mobile-nav-close {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text);
    font-size: 1.5rem;
    transition: all var(--transition-fast);
}

.mobile-nav-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent);
}

/* Mobile Nav Content */
.mobile-nav-content {
    width: 100%;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.mobile-nav-link {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    text-align: left;
    padding: 1rem 2rem;
    width: 100%;
    position: relative;
    overflow: hidden;
    transform: translateX(50px);
    opacity: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}

.mobile-nav-link:hover {
    background: rgba(248, 250, 252, 0.8);
    color: var(--accent);
    padding-left: 2.5rem;
}

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

.mobile-nav-link:active {
    background: rgba(220, 38, 38, 0.1);
}

/* Animation Classes */
.mobile-nav.active .mobile-nav-link {
    animation: slideInFromRight 0.6s ease forwards;
}

.mobile-nav.active .mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav.active .mobile-nav-link:nth-child(2) { animation-delay: 0.15s; }
.mobile-nav.active .mobile-nav-link:nth-child(3) { animation-delay: 0.2s; }
.mobile-nav.active .mobile-nav-link:nth-child(4) { animation-delay: 0.25s; }
.mobile-nav.active .mobile-nav-link:nth-child(5) { animation-delay: 0.3s; }

.mobile-nav:not(.active) .mobile-nav-link {
    transform: translateX(50px);
    opacity: 0;
    animation: none;
}

@keyframes slideInFromRight {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Nav Actions - Removed as per requirements */
/* All action buttons (login, cart) have been removed from the mobile navigation */

/* Mobile Nav Backdrop */
.mobile-nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--mobile-nav-backdrop);
    z-index: calc(var(--mobile-nav-z-index) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    backdrop-filter: blur(2px);
}

.mobile-nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header {
        min-height: 65px;
    }

    .header-content {
        padding: 0.75rem 16px;
        min-height: 65px;
    }

    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-actions .btn:not(.mobile-menu-btn) {
        display: none;
    }

    .header-actions {
        gap: 4px;
    }

    .logo {
        font-size: 1.1rem;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .brand-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .header {
        min-height: 60px;
    }

    .header-content {
        padding: 0.5rem 12px;
        min-height: 60px;
    }

    .logo {
        font-size: 1rem;
    }

    .logo-icon {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .brand-text {
        font-size: 1rem;
    }

    .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }

    .mobile-menu-btn span {
        width: 20px;
        height: 2px;
    }

    .mobile-nav-header {
        padding: 1rem 1.5rem;
    }

    .mobile-nav-logo {
        font-size: 1rem;
    }

    .mobile-nav-link {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }

    /* Mobile Nav Actions removed as per requirements */

    .mobile-nav-close {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}

@media (min-width: 769px) {
    .mobile-nav,
    .mobile-nav-backdrop {
        display: none !important;
    }
}

/* ===== Utility Classes ===== */
.header-spacer {
    height: var(--header-height);
    width: 100%;
}

.no-scroll {
    overflow: hidden;
}

/* ===== Custom Theme Support ===== */
.header.theme-dark {
    --header-bg: rgba(30, 41, 59, 0.95);
    --header-bg-scrolled: rgba(30, 41, 59, 0.98);
    --text: #f8fafc;
    --text-muted: #cbd5e1;
}

.header.theme-custom {
    /* يمكن تخصيص المتغيرات هنا */
    /* Custom variables can be set here */
}
