/*
Theme Name: Karmone Marketplace
Theme URI: https://karmone.com/marketplace
Author: Karmone Team
Author URI: https://karmone.com
Description: A modern WordPress marketplace theme for e-commerce with vendor capabilities
Version: 1.0.3
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: karmone
Domain Path: /languages
Requires at least: 5.8
Requires PHP: 7.4
Tested up to: 6.3
Tags: e-commerce, two-columns, right-sidebar, custom-background, custom-colors, 
      custom-header, custom-menu, featured-images, full-width-template, 
      threaded-comments, translation-ready, woocommerce, marketplace, vendor
*/

/* ============================================
   CSS Reset & Base Styles (بهبود یافته)
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    scroll-behavior: smooth;
}

/* دسترسی پذیری - کاهش حرکات */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

:root {
    /* Header Height Variable */
    --header-height: 70px;
    --nav-height: 60px;
    
    /* Primary Colors */
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #C8E6C9;
    --primary-rgb: 76, 175, 80;
    
    /* Secondary Colors */
    --secondary-color: #2196F3;
    --secondary-dark: #1976D2;
    --secondary-light: #BBDEFB;
    --secondary-rgb: 33, 150, 243;
    
    /* Accent Colors */
    --accent-color: #FF9800;
    --accent-dark: #F57C00;
    --accent-light: #FFE0B2;
    
    /* Status Colors */
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --info-color: #2196F3;
    
    /* Neutral Colors - بهبود کنتراست */
    --text-color: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    
    --bg-color: #FFFFFF;
    --bg-light: #F9F9F9;
    --bg-dark: #F5F5F5;
    
    --border-color: #E0E0E0;
    --border-light: #EEEEEE;
    --border-dark: #BDBDBD;
    
    /* Typography */
    --font-primary: 'Vazir', Tahoma, Arial, sans-serif;
    --font-heading: var(--font-primary);
    
    /* Spacing با سیستم بهبود یافته */
    --space-2xs: 4px;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 80px;
    
    /* Border Radius */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 15px 25px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index Layers */
    --z-negative: -1;
    --z-elevate: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
    --z-max: 9999;
}

/* ============================================
   فونت‌ها (بهبود یافته با fallback بهتر)
   ============================================ */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/vazir/Vazirmatn-Thin.woff2') format('woff2'),
         url('../fonts/vazir/Vazirmatn-Thin.woff') format('woff');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/vazir/Vazirmatn-ExtraLight.woff2') format('woff2'),
         url('../fonts/vazir/Vazirmatn-ExtraLight.woff') format('woff');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/vazir/Vazirmatn-Light.woff2') format('woff2'),
         url('../fonts/vazir/Vazirmatn-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/vazir/Vazirmatn-Regular.woff2') format('woff2'),
         url('../fonts/vazir/Vazirmatn-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/vazir/Vazirmatn-Medium.woff2') format('woff2'),
         url('../fonts/vazir/Vazirmatn-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/vazir/Vazirmatn-SemiBold.woff2') format('woff2'),
         url('../fonts/vazir/Vazirmatn-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/vazir/Vazirmatn-Bold.woff2') format('woff2'),
         url('../fonts/vazir/Vazirmatn-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/vazir/Vazirmatn-ExtraBold.woff2') format('woff2'),
         url('../fonts/vazir/Vazirmatn-ExtraBold.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/vazir/Vazirmatn-Black.woff2') format('woff2'),
         url('../fonts/vazir/Vazirmatn-Black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Fallback font stack */
@font-face {
    font-family: 'Vazir Fallback';
    src: local('Tahoma');
    size-adjust: 105%;
    ascent-override: 95%;
    descent-override: 25%;
    line-gap-override: 0%;
}

/* ============================================
   Base Element Styles (کاملاً بازنویسی شده)
   ============================================ */
body {
    font-family: var(--font-primary), 'Vazir Fallback', Tahoma, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height); /* استفاده از متغیر CSS */
}

/* بهبود دسترسی - focus styles */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Focus برای عناصر غیر interactive */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

/* بهبود خوانایی متن */
.text-content {
    text-wrap: pretty;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
}

/* Typography بهبود یافته */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading), 'Vazir Fallback', Tahoma, Arial, sans-serif;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--space-md);
    color: var(--text-color);
    text-wrap: balance;
}

h1 { 
    font-size: clamp(2rem, 5vw, 2.8rem); 
    font-weight: 800;
    margin-top: 0;
    line-height: 1.2;
}

h2 { 
    font-size: clamp(1.75rem, 4vw, 2.2rem); 
    font-weight: 700;
    margin-top: 0;
}

h3 { 
    font-size: clamp(1.5rem, 3.5vw, 1.875rem); 
    margin-top: 0;
}

h4 { 
    font-size: clamp(1.25rem, 3vw, 1.5rem); 
    margin-top: 0;
}

h5 { 
    font-size: clamp(1.125rem, 2.5vw, 1.25rem); 
    margin-top: 0;
}

h6 { 
    font-size: clamp(1rem, 2vw, 1.125rem); 
    margin-top: 0;
}

p {
    margin-bottom: var(--space-md);
    line-height: 1.8;
    max-width: 75ch; /* بهبود خوانایی */
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast), background-color var(--transition-fast);
    -webkit-transition: color var(--transition-fast), background-color var(--transition-fast);
}

a:hover,
a:focus-visible {
    color: var(--primary-dark);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

a:active {
    color: var(--primary-dark);
    transform: translateY(1px);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    vertical-align: middle;
    border-style: none;
}

/* Lazy loading برای تصاویر */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Lists بهبود یافته */
ul, ol {
    margin: 0 0 var(--space-md) var(--space-xl);
    padding: 0;
    list-style-position: inside;
}

li {
    margin-bottom: var(--space-xs);
    line-height: 1.6;
}

/* Nested lists */
li > ul,
li > ol {
    margin-top: var(--space-xs);
    margin-bottom: 0;
}

/* Tables بهبود یافته */
table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: var(--space-lg);
    font-size: 0.95rem;
}

