/* استایل‌های لودینگ */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'Vazirmatn', sans-serif;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazir-Bold.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazir-Medium.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
  }
.loading-content {
    text-align: center;
}

.glowing-logo {
    position: relative;
    margin-bottom: 30px;
}

.logo-orb {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 32px;
    color: white;
    position: relative;
    z-index: 2;
    animation: float 3s ease-in-out infinite;
}

.glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: rgba(106, 13, 173, 0.1);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.animated-text {
    margin-bottom: 30px;
}

.title {
    font-size: 24px;
    color: #2d3748;
    margin-bottom: 10px;
    font-weight: 600;
    animation: textGlow 2s ease-in-out infinite alternate;
}

.subtitle {
    color: #718096;
    font-size: 14px;
}

.dots {
    animation: dots 1.5s steps(4, end) infinite;
}

.magic-spinner {
    display: flex;
    justify-content: center;
}

.spinner-ring {
    width: 50px;
    height: 50px;
    border: 2px solid transparent;
    border-top: 2px solid #6A0DAD;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    position: relative;
}

.spinner-ball {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #ff4081;
    border-radius: 50%;
    animation: ballColor 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes textGlow {
    0% { text-shadow: 0 0 5px rgba(106, 13, 173, 0.3); }
    100% { text-shadow: 0 0 15px rgba(106, 13, 173, 0.5); }
}

@keyframes dots {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ballColor {
    0%, 100% { background: #ff4081; }
    50% { background: #4cc9f0; }
}

.global-loading.fade-out {
    animation: gentleFadeOut 0.6s ease-in-out forwards;
}

@keyframes gentleFadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); visibility: hidden; }
}

/* استایل‌های پیام موفقیت */
.login-success-message {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: slideIn 0.5s ease-out;
}

.success-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-success {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-right: auto;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* استایل‌های هدر */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: #6A0DAD;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #6A0DAD;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* استایل جستجو */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 300px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: none;
    align-items: center;
    padding: 5px;
    margin-top: 10px;
    animation: searchSlideDown 0.3s ease-out;
}

.search-box.active {
    display: flex;
}

@keyframes searchSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-box input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    border-radius: 20px;
    outline: none;
    font-family: 'Vazirmatn', sans-serif;
}

.search-btn {
    background: #6A0DAD;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #5a0b94;
    transform: scale(1.1);
}

.search-loading {
    display: none;
    margin-left: 10px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #6A0DAD;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.header-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #4a5568;
}

.header-icon:hover {
    background: #f7fafc;
    color: #6A0DAD;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4081;
    color: white;
    font-size: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* سبد خرید */
.cart-dropdown {
    position: absolute;
    top: 100%;
    right: -240px;
    width: 320px;
    max-width: calc(100vw - 40px); /* جلوگیری از خروج از صفحه */
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 20px;
    display: none;
    margin-top: 10px;
    z-index: 1001;
}

.cart-dropdown.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cart-dropdown h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 16px;
}

.cart-items {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #6A0DAD;
}

.cart-item .fa-times {
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cart-item .fa-times:hover {
    color: #e53e3e;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #e2e8f0;
    font-weight: 600;
    color: #2d3748;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

.cart-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cart-btn.view {
    background: #f7fafc;
    color: #4a5568;
}

.cart-btn.checkout {
    background: #6A0DAD;
    color: white;
}

.cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* دکمه‌های احراز هویت */
.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-btn {
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.auth-btn.login {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.auth-btn.signup {
    background: #6A0DAD;
    color: white;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* آیکون و دراپ‌داون پروفایل */
.profile-container {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-icon {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #4a5568;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    gap: 2px;
    padding: 0 8px;
}

.profile-icon:hover {
    background: #e6efff;
    color: #6A0DAD;
    border-color: #6A0DAD;
}

.profile-icon.active i.fa-chevron-down {
    transform: rotate(180deg);
}

.profile-icon i.fa-user {
    font-size: 16px;
}

.profile-icon i.fa-chevron-down {
    font-size: 8px;
    transition: transform 0.3s ease;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 180px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    padding: 12px 0;
    display: none;
    margin-top: 8px;
    z-index: 1001;
    font-family: 'Vazirmatn', sans-serif;
}

.profile-dropdown.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.profile-dropdown a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #2d3748;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.profile-dropdown a:hover {
    background: #f1f5f9;
    color: #6A0DAD;
}

/* دکمه ورود در موبایل */
.login-btn-mobile {
    padding: 8px 15px;
    border-radius: 20px;
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-btn-mobile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background: #6A0DAD;
    color: white;
}

/* دکمه همبرگر برای موبایل */
.hamburger-menu {
    display: none;
    flex-direction: column;
    width: 24px;
    height: 18px;
    cursor: pointer;
    gap: 4px;
    z-index: 1002;
}

.hamburger-menu span {
    display: block;
    height: 2px;
    width: 100%;
    background: #4a5568;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* منوی موبایل */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: white;
    z-index: 1000;
    transition: right 0.4s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9fa;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #4a5568;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
}

.mobile-menu-close:hover {
    background: #f1f5f9;
    transform: rotate(90deg);
}

.mobile-menu-content {
    padding: 20px;
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.mobile-nav-menu li {
    margin-bottom: 10px;
}

.mobile-nav-menu a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-nav-menu a:hover {
    background: #f7fafc;
    color: #6A0DAD;
}

.mobile-menu-actions {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-auth-btn {
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-auth-btn:not(:last-child):not(:nth-last-child(2)) {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.mobile-auth-btn:nth-last-child(2) {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.mobile-auth-btn:last-child {
    background: #6A0DAD;
    color: white;
}

.mobile-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* رسپانسیو */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }
    
    .nav-menu,
    .auth-buttons,
    .search-container {
        display: none;
    }
    
    .header-content {
        padding: 10px 0;
    }
    
    .logo-text {
        font-size: 16px;
    }

    .header-actions {
        gap: 10px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-overlay,
    .mobile-menu,
    .login-btn-mobile,
    .hamburger-menu {
        display: none;
    }

    .profile-container {
        display: flex;
    }
}

@media (max-width: 768px) {
    .profile-container,
    .cart-icon {
        display: flex;
    }
}

/* انیمیشن‌های اضافی */
@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}
