/* ========================================
   Header Styles - CaraName
   ======================================== */

.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

/* ========================================
   Animated Logo Styles - WITH C LETTER
   ======================================== */

.header-logo {
    cursor: pointer;
}

.header-logo a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

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

.logo-icon {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #00c389 0%, #00a63f 100%);
}

.logo-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(100deg); /* فقط الدوران الثابت */
    width: 26px;
    height: 26px;
    border: 3px solid white;
    border-radius: 50%;
    border-top-color: transparent;
}





.logo-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
}



.logo-text {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #00c389 0%, #00a63f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    position: relative;
    text-shadow: 0 2px 10px rgba(0, 195, 137, 0.15);
}
/* تنسيق خاص للحرف الأول */
.logo-text::first-letter {
    font-size: 1.15em;
    font-weight: 900;
}
/* ========================================
   Navigation
   ======================================== */

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    margin-left: 40px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #000000;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: #f3f4f6;
    color: #00a63f;
}

.nav-link svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.nav-item.active .nav-link svg {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    padding: 8px;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

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

.dropdown-item {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #00a63f;
}

/* ========================================
   Header Actions
   ======================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.action-link {
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.action-link:hover {
    color: #00a63f;
}

/* ========================================
   Sign In / Account Button Styles
   ======================================== */

.btn-signin {
    position: relative;
    padding: 10px 20px;
    background: transparent;
    border: 2px solid #00a63f;
    color: #00a63f;
    font-weight: 600;
    font-size: 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-signin:hover {
    background: #00a63f;
    color: #fff;
}

/* When logged in - show as circle with icon */
.btn-signin.logged-in {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    background: #00a63f;
    color: white;
    border: 2px solid #00a63f;
    justify-content: center;
}

.btn-signin.logged-in:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 166, 63, 0.3);
}

.btn-signin.logged-in .signin-text {
    display: none;
}

.btn-signin.logged-in .account-icon {
    display: block !important;
}

.account-icon {
    width: 20px;
    height: 20px;
}

.btn-account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #00a63f;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-account:hover {
    background: #008c35;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 166, 63, 0.3);
}

.btn-account svg {
    stroke: currentColor;
    fill: none;
}

.btn-logout {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #dc2626;
    color: white;
}

/* ========================================
   Cart Icon with Animation
   ======================================== */

.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    transition: all 0.2s ease;
    text-decoration: none;
}

.cart-icon:hover {
    background: #e5e7eb;
    transform: scale(1.05);
}

/* Animation when item added to cart */
.cart-icon.cart-bounce {
    animation: cartBounce 0.6s ease;
}

@keyframes cartBounce {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.15) rotate(-5deg);
    }
    50% {
        transform: scale(1.25) rotate(5deg);
    }
    75% {
        transform: scale(1.15) rotate(-3deg);
    }
}

.cart-icon svg {
    width: 20px;
    height: 20px;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

.cart-count.show {
    opacity: 1;
    transform: scale(1);
    animation: countPop 0.4s ease;
}

@keyframes countPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.4);
    }
    100% {
        transform: scale(1);
    }
}

/* ========================================
   Mobile Menu Toggle
   ======================================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: #111827;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ========================================
   Mobile Menu
   ======================================== */

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

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

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-header span {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
}

.mobile-nav {
    padding: 16px 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #f3f4f6;
}

.mobile-nav-link {
    display: block;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-nav-link:hover {
    background: #f9fafb;
}

.mobile-submenu {
    display: none;
    background: #f9fafb;
    padding: 8px 0;
}

.mobile-submenu.active {
    display: block;
}

.mobile-submenu a {
    display: block;
    padding: 12px 24px 12px 44px;
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-submenu a:hover {
    background: #f3f4f6;
    color: #00a63f;
}

.mobile-nav-actions {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
}

.mobile-btn-signin {
    display: block;
    text-align: center;
    padding: 14px 24px;
    background: #00a63f;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.mobile-btn-signin:hover {
    background: #008c35;
}

.mobile-btn-account {
    display: block;
    text-align: center;
    padding: 14px 24px;
    background: #00a63f;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
    margin-bottom: 10px;
}

.mobile-btn-account:hover {
    background: #008c35;
}

.mobile-btn-logout {
    display: block;
    text-align: center;
    padding: 12px 24px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.mobile-btn-logout:hover {
    background: #dc2626;
    color: white;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1024px) {
    .header-nav {
        margin-left: 20px;
        gap: 2px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .header-actions {
        gap: 12px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .logo-inner {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 768px) {
    .header-container {
        height: 64px;
    }
    
    .header-nav {
        display: none;
    }
    
    .action-link {
        display: none;
    }
    
    .btn-signin,
    .btn-account,
    .btn-logout {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .logo-inner {
        width: 22px;
        height: 22px;
    }
    
    .logo-text {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 16px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
    }
    
    .logo-inner {
        width: 20px;
        height: 20px;
    }
    
    .logo-text {
        font-size: 16px;
    }
}
/* Logo Rotation Animation */
@keyframes logoRotateOnce {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