th, td {
    padding: var(--space-sm) var(--space-md);
    text-align: right;
    border: 1px solid var(--border-color);
    vertical-align: middle;
}

th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-color);
}

tbody tr:nth-child(even) {
    background-color: var(--bg-light);
}

tbody tr:hover {
    background-color: var(--bg-dark);
}

/* ============================================
   Layout & Container (سیستم Grid بهبود یافته)
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-md);
}

/* Grid System مدرن */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(var(--space-sm) * -1);
}

.col {
    flex: 1 0 0%;
    padding: 0 var(--space-sm);
}

/* Grid Columns */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(1, 1fr);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: var(--space-xl) 0;
    min-height: 60vh; /* حداقل ارتفاع برای محتوا */
}

/* ============================================
   Header Styles (کاملاً بازنویسی شده)
   ============================================ */
.site-header {
    background-color: var(--bg-color);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: var(--z-fixed);
    transition: all var(--transition);
    width: 100%;
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(var(--primary-rgb), 0.02);
}

.site-header.scrolled {
    box-shadow: var(--shadow);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: 0;
    height: var(--header-height);
    flex-wrap: wrap;
}

/* Fallback برای مرورگرهای قدیمی که از gap پشتیبانی نمی‌کنند */
@supports not (gap: var(--space-lg)) {
    .header-container {
        margin: 0 calc(var(--space-lg) / -2);
    }
    
    .header-container > * {
        margin: 0 calc(var(--space-lg) / 2);
    }
}

/* Site Branding بهبود یافته */
.site-branding {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 150px;
    z-index: var(--z-elevate);
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.site-title a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: var(--space-xs) 0;
    gap: var(--space-sm);
}

.site-title a:hover,
.site-title a:focus-visible {
    color: var(--primary-color);
    text-decoration: none;
    outline: none;
}

.site-logo {
    max-height: 40px;
    width: auto;
    height: auto;
}

.site-description {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: var(--space-xs) 0 0 0;
    display: none;
    line-height: 1.4;
}

/* Header Search - کاملاً بازنویسی شده */
.header-search {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    min-width: 200px;
    z-index: var(--z-elevate);
}

.search-form {
    position: relative;
    width: 100%;
}

.search-field {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    transition: all var(--transition);
    background-color: var(--bg-light);
    font-family: var(--font-primary), sans-serif;
    line-height: 1.5;
    color: var(--text-color);
}

.search-field:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
    background-color: var(--bg-color);
}

.search-field::placeholder {
    color: var(--text-lighter);
    opacity: 1;
}

.search-submit {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    transition: all var(--transition);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.search-submit:hover,
.search-submit:focus-visible {
    color: var(--primary-color);
    outline: none;
    background-color: rgba(var(--primary-rgb), 0.1);
    transform: translateY(-50%) scale(1.05);
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Header Actions - بازنویسی شده */
.header-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: var(--space-xs);
}

.header-action-btn {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition);
    border-radius: var(--radius);
    text-decoration: none;
    position: relative;
    white-space: nowrap;
    line-height: 1.5;
    font-family: var(--font-primary), sans-serif;
}

.header-action-btn:hover,
.header-action-btn:focus-visible {
    background-color: var(--bg-dark);
    color: var(--primary-color);
    text-decoration: none;
    outline: none;
    transform: translateY(-1px);
}

.action-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 8px;
}

.action-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.action-count {
    background-color: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
    padding: 0 4px;
    border: 2px solid var(--bg-color);
}

/* User Menu بهبود یافته */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: border-color var(--transition);
    cursor: pointer;
    display: block;
}

.user-avatar:hover,
.user-avatar:focus-visible {
    border-color: var(--primary-color);
    outline: none;
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 200px;
    background-color: var(--bg-color);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
    padding: var(--space-sm) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: var(--z-dropdown);
    border: 1px solid var(--border-color);
}

.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition);
    line-height: 1.5;
    border-right: 3px solid transparent;
}

.user-dropdown a:hover,
.user-dropdown a:focus-visible {
    background-color: var(--bg-light);
    color: var(--primary-color);
    border-right-color: var(--primary-color);
    padding-right: 25px;
}

/* ============================================
   Navigation (کاملاً بازنویسی شده)
   ============================================ */
.main-navigation {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    position: sticky;
    top: var(--header-height);
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-xs);
}

.navigation-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--nav-height);
}

.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.primary-menu > li {
    position: relative;
}

.primary-menu > li > a {
    display: block;
    padding: calc(var(--space-md) - 4px) var(--space-lg);
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
    line-height: 1.5;
    border-radius: var(--radius);
}

.primary-menu > li > a:hover,
.primary-menu > li > a:focus-visible,
.primary-menu > li.current-menu-item > a,
.primary-menu > li.current-menu-parent > a {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.05);
    outline: none;
}

.primary-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: all var(--transition);
    transform: translateX(50%);
    border-radius: var(--radius-xs);
}

.primary-menu > li > a:hover::after,
.primary-menu > li > a:focus-visible::after,
.primary-menu > li.current-menu-item > a::after,
.primary-menu > li.current-menu-parent > a::after {
    width: 80%;
}

/* Submenu - کاملاً بازنویسی شده */
.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 220px;
    background-color: var(--bg-color);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
    padding: var(--space-sm) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: var(--z-dropdown);
    border: 1px solid var(--border-color);
}

.primary-menu li:focus-within > .sub-menu,
.primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu .sub-menu li {
    margin: 0;
}

.primary-menu .sub-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
    padding-right: 40px;
    line-height: 1.5;
    border-right: 3px solid transparent;
}

.primary-menu .sub-menu a::before {
    content: '←';
    position: absolute;
    right: 16px;
    opacity: 0.5;
    transition: all var(--transition);
    font-family: var(--font-primary), sans-serif;
}

.primary-menu .sub-menu a:hover,
.primary-menu .sub-menu a:focus-visible {
    background-color: var(--bg-light);
    color: var(--primary-color);
    padding-right: 45px;
    border-right-color: var(--primary-color);
}

.primary-menu .sub-menu a:hover::before,
.primary-menu .sub-menu a:focus-visible::before {
    opacity: 1;
    right: 12px;
}

/* Mega Menu Support */
.mega-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    width: 100%;
    max-width: 1200px;
    background-color: var(--bg-color);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: var(--z-dropdown);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    border: 1px solid var(--border-color);
}

.primary-menu > .menu-item-has-mega-menu:hover > .mega-menu,
.primary-menu > .menu-item-has-mega-menu:focus-within > .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-column h4 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    color: var(--text-color);
    border-bottom: 2px solid var(--border-light);
    padding-bottom: var(--space-xs);
}

.mega-menu-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-column li {
    margin-bottom: var(--space-xs);
}

.mega-menu-column a {
    color: var(--text-light);
    text-decoration: none;
    transition: all var(--transition);
    display: block;
    padding: 8px 0;
    border-right: 3px solid transparent;
}

.mega-menu-column a:hover,
.mega-menu-column a:focus-visible {
    color: var(--primary-color);
    padding-right: 8px;
    border-right-color: var(--primary-color);
}

/* ============================================
   Mobile Navigation (کاملاً بازنویسی شده)
   ============================================ */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--text-color);
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    transition: all var(--transition);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: var(--z-modal);
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
    background-color: var(--bg-dark);
    outline: none;
    color: var(--primary-color);
}

.toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: currentColor;
    position: relative;
    transition: var(--transition);
}

.toggle-icon::before,
.toggle-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    right: 0;
    transition: var(--transition);
}

.toggle-icon::before {
    top: -6px;
}

.toggle-icon::after {
    bottom: -6px;
}

.mobile-menu-toggle.active .toggle-icon {
    background-color: transparent;
}

.mobile-menu-toggle.active .toggle-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-toggle.active .toggle-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

.mobile-navigation {
    position: fixed;
    top: 0;
    right: -100%;
    left: auto;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background-color: var(--bg-color);
    box-shadow: var(--shadow-xl);
    transition: right var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-modal);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.mobile-navigation.active {
    right: 0;
}

.mobile-navigation-overlay {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: var(--z-modal-backdrop);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mobile-navigation-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-navigation-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 1;
    flex-shrink: 0;
    min-height: var(--header-height);
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: var(--space-xs);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all var(--transition);
    line-height: 1;
}

.mobile-menu-close:hover,
.mobile-menu-close:focus-visible {
    background-color: var(--bg-light);
    outline: none;
    color: var(--primary-color);
}

.mobile-menu {
    list-style: none;
    padding: var(--space-md);
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.mobile-menu > li {
    margin-bottom: var(--space-xs);
}

.mobile-menu > li > a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    line-height: 1.5;
    position: relative;
}

.mobile-menu > li > a:hover,
.mobile-menu > li > a:focus-visible {
    background-color: var(--bg-light);
    color: var(--primary-color);
    outline: none;
    padding-right: var(--space-lg);
}

.mobile-submenu-toggle {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    transition: all var(--transition);
    border-radius: var(--radius);
}

.mobile-submenu-toggle:hover,
.mobile-submenu-toggle:focus-visible {
    color: var(--primary-color);
    outline: none;
    background-color: var(--bg-light);
}

.mobile-submenu-toggle::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 400;
    transition: transform var(--transition);
}

.mobile-submenu-toggle.active::after {
    content: '−';
    transform: rotate(180deg);
}

.mobile-menu .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition) cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-light);
    border-radius: var(--radius);
}

.mobile-menu .sub-menu.active {
    max-height: 500px;
    margin-top: var(--space-xs);
}

.mobile-menu .sub-menu li a {
    padding: var(--space-sm) var(--space-xl);
    color: var(--text-light);
    border-bottom: none;
}

.mobile-menu .sub-menu li a:hover,
.mobile-menu .sub-menu li a:focus-visible {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

/* Mobile Search */
.mobile-search {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    display: none;
}

.mobile-search .search-form {
    width: 100%;
}

/* ============================================
   Hero Slider (کاملاً بازنویسی شده)
   ============================================ */
.hero-slider-section {
    padding: var(--space-3xl) 0;
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.hero-slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    background-color: var(--bg-color);
}

.slides-container {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity var(--transition-slow);
    animation: none;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide-content {
    display: flex;
    align-items: center;
    height: 100%;
    padding: var(--space-2xl);
    position: relative;
    z-index: 2;
}

.text-content {
    flex: 1;
    min-width: 0;
    padding-left: var(--space-xl);
    position: relative;
    z-index: 3;
}

.slide-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin-bottom: var(--space-md);
    line-height: 1.2;
    color: var(--text-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slide-description {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-light);
    margin-bottom: var(--space-xl);
    line-height: 1.6;
    max-width: 90%;
}

.image-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 2;
}

.slide-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.slide-image:hover {
    transform: scale(1.02);
}

.slider-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: var(--space-xl);
    gap: var(--space-md);
}

.slider-prev,
.slider-next {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

.slider-prev:hover,
.slider-next:hover,
.slider-prev:focus-visible,
.slider-next:focus-visible {
    background-color: var(--primary-dark);
    transform: scale(1.1);
    outline: none;
    box-shadow: var(--shadow);
}

.slider-dots {
    display: flex;
    gap: var(--space-xs);
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--border-color);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.slider-dot:hover,
.slider-dot:focus-visible {
    background-color: var(--border-dark);
    outline: none;
    transform: scale(1.2);
}

.slider-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.3);
}

/* Slide Indicators */
.slide-indicators {
    position: absolute;
    bottom: var(--space-lg);
    right: 50%;
    transform: translateX(50%);
    display: flex;
    z-index: 3;
    gap: var(--space-xs);
}

.slide-indicator {
    width: 40px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    border-radius: 2px;
}

.slide-indicator:hover,
.slide-indicator:focus-visible {
    background-color: rgba(255, 255, 255, 0.8);
    outline: none;
}

.slide-indicator.active {
    background-color: white;
    width: 60px;
}

/* ============================================
   Products & Carousel (کاملاً بازنویسی شده)
   ============================================ */
.featured-products-section {
    padding: var(--space-3xl) 0;
    background-color: var(--bg-light);
    position: relative;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.2rem);
    margin: 0;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-light);
    margin: var(--space-sm) 0 0 0;
    max-width: 600px;
    width: 100%;
    font-size: 1.1rem;
    line-height: 1.6;
}

.view-all-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition);
    padding: var(--space-sm);
    border-radius: var(--radius);
    white-space: nowrap;
    border: 2px solid transparent;
}

.view-all-link:hover,
.view-all-link:focus-visible {
    color: var(--primary-dark);
    background-color: var(--bg-light);
    outline: none;
    padding-right: 20px;
    border-color: var(--primary-light);
}

.view-all-link::after {
    content: '←';
    margin-right: 8px;
    font-size: 1.2rem;
    transition: transform var(--transition);
}

.view-all-link:hover::after,
.view-all-link:focus-visible::after {
    transform: translateX(-5px);
}

.products-carousel {
    position: relative;
    padding: 0 var(--space-xl);
}

.carousel-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: var(--space-sm) 0 var(--space-lg) 0;
    gap: var(--space-lg);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.carousel-container::-webkit-scrollbar {
    height: 6px;
}

.carousel-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.carousel-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.carousel-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-dark);
}

.product-card {
    flex: 0 0 calc(100% - 24px);
    scroll-snap-align: start;
    background-color: var(--bg-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.product-image {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-light);
    aspect-ratio: 1/1;
    width: 100%;
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 1/1) {
    .product-image {
        position: relative;
        padding-bottom: 100%;
        height: 0;
    }
    
    .product-image::before {
        content: '';
        display: block;
        padding-top: 100%;
    }
    
    .product-thumbnail {
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.product-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
    display: block;
}

.product-card:hover .product-thumbnail {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background-color: var(--danger-color);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 2;
    line-height: 1;
}

.product-badge.sale {
    background-color: var(--danger-color);
}

.product-badge.new {
    background-color: var(--success-color);
}

.product-badge.featured {
    background-color: var(--accent-color);
}

.product-actions {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(-10px);
    transition: all var(--transition);
    z-index: 2;
    gap: 8px;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.product-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.product-action-btn:hover,
.product-action-btn:focus-visible {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
    outline: none;
}

.product-info {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.product-title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.4;
    min-height: 3em;
}

.product-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition);
    display: block;
}

.product-title a:hover,
.product-title a:focus-visible {
    color: var(--primary-color);
    text-decoration: none;
    outline: none;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.stars {
    color: var(--accent-color);
    font-size: 0.9rem;
    display: flex;
    gap: 1px;
}

.rating-count {
    font-size: 0.85rem;
    color: var(--text-light);
}

.product-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.current-price {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
}

.original-price {
    color: var(--text-lighter);
    font-size: 1rem;
    text-decoration: line-through;
}

.discount-percentage {
    color: var(--danger-color);
    font-size: 0.9rem;
    font-weight: 600;
    background-color: rgba(var(--primary-rgb), 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.add-to-cart-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    line-height: 1.5;
    font-family: var(--font-primary), sans-serif;
}

.add-to-cart-btn:hover,
.add-to-cart-btn:focus-visible {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    outline: none;
}

.add-to-cart-btn.added {
    background-color: var(--success-color);
}

.add-to-cart-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--bg-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 2;
    transition: all var(--transition);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.carousel-nav:hover,
.carousel-nav:focus-visible {
    background-color: var(--primary-color);
    color: white;
    outline: none;
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    right: -24px;
}

.carousel-next {
    left: -24px;
}

.carousel-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   Sponsors Section (کاملاً بازنویسی شده)
   ============================================ */
.sponsors-section {
    padding: var(--space-2xl) 0;
    overflow: hidden;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.sponsors-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.sponsors-header h2 {
    font-size: clamp(1.75rem, 4vw, 2rem);
    margin-bottom: var(--space-sm);
}

.sponsors-header p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

.sponsors-slider {
    position: relative;
    overflow: hidden;
    padding: var(--space-lg) 0;
}

.sponsors-track {
    display: flex;
    animation: slideSponsors 30s linear infinite;
    padding: 0 var(--space-md);
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .sponsors-track {
        animation: none;
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--space-lg);
    }
}

@keyframes slideSponsors {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.sponsors-slider:hover .sponsors-track {
    animation-play-state: paused;
}

.sponsor-item {
    flex: 0 0 250px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all var(--transition);
    padding: var(--space-lg);
    border-radius: var(--radius);
    background-color: var(--bg-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    margin: 0 var(--space-md);
    border: 1px solid var(--border-light);
}

.sponsor-item:hover,
.sponsor-item:focus-visible {
    background-color: var(--bg-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    outline: none;
    border-color: var(--primary-light);
}

.sponsor-logo {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.sponsor-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all var(--transition);
}

.sponsor-item:hover .sponsor-logo img,
.sponsor-item:focus-visible .sponsor-logo img {
    filter: grayscale(0%);
    opacity: 1;
}

.sponsor-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
}

.sponsor-category {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: var(--space-xs);
}

/* ============================================
   CTA Section (کاملاً بازنویسی شده)
   ============================================ */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--space-3xl) 0;
    text-align: center;
    margin: var(--space-2xl) 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    isolation: isolate;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    z-index: -1;
}

.cta-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: var(--space-md);
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cta-content p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-bottom: var(--space-xl);
    opacity: 0.9;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.cta-section .btn-primary {
    background-color: white;
    color: var(--primary-color);
    border: none;
}

.cta-section .btn-primary:hover,
.cta-section .btn-primary:focus-visible {
    background-color: var(--bg-light);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.cta-section .btn-secondary {
    color: white;
    border-color: white;
    background-color: transparent;
}

.cta-section .btn-secondary:hover,
.cta-section .btn-secondary:focus-visible {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.cta-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2xl);
    margin-top: var(--space-2xl);
}

.cta-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 200px;
}

.cta-feature-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
    transition: transform var(--transition);
}

.cta-feature:hover .cta-feature-icon {
    transform: scale(1.1);
}

.cta-feature-text {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* ============================================
   Buttons (کاملاً بازنویسی شده)
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    position: relative;
    overflow: hidden;
    font-family: var(--font-primary), sans-serif;
    gap: 8px;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus-visible::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-outline:hover,
.btn-outline:focus-visible {
    background-color: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.btn-danger:hover,
.btn-danger:focus-visible {
    background-color: #d32f2f;
    border-color: #d32f2f;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.btn-success:hover,
.btn-success:focus-visible {
    background-color: #388e3c;
    border-color: #388e3c;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.btn-warning:hover,
.btn-warning:focus-visible {
    background-color: #f57c00;
    border-color: #f57c00;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-icon {
    padding: 10px;
    width: 44px;
    height: 44px;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-spinner 0.75s linear infinite;
}

@keyframes button-spinner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Forms (کاملاً بازنویسی شده)
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: all var(--transition);
    font-family: var(--font-primary), sans-serif;
}

.form-control:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.form-control::placeholder {
    color: var(--text-lighter);
    opacity: 1;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--bg-light);
    opacity: 0.7;
    cursor: not-allowed;
}

.form-text {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.875rem;
    color: var(--text-light);
}

.form-check {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
    gap: var(--space-xs);
}

.form-check-input {
    margin-top: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.form-check-label {
    font-size: 0.95rem;
    line-height: 1.4;
    cursor: pointer;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 16px 12px;
    padding-left: 40px;
}

.form-select:focus-visible {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234CAF50' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

.form-file {
    position: relative;
    display: inline-block;
    width: 100%;
}

.form-file-input {
    position: relative;
    z-index: 2;
    width: 100%;
    height: calc(1.5em + 24px);
    margin: 0;
    opacity: 0;
}

.form-file-label {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
}

.form-file-input:focus-visible ~ .form-file-label {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

/* Validation States */
.form-control.is-valid {
    border-color: var(--success-color);
    padding-left: calc(16px + 30px);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%234CAF50' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    padding-left: calc(16px + 30px);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23F44336'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23F44336' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: var(--space-xs);
    font-size: 0.875rem;
    color: var(--danger-color);
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

.valid-feedback {
    display: none;
    width: 100%;
    margin-top: var(--space-xs);
    font-size: 0.875rem;
    color: var(--success-color);
}

.is-valid ~ .valid-feedback {
    display: block;
}

/* ============================================
   Footer (کاملاً بازنویسی شده)
   ============================================ */
.site-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    font-family: var(--font-primary), sans-serif;
    width: 100%;
    margin-top: auto;
    isolation: isolate;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #00b894, #fd79a8, #fdcb6e);
    z-index: 1;
}

/* Footer Grid System */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-2xl);
    padding: var(--space-3xl) 0 var(--space-xl);
}

/* Footer Widgets */
.footer-widget {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .footer-widget {
        animation: none;
        opacity: 1;
    }
}

.footer-widget:nth-child(1) { animation-delay: 0.1s; }
.footer-widget:nth-child(2) { animation-delay: 0.2s; }
.footer-widget:nth-child(3) { animation-delay: 0.3s; }
.footer-widget:nth-child(4) { animation-delay: 0.4s; }

.widget-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 3px;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget li {
    margin-bottom: 10px;
    position: relative;
    padding-right: 15px;
    transition: all 0.3s ease;
}

.footer-widget li::before {
    content: '›';
    position: absolute;
    right: 0;
    color: var(--secondary-color);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.footer-widget li:hover::before {
    transform: translateX(5px);
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 2px 0;
}

.footer-widget a:hover,
.footer-widget a:focus-visible {
    color: #fff;
    transform: translateX(-5px);
    outline: none;
}

/* Footer Main Content */
.footer-main {
    padding: var(--space-2xl) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Footer Logo */
.footer-logo {
    margin-bottom: 20px;
}

.footer-logo a {
    display: inline-block;
    text-decoration: none;
}

.footer-logo img {
    max-height: 60px;
    width: auto;
}

.footer-logo .site-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(90deg, var(--secondary-color), #00b894);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

/* Footer Contact */
.footer-contact {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    gap: var(--space-sm);
}

.contact-icon {
    flex-shrink: 0;
    color: var(--secondary-color);
    margin-top: 2px;
}

.contact-item a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover,
.contact-item a:focus-visible {
    color: #fff;
    outline: none;
}

/* Categories */
.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 5px;
}

.category-link:hover,
.category-link:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(-5px);
    outline: none;
}

.category-name {
    flex-grow: 1;
}

.category-count {
    background: rgba(33, 150, 243, 0.2);
    color: var(--secondary-color);
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Newsletter */
.newsletter-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.newsletter-form {
    position: relative;
}

.newsletter-form .form-group {
    display: flex;
    margin-bottom: 15px;
    gap: var(--space-sm);
}

.newsletter-email {
    flex-grow: 1;
    padding: 12px 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: var(--font-primary), sans-serif;
}

.newsletter-email:focus-visible {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.1);
}

.newsletter-email::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.subscribe-btn {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #00b894 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.subscribe-btn:hover,
.subscribe-btn:focus-visible {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
    outline: none;
}

/* Footer Bottom */
.footer-bottom {
    padding: var(--space-xl) 0;
    background: rgba(0, 0, 0, 0.2);
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    flex: 1;
    min-width: 200px;
}

.footer-copyright a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-copyright a:hover,
.footer-copyright a:focus-visible {
    color: #00b894;
    text-decoration: underline;
    outline: none;
}

.footer-payment {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.payment-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.payment-methods {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.payment-method {
    background: white;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 25px;
    transition: transform 0.3s ease;
}

.payment-method:hover {
    transform: translateY(-2px);
}

.footer-social {
    text-align: left;
    flex: 1;
    min-width: 200px;
}

.social-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.social-links {
    display: flex;
    gap: var(--space-sm);
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: currentColor;
    opacity: 0.2;
}

.social-link.telegram { color: #0088cc; }
.social-link.instagram { 
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    color: white;
}
.social-link.whatsapp { color: #25D366; }
.social-link.youtube { color: #ff0000; }
.social-link.twitter { color: #1da1f2; }
.social-link.linkedin { color: #0077b5; }

.social-link:hover,
.social-link:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    outline: none;
}

.social-link svg {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
}

/* ============================================
   Back to Top Button (بهبود یافته)
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #00b894 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: var(--z-toast);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 20px rgba(0, 123, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.4);
    outline: none;
    background: linear-gradient(135deg, #00b894 0%, var(--secondary-color) 100%);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ============================================
   Mobile Bottom Navigation (بهبود یافته)
   ============================================ */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    z-index: var(--z-fixed);
    border-radius: 20px 20px 0 0;
    display: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 10px;
    position: relative;
    flex: 1;
    max-width: 80px;
}

.nav-item.active {
    color: var(--secondary-color);
    background: rgba(0, 123, 255, 0.1);
}

.nav-item:hover,
.nav-item:focus-visible {
    color: var(--secondary-color);
    transform: translateY(-2px);
    outline: none;
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    fill: currentColor;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

.cart-count {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    padding: var(--space-md) 0;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-xl);
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    gap: var(--space-xs);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '←';
    color: var(--text-lighter);
    margin-right: 8px;
}

.breadcrumb-item a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb-item a:hover,
.breadcrumb-item a:focus-visible {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 500;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: var(--space-xl) 0;
    gap: var(--space-xs);
}

.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background-color: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid var(--border-color);
}

.page-numbers:hover,
.page-numbers:focus-visible,
.page-numbers.current {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    outline: none;
}

.page-numbers.dots {
    background-color: transparent;
    border: none;
    cursor: default;
}

.page-numbers.dots:hover,
.page-numbers.dots:focus-visible {
    background-color: transparent;
    color: var(--text-color);
}

/* ============================================
   Animations (کاملاً بازنویسی شده)
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

@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;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Utility Classes (کاملاً بازنویسی شده)
   ============================================ */
/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-table { display: table !important; }
.d-table-row { display: table-row !important; }
.d-table-cell { display: table-cell !important; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-col { flex-direction: column; }
.flex-col-reverse { flex-direction: column-reverse; }

.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-wrap-reverse { flex-wrap: wrap-reverse; }

.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }

/* Gap */
.gap-0 { gap: 0; }
.gap-1 { gap: var(--space-xs); }
.gap-2 { gap: var(--space-sm); }
.gap-3 { gap: var(--space-md); }
.gap-4 { gap: var(--space-lg); }
.gap-5 { gap: var(--space-xl); }

/* Grid Columns */
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-justify { text-align: justify; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* Spacing */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mr-0 { margin-right: 0; }
.mb-0 { margin-bottom: 0; }
.ml-0 { margin-left: 0; }

.m-1 { margin: var(--space-xs); }
.mt-1 { margin-top: var(--space-xs); }
.mr-1 { margin-right: var(--space-xs); }
.mb-1 { margin-bottom: var(--space-xs); }
.ml-1 { margin-left: var(--space-xs); }

.m-2 { margin: var(--space-sm); }
.mt-2 { margin-top: var(--space-sm); }
.mr-2 { margin-right: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-sm); }
.ml-2 { margin-left: var(--space-sm); }

.m-3 { margin: var(--space-md); }
.mt-3 { margin-top: var(--space-md); }
.mr-3 { margin-right: var(--space-md); }
.mb-3 { margin-bottom: var(--space-md); }
.ml-3 { margin-left: var(--space-md); }

.m-4 { margin: var(--space-lg); }
.mt-4 { margin-top: var(--space-lg); }
.mr-4 { margin-right: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-lg); }
.ml-4 { margin-left: var(--space-lg); }

.m-5 { margin: var(--space-xl); }
.mt-5 { margin-top: var(--space-xl); }
.mr-5 { margin-right: var(--space-xl); }
.mb-5 { margin-bottom: var(--space-xl); }
.ml-5 { margin-left: var(--space-xl); }

.p-0 { padding: 0; }
.pt-0 { padding-top: 0; }
.pr-0 { padding-right: 0; }
.pb-0 { padding-bottom: 0; }
.pl-0 { padding-left: 0; }

.p-1 { padding: var(--space-xs); }
.pt-1 { padding-top: var(--space-xs); }
.pr-1 { padding-right: var(--space-xs); }
.pb-1 { padding-bottom: var(--space-xs); }
.pl-1 { padding-left: var(--space-xs); }

.p-2 { padding: var(--space-sm); }
.pt-2 { padding-top: var(--space-sm); }
.pr-2 { padding-right: var(--space-sm); }
.pb-2 { padding-bottom: var(--space-sm); }
.pl-2 { padding-left: var(--space-sm); }

.p-3 { padding: var(--space-md); }
.pt-3 { padding-top: var(--space-md); }
.pr-3 { padding-right: var(--space-md); }
.pb-3 { padding-bottom: var(--space-md); }
.pl-3 { padding-left: var(--space-md); }

.p-4 { padding: var(--space-lg); }
.pt-4 { padding-top: var(--space-lg); }
.pr-4 { padding-right: var(--space-lg); }
.pb-4 { padding-bottom: var(--space-lg); }
.pl-4 { padding-left: var(--space-lg); }

.p-5 { padding: var(--space-xl); }
.pt-5 { padding-top: var(--space-xl); }
.pr-5 { padding-right: var(--space-xl); }
.pb-5 { padding-bottom: var(--space-xl); }
.pl-5 { padding-left: var(--space-xl); }

/* ============================================
   Responsive Design (کاملاً بازنویسی شده)
   ============================================ */

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    :root {
        --header-height: 60px;
        --space-3xl: 48px;
        --space-2xl: 32px;
        --space-xl: 24px;
    }
    
    .container {
        padding: 0 var(--space-sm);
    }
    
    .site-header {
        min-height: var(--header-height);
    }
    
    .header-container {
        gap: var(--space-sm);
        padding: var(--space-xs) 0;
    }
    
    .site-branding {
        min-width: auto;
        flex: 1;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    .header-search {
        order: 3;
        max-width: 100%;
        margin: var(--space-sm) 0 0 0;
        width: 100%;
        display: none;
    }
    
    .mobile-search {
        display: block;
    }
    
    .header-actions {
        gap: var(--space-xs);
    }
    
    .header-action-btn .action-label {
        display: none;
    }
    
    .header-action-btn {
        padding: 8px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .primary-menu {
        display: none;
    }
    
    .main-navigation {
        display: none;
    }
    
    .hero-slider-section {
        padding: var(--space-xl) 0;
    }
    
    .slides-container {
        height: 400px;
    }
    
    .slide-content {
        flex-direction: column;
        text-align: center;
        padding: var(--space-lg);
        gap: var(--space-lg);
    }
    
    .text-content {
        padding-left: 0;
        margin-bottom: 0;
    }
    
    .slide-title {
        font-size: 1.75rem;
        margin-bottom: var(--space-sm);
    }
    
    .slide-description {
        font-size: 1rem;
        max-width: 100%;
        margin-bottom: var(--space-lg);
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        text-align: center;
    }
    
    .view-all-link {
        margin-top: var(--space-sm);
    }
    
    .product-card {
        flex: 0 0 calc(100% - 16px);
    }
    
    .products-carousel {
        padding: 0 var(--space-sm);
    }
    
    .carousel-nav {
        display: none;
    }
    
    .sponsor-item {
        flex: 0 0 180px;
        margin: 0 var(--space-sm);
        padding: var(--space-md);
        height: 120px;
    }
    
    .cta-section {
        margin: var(--space-xl) 0;
        padding: var(--space-xl) var(--space-md);
        border-radius: var(--radius-lg);
    }
    
    .cta-content h2 {
        font-size: 1.75rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .cta-features {
        gap: var(--space-lg);
        margin-top: var(--space-xl);
    }
    
    .cta-feature {
        max-width: 150px;
    }
    
    .footer-grid {
        gap: var(--space-xl);
        padding: var(--space-xl) 0 var(--space-lg);
    }
    
    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: var(--space-lg);
    }
    
    .footer-social {
        text-align: center;
    }
    
    .mobile-bottom-nav {
        display: flex;
    }
    
    .back-to-top {
        left: 20px;
        bottom: 90px;
        width: 45px;
        height: 45px;
    }
    
    /* Utility Classes for Mobile */
    .xs\:d-none { display: none !important; }
    .xs\:d-block { display: block !important; }
    .xs\:d-flex { display: flex !important; }
    .xs\:d-grid { display: grid !important; }
    
    .xs\:flex-col { flex-direction: column; }
    .xs\:flex-row { flex-direction: row; }
    
    .xs\:text-center { text-align: center; }
    .xs\:text-right { text-align: right; }
    .xs\:text-left { text-align: left; }
    
    .xs\:gap-1 { gap: var(--space-xs); }
    .xs\:gap-2 { gap: var(--space-sm); }
    .xs\:gap-3 { gap: var(--space-md); }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .product-card {
        flex: 0 0 calc(50% - 12px);
    }
    
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sponsor-item {
        flex: 0 0 200px;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Utility Classes for Small */
    .sm\:d-none { display: none !important; }
    .sm\:d-block { display: block !important; }
    .sm\:d-flex { display: flex !important; }
    .sm\:d-grid { display: grid !important; }
    
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    
    .sm\:gap-2 { gap: var(--space-sm); }
    .sm\:gap-3 { gap: var(--space-md); }
    .sm\:gap-4 { gap: var(--space-lg); }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .header-search {
        display: block;
        order: 0;
        margin: 0;
    }
    
    .mobile-search {
        display: none;
    }
    
    .header-action-btn .action-label {
        display: inline;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
    
    .primary-menu {
        display: flex;
    }
    
    .main-navigation {
        display: block;
    }
    
    .slide-content {
        min-height: 450px;
    }
    
    .slide-title {
        font-size: 2.25rem;
    }
    
    .product-card {
        flex: 0 0 calc(33.333% - 16px);
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .carousel-nav {
        display: flex;
    }
    
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Utility Classes for Medium */
    .md\:d-none { display: none !important; }
    .md\:d-block { display: block !important; }
    .md\:d-flex { display: flex !important; }
    .md\:d-grid { display: grid !important; }
    
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    
    .md\:flex-row { flex-direction: row; }
    .md\:flex-col { flex-direction: column; }
    
    .md\:gap-3 { gap: var(--space-md); }
    .md\:gap-4 { gap: var(--space-lg); }
    .md\:gap-5 { gap: var(--space-xl); }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    :root {
        --header-height: 70px;
    }
    
    .container {
        max-width: 960px;
    }
    
    .site-description {
        display: block;
    }
    
    .slide-content {
        min-height: 500px;
        padding: var(--space-2xl);
    }
    
    .slide-title {
        font-size: 2.5rem;
    }
    
    .product-card {
        flex: 0 0 calc(25% - 18px);
    }
    
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .mobile-bottom-nav {
        display: none;
    }
    
    /* Utility Classes for Large */
    .lg\:d-none { display: none !important; }
    .lg\:d-block { display: block !important; }
    .lg\:d-flex { display: flex !important; }
    .lg\:d-grid { display: grid !important; }
    
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
    
    .lg\:gap-4 { gap: var(--space-lg); }
    .lg\:gap-5 { gap: var(--space-xl); }
    .lg\:gap-6 { gap: var(--space-2xl); }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .product-card {
        flex: 0 0 calc(20% - 19.2px);
    }
    
    /* Utility Classes for XL */
    .xl\:d-none { display: none !important; }
    .xl\:d-block { display: block !important; }
    .xl\:d-flex { display: flex !important; }
    .xl\:d-grid { display: grid !important; }
    
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
    .xl\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

/* Extra extra large devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Utility Classes for 2XL */
    .\32xl\:d-none { display: none !important; }
    .\32xl\:d-block { display: block !important; }
    .\32xl\:d-flex { display: flex !important; }
    .\32xl\:d-grid { display: grid !important; }
}

/* ============================================
   Dark Mode (بهبود یافته)
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e0e0e0;
        --text-light: #b0b0b0;
        --text-lighter: #808080;
        
        --bg-color: #1a1a1a;
        --bg-light: #2d2d2d;
        --bg-dark: #333333;
        
        --border-color: #404040;
        --border-light: #4d4d4d;
        --border-dark: #666666;
        
        --primary-color: #4CAF50;
        --primary-dark: #388E3C;
        --primary-light: #1b5e20;
        
        --secondary-color: #2196F3;
        --secondary-dark: #1976D2;
        --secondary-light: #0d47a1;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .site-header {
        background-color: rgba(26, 26, 26, 0.95);
        border-bottom-color: var(--border-color);
    }
    
    .site-header.scrolled {
        background-color: rgba(26, 26, 26, 0.98);
    }
    
    .main-navigation {
        background-color: var(--bg-dark);
        border-top-color: var(--border-color);
    }
    
    .site-footer {
        background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    }
    
    .product-card {
        background-color: var(--bg-color);
        border-color: var(--border-color);
    }
    
    .sponsor-item {
        background-color: var(--bg-color);
        border-color: var(--border-color);
    }
    
    .cta-section {
        background: linear-gradient(135deg, #2d672d 0%, #1e4c1e 100%);
    }
    
    .search-field {
        background-color: var(--bg-dark);
        color: var(--text-color);
        border-color: var(--border-color);
    }
    
    .search-field:focus-visible {
        background-color: var(--bg-color);
    }
    
    .header-action-btn:hover,
    .header-action-btn:focus-visible {
        background-color: var(--bg-dark);
    }
    
    .btn-secondary {
        background-color: transparent;
    }
    
    .btn-secondary:hover,
    .btn-secondary:focus-visible {
        background-color: var(--primary-light);
    }
    
    .mobile-bottom-nav {
        background-color: rgba(26, 26, 26, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .nav-item {
        color: var(--text-light);
    }
    
    .nav-item.active {
        color: var(--secondary-color);
        background: rgba(33, 150, 243, 0.1);
    }
}

/* ============================================
   High Contrast Mode
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #006400;
        --primary-dark: #004d00;
        --secondary-color: #00008b;
        --secondary-dark: #000064;
        --text-color: #000000;
        --border-color: #000000;
    }
    
    .site-header {
        border-bottom: 3px solid var(--border-color);
    }
    
    .btn {
        border: 3px solid currentColor;
    }
    
    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline: 3px solid #000000;
        outline-offset: 3px;
    }
    
    .primary-menu > li > a::after {
        height: 4px;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-slider,
    .sponsors-track,
    .product-card,
    .btn,
    .slide,
    .mobile-navigation {
        animation: none !important;
        transition: none !important;
    }
    
    .slide {
        transition: opacity 0.1s ease !important;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .site-header,
    .main-navigation,
    .mobile-navigation,
    .hero-slider,
    .slider-nav,
    .carousel-nav,
    .sponsors-section,
    .cta-section,
    .btn,
    .mobile-bottom-nav,
    .back-to-top,
    .footer-social,
    .footer-payment {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff !important;
        direction: ltr;
        text-align: left;
        padding-top: 0 !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
    }
    
    .site-footer {
        background: none !important;
        color: #000 !important;
        border-top: 2px solid #000;
    }
    
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
        color: #000 !important;
    }
    
    p {
        orphans: 3;
        widows: 3;
    }
    
    table {
        page-break-inside: avoid;
    }
    
    .main-content {
        padding: 0 !important;
    }
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* ============================================
   Skip to Content (دسترسی)
   ============================================ */
.skip-to-content {
    position: absolute;
    top: -40px;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: var(--space-sm) var(--space-md);
    text-decoration: none;
    z-index: var(--z-tooltip);
    transition: top 0.3s ease;
    border-radius: 0 0 var(--radius) var(--radius);
}

.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--primary-dark);
    outline-offset: -3px;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    max-width: 350px;
    gap: var(--space-sm);
}

.toast {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    transition: all var(--transition);
    animation: slideIn 0.3s ease;
    max-width: 100%;
    gap: var(--space-sm);
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.toast.success {
    border-right: 4px solid var(--success-color);
}

.toast.error {
    border-right: 4px solid var(--danger-color);
}

.toast.warning {
    border-right: 4px solid var(--warning-color);
}

.toast.info {
    border-right: 4px solid var(--info-color);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-light);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-lighter);
    cursor: pointer;
    padding: var(--space-xs);
    transition: color var(--transition);
    flex-shrink: 0;
    line-height: 1;
}

.toast-close:hover,
.toast-close:focus-visible {
    color: var(--text-color);
    outline: none;
}

/* ============================================
   Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-light);
}

/* ============================================
   Performance Optimizations
   ============================================ */
.performance-optimize {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

.transform-gpu {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ============================================
   Browser Compatibility Fixes
   ============================================ */

/* Safari fixes */
@supports not (gap: 16px) {
    .header-container,
    .header-actions,
    .primary-menu,
    .slider-dots,
    .carousel-container,
    .cta-buttons,
    .cta-features,
    .social-links,
    .payment-methods {
        margin: -8px;
    }
    
    .header-container > *,
    .header-actions > *,
    .primary-menu > *,
    .slider-dots > *,
    .carousel-container > *,
    .cta-buttons > *,
    .cta-features > *,
    .social-links > *,
    .payment-methods > * {
        margin: 8px;
    }
}

/* IE 11 fallbacks */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .d-flex {
        display: -ms-flexbox !important;
    }
    
    .justify-between {
        -ms-flex-pack: justify;
    }
    
    .items-center {
        -ms-flex-align: center;
    }
    
    .product-image {
        height: 300px;
    }
    
    .product-thumbnail {
        height: 100%;
    }
}

/* ============================================
   End of CSS File
   ============================================ */