/* ============================================
   Main CSS - Design Website
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --primary: #6C63FF;
    --primary-dark: #574fd6;
    --primary-light: #a29bfe;
    --secondary: #00D2FF;
    --accent: #FF6584;
    --dark: #0f0f23;
    --dark-2: #1a1a35;
    --dark-3: #252545;
    --card-bg: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.08);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #f8fafc;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    --shadow: 0 20px 60px rgba(0,0,0,0.3);
    --shadow-sm: 0 4px 20px rgba(0,0,0,0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-fa: 'Vazirmatn', 'IRANSans', Tahoma, sans-serif;
    --font-en: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-fa);
    background: var(--dark);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}
[lang="en"] body, body[data-lang="en"] { font-family: var(--font-en); }

a { color: inherit; text-decoration: none; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
}
ul, ol { list-style: none; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark-2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ---- Selection ---- */
::selection { background: var(--primary); color: white; }

/* ---- Typography ---- */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--text-light); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); }
p { color: var(--text-muted); line-height: 1.8; }

/* ---- Gradient Text ---- */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Layout ---- */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }
.section-sm { padding: 60px 0; }

/* ---- Grid ---- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; } .gap-4 { gap: 32px; }

/* ---- Section Header ---- */
.section-header { text-align: center; margin-bottom: 64px; }
.section-header .badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(108,99,255,0.15); border: 1px solid rgba(108,99,255,0.3);
    color: var(--primary-light); padding: 6px 16px; border-radius: 100px;
    font-size: 0.85rem; font-weight: 600; margin-bottom: 16px;
}
.section-header p { max-width: 600px; margin: 12px auto 0; font-size: 1.1rem; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    transition: var(--transition); white-space: nowrap; border: 2px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 8px 30px rgba(108,99,255,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(108,99,255,0.6); }
.btn-outline {
    background: transparent; color: var(--text-light);
    border-color: var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(108,99,255,0.1); }
.btn-sm { padding: 8px 20px; font-size: 0.85rem; }
.btn-lg { padding: 18px 40px; font-size: 1.05rem; border-radius: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ---- Cards ---- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: rgba(108,99,255,0.3); }
.card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(108,99,255,0.05), transparent);
    opacity: 0; transition: var(--transition);
    pointer-events: none; /* مهم: وگرنه لینک و دکمه داخل کارت کلیک نمی‌شوند */
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }
.service-card a,
.product-body,
.product-actions,
.product-actions form { position: relative; z-index: 2; }

/* ---- Badge ---- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: 100px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-primary { background: rgba(108,99,255,0.15); color: var(--primary-light); }
.badge-success { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-new { background: linear-gradient(135deg, #6C63FF, #00D2FF); color: white; }
.badge-hot { background: linear-gradient(135deg, #FF6584, #ff4757); color: white; }

/* ---- Navbar ---- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 0; transition: var(--transition);
}
.navbar::before {
    content: ''; position: absolute; inset: 0;
    background: transparent; transition: var(--transition);
    pointer-events: none;
}
.navbar.scrolled::before {
    background: rgba(15,15,35,0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
}
.navbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 0; transition: padding 0.3s ease; position: relative; z-index: 1;
}
.navbar.scrolled .navbar-inner { padding: 14px 0; }

/* Brand — لوگوتایپ متنی */
.navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    overflow: visible;
}
.site-logotype {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    font-family: 'Lalezar', 'Vazirmatn', Tahoma, sans-serif;
    transition: var(--transition);
}
[dir="ltr"] .site-logotype {
    font-family: 'Orbitron', 'Inter', system-ui, sans-serif;
}
.logotype-glow {
    position: absolute;
    inset: -10px -14px;
    background: radial-gradient(ellipse at 30% 50%, rgba(108,99,255,0.4), transparent 72%);
    filter: blur(14px);
    z-index: 0;
    pointer-events: none;
}
.logotype-main {
    position: relative;
    z-index: 1;
    font-size: 1.85rem;
    background: linear-gradient(120deg, #e0e7ff 0%, #a29bfe 22%, #6c63ff 52%, #00d2ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.logotype-sub {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-weight: 500;
    color: rgba(226, 232, 255, 0.8);
    margin-top: 3px;
}
[dir="ltr"] .logotype-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.site-logotype--header .logotype-main { font-size: 1.9rem; }
.site-logotype--header .logotype-sub { font-size: 0.8rem; }
.navbar.scrolled .site-logotype--header .logotype-main { font-size: 1.6rem; }
.navbar.scrolled .site-logotype--header .logotype-sub { font-size: 0.72rem; }
.site-logotype--footer .logotype-main { font-size: 1.7rem; }
.site-logotype--footer .logotype-sub { font-size: 0.76rem; }
.site-logotype--auth { align-items: center; text-align: center; }
.site-logotype--auth .logotype-main { font-size: 2.15rem; }
.site-logotype--auth .logotype-sub { font-size: 0.88rem; }
.site-logotype--loader { align-items: center; }
.site-logotype--loader .logotype-main {
    font-size: 2.5rem;
    animation: logotypePulse 2s ease-in-out infinite;
}
.site-logotype--loader .logotype-sub { font-size: 0.95rem; }
@keyframes logotypePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.88; transform: scale(1.02); }
}
.footer-brand a { display: inline-block; text-decoration: none; }

/* Nav Links */
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
    padding: 8px 14px; border-radius: 8px;
    color: rgba(255,255,255,0.75); font-weight: 500; font-size: 0.9rem;
    transition: var(--transition); position: relative; cursor: pointer;
    white-space: nowrap;
}
.nav-link:hover { color: white; background: rgba(255,255,255,0.08); }
.nav-link.active { color: var(--primary-light); background: rgba(108,99,255,0.12); }

/* CTA Nav Link */
.nav-cta {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: white !important; padding: 9px 18px !important;
    border-radius: 10px !important; font-weight: 600 !important;
    box-shadow: 0 4px 20px rgba(108,99,255,0.35);
    margin-inline-start: 6px;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(108,99,255,0.55) !important; background: rgba(255,255,255,0.08) !important; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
    display: flex; align-items: center; gap: 5px; cursor: pointer;
    user-select: none;
}
.nav-chevron { font-size: 0.65rem; transition: transform 0.25s ease; opacity: 0.6; }
.nav-dropdown:hover .nav-chevron { transform: rotate(180deg); opacity: 1; }
.nav-dropdown-menu {
    position: absolute; top: calc(100% + 14px);
    left: 50%; transform: translateX(-50%);
    background: rgba(20,20,45,0.97);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 8px;
    min-width: 280px; opacity: 0; visibility: hidden;
    transform: translateX(-50%) translateY(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(108,99,255,0.1);
    pointer-events: none;
}
[dir="rtl"] .nav-dropdown-menu { left: auto; right: 50%; transform: translateX(50%) translateY(-8px); }
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1; visibility: visible; pointer-events: all;
    transform: translateX(-50%) translateY(0);
}
[dir="rtl"] .nav-dropdown:hover .nav-dropdown-menu { transform: translateX(50%) translateY(0); }
.nav-dropdown-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,0.8);
    transition: var(--transition); font-size: 0.88rem;
}
.nav-dropdown-item:hover { background: rgba(108,99,255,0.15); color: white; }
.nav-dropdown-item strong { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text-light); }
.nav-dropdown-item span { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.ndi-icon { font-size: 1.2rem; width: 36px; height: 36px; background: rgba(255,255,255,0.05); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ndd-divider { height: 1px; background: rgba(255,255,255,0.07); margin: 6px 0; }
.ndd-highlight { background: rgba(108,99,255,0.1); border-radius: 10px; }
.ndd-highlight:hover { background: rgba(108,99,255,0.2); }
.ndd-highlight .ndi-icon { background: rgba(108,99,255,0.2); }

/* Nav Actions */
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* Lang Switcher */
.lang-switcher {
    display: flex; align-items: center; gap: 2px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 3px;
}
.lang-btn {
    padding: 4px 10px; border-radius: 5px; font-size: 0.75rem;
    font-weight: 700; cursor: pointer; transition: var(--transition);
    color: rgba(255,255,255,0.5); letter-spacing: 0.5px;
}
.lang-btn.active { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(108,99,255,0.4); }

/* Nav Icon Button */
.nav-icon-btn {
    position: relative; width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.75); font-size: 0.95rem; cursor: pointer;
    transition: var(--transition);
}
.nav-icon-btn:hover { background: rgba(108,99,255,0.2); border-color: rgba(108,99,255,0.4); color: white; }
.nav-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--accent); color: white; width: 17px; height: 17px;
    border-radius: 50%; font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px var(--dark);
}
[dir="rtl"] .nav-badge { right: auto; left: -5px; }

/* Login Button */
.nav-login-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 10px; font-size: 0.85rem; font-weight: 600;
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85); transition: var(--transition); cursor: pointer;
}
.nav-login-btn:hover { background: rgba(108,99,255,0.2); border-color: rgba(108,99,255,0.4); color: white; }

/* Hamburger */
.hamburger {
    display: none; flex-direction: column; gap: 5px; cursor: pointer;
    padding: 9px; background: rgba(255,255,255,0.06); border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1); transition: var(--transition);
    background: none; border: none;
}
.hamburger:hover { background: rgba(108,99,255,0.15); }
.hamburger span { display: block; width: 22px; height: 2px; background: rgba(255,255,255,0.8); border-radius: 2px; transition: var(--transition); }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Menu */
.mobile-menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(14,14,32,0.98); backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transform: translateY(-10px); opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.mobile-menu.open {
    transform: translateY(0); opacity: 1; pointer-events: all;
}
.mobile-menu-inner { padding: 16px 20px 24px; }
.mobile-link {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 14px; border-radius: 10px; color: rgba(255,255,255,0.8);
    font-size: 0.95rem; font-weight: 500; transition: var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mobile-link:hover, .mobile-link.active { background: rgba(108,99,255,0.12); color: white; border-bottom-color: transparent; }
.mobile-link-sub { padding: 9px 14px 9px 28px; font-size: 0.88rem; color: rgba(255,255,255,0.6); }
.mobile-section-title {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--text-muted); padding: 14px 14px 6px;
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .mobile-menu { display: block; }
    .site-logotype--header .logotype-main { font-size: 1.65rem; }
    .site-logotype--footer .logotype-main { font-size: 1.5rem; }
    .navbar-inner { padding: 16px 0; }
    .navbar.scrolled .navbar-inner { padding: 12px 0; }
}
@media (max-width: 480px) {
    .site-logotype--header .logotype-main { font-size: 1.45rem; }
    .site-logotype--header .logotype-sub { font-size: 0.68rem; }
    .lang-switcher { display: none; }
    .nav-login-btn span { display: none; }
    .nav-login-btn { padding: 8px; }
}

/* ---- Hero ---- */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    position: relative; overflow: hidden; padding-top: 80px;
}
.hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(ellipse 80% 80% at 50% -20%, rgba(108,99,255,0.3), transparent),
                radial-gradient(ellipse 60% 60% at 80% 80%, rgba(0,210,255,0.15), transparent);
}
.hero-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 100%);
}
.hero-inner {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 60px; align-items: center; width: 100%; position: relative; z-index: 1;
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(108,99,255,0.1); border: 1px solid rgba(108,99,255,0.3);
    color: var(--primary-light); padding: 8px 20px; border-radius: 100px;
    font-size: 0.85rem; font-weight: 600; margin-bottom: 24px;
    animation: fadeInDown 0.6s ease both;
}
.hero h1 { margin-bottom: 20px; animation: fadeInUp 0.6s 0.1s ease both; }
.hero-sub {
    font-size: 1.15rem; color: var(--text-muted);
    margin-bottom: 36px; animation: fadeInUp 0.6s 0.2s ease both;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; animation: fadeInUp 0.6s 0.3s ease both; }
.hero-stats {
    display: flex; gap: 32px; margin-top: 56px;
    animation: fadeInUp 0.6s 0.4s ease both; flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--text-light); line-height: 1; }
.stat-number span { color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Hero Visual */
.hero-visual-wrap {
    position: relative; display: flex; align-items: center; justify-content: center;
    animation: fadeInUp 0.6s 0.2s ease both;
}
.hero-visual-inner {
    width: clamp(280px, 40vw, 420px); height: clamp(280px, 40vw, 420px);
    position: relative;
}
.hero-visual-inner > div:first-child {
    width: 100%;
    height: 100%;
}
.hero-brand-img {
    width: 78%;
    max-width: 300px;
    height: auto;
    max-height: 78%;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 0 36px rgba(108, 99, 255, 0.5));
}

/* ---- Floating Cards (Hero decoration) ---- */
.floating-cards {
    position: relative; width: 100%; aspect-ratio: 1;
}
.float-card {
    position: absolute; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 20px; backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}
.float-card-1 { top: 10%; right: 5%; animation: float 4s ease-in-out infinite; }
.float-card-2 { top: 45%; left: 0%; animation: float 5s 1s ease-in-out infinite; }
.float-card-3 { bottom: 10%; right: 10%; animation: float 6s 0.5s ease-in-out infinite; }

/* Responsive Hero */
@media (max-width: 1024px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-visual-wrap { display: none; }
    .hero { min-height: auto; padding: 120px 0 80px; }
    .hero-content { text-align: center; }
    .hero-actions { justify-content: center; }
    .hero-stats { justify-content: center; gap: 24px; }
    .hero-badge { }
}
@media (max-width: 580px) {
    .hero { padding: 100px 0 60px; }
    .hero-stats { gap: 16px; }
    .stat-number { font-size: 1.6rem; }
}

/* ---- Services ---- */
.services-grid { grid-template-columns: repeat(3, 1fr); }
.service-card { text-align: center; cursor: default; }
.service-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, rgba(108,99,255,0.2), rgba(0,210,255,0.1));
    border: 1px solid rgba(108,99,255,0.3);
    border-radius: var(--radius); margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; transition: var(--transition);
}
.service-card:hover .service-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 8px 30px rgba(108,99,255,0.4);
    transform: scale(1.1) rotate(-5deg);
}
.service-card h3 { font-size: 1.1rem; margin-bottom: 12px; }
.service-card--featured {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2), 0 12px 40px rgba(16, 185, 129, 0.08);
}

/* ---- Portfolio ---- */
.portfolio-filters {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; flex-wrap: wrap; margin-bottom: 48px;
}
.filter-btn {
    padding: 8px 20px; border-radius: 100px;
    background: var(--card-bg); border: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.9rem; cursor: pointer;
    transition: var(--transition);
}
.filter-btn:hover, .filter-btn.active {
    background: var(--primary); border-color: var(--primary); color: white;
}
.portfolio-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.portfolio-card { padding: 0; overflow: hidden; }
.portfolio-image {
    aspect-ratio: 16/9; overflow: hidden; position: relative;
    background: var(--dark-3);
}
.portfolio-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.portfolio-card:hover .portfolio-image img { transform: scale(1.08); }
.portfolio-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(15,15,35,0.95), transparent);
    display: flex; align-items: flex-end; padding: 24px;
    opacity: 0; transition: var(--transition);
}
.portfolio-card:hover .portfolio-overlay { opacity: 1; }
.portfolio-info { padding: 24px; }
.portfolio-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---- Shop / Product Cards ---- */
.product-card { padding: 0; overflow: hidden; cursor: pointer; }
.product-image {
    aspect-ratio: 4/3; overflow: hidden; position: relative;
    background: var(--dark-3);
}
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-card:hover .product-image img { transform: scale(1.05); }
.product-badges { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; }
[dir="rtl"] .product-badges { right: auto; left: 12px; }
.product-body { padding: 24px; }
.product-price {
    font-size: 1.3rem; font-weight: 800; color: var(--text-light);
    margin-bottom: 16px;
}
.product-price .old-price {
    font-size: 0.9rem; font-weight: 400;
    color: var(--text-muted); text-decoration: line-through; margin-inline-end: 8px;
}
.product-price.free { color: var(--success); }
.product-actions { display: flex; gap: 8px; align-items: stretch; }
.product-actions .btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; min-height: 40px; padding: 10px 14px; font-size: 0.85rem;
}
.nav-badge.nav-badge--empty { opacity: 0.85; }
.cart-nav-btn { position: relative; }
.product-tech { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.tech-tag {
    padding: 3px 10px; border-radius: 100px;
    background: var(--dark-3); color: var(--text-muted);
    font-size: 0.75rem;
}

/* ---- CTA Banner ---- */
.cta-section {
    background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(0,210,255,0.1));
    border: 1px solid rgba(108,99,255,0.2);
    border-radius: var(--radius-lg); padding: 80px 60px;
    text-align: center; position: relative; overflow: hidden;
}
.cta-section::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, rgba(108,99,255,0.1), transparent 70%);
}
.cta-section h2 { margin-bottom: 16px; position: relative; }
.cta-section p { position: relative; max-width: 500px; margin: 0 auto 32px; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; position: relative; }

/* ---- Blog ---- */
.blog-card { padding: 0; overflow: hidden; }
.blog-image { aspect-ratio: 16/9; overflow: hidden; background: var(--dark-3); }
.blog-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.blog-card:hover .blog-image img { transform: scale(1.05); }
.blog-body { padding: 24px; }
.blog-meta { display: flex; align-items: center; gap: 16px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }
.blog-meta span { display: flex; align-items: center; gap: 4px; }

/* ---- Testimonials ---- */
.testimonials-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.testimonial-card { }
.testimonial-stars { color: #fbbf24; font-size: 1.1rem; margin-bottom: 16px; }
.testimonial-text { font-size: 1rem; color: var(--text); font-style: italic; margin-bottom: 20px; line-height: 1.8; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem; color: white; overflow: hidden;
    flex-shrink: 0;
}
.testimonial-avatar img { width: 100%; height: 100%; object-fit: cover; }
.testimonial-name { font-weight: 700; font-size: 0.95rem; color: var(--text-light); }
.testimonial-role { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Contact Form ---- */
.contact-grid { grid-template-columns: 1fr 1.5fr; gap: 60px; align-items: start; }
.contact-info h2 { margin-bottom: 20px; }
.contact-item {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 20px; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.contact-item-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    background: rgba(108,99,255,0.15); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.contact-item-text h4 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 4px; }
.contact-item-text p { font-size: 0.95rem; color: var(--text-light); }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.form-control {
    width: 100%; padding: 14px 16px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-light);
    transition: var(--transition); font-size: 0.95rem;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 140px; }
select.form-control { cursor: pointer; }
select.form-control option { background: var(--dark-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- Footer ---- */
.footer {
    background: var(--dark-2); border-top: 1px solid var(--border);
    padding: 80px 0 0;
}
.footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 60px; }
.footer-brand p { margin-top: 12px; font-size: 0.9rem; max-width: 300px; line-height: 1.8; }
.footer-company-name {
    font-size: 0.95rem; font-weight: 700; color: var(--text-light);
    margin-bottom: 4px !important; margin-top: 0 !important;
}
.footer-socials { display: flex; gap: 10px; margin-top: 20px; }
.social-link {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--card-bg); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 1rem; transition: var(--transition);
}
.social-link:hover { background: var(--primary); border-color: var(--primary); color: white; transform: translateY(-2px); }
.footer-title { font-size: 1rem; font-weight: 700; margin-bottom: 20px; color: var(--text-light); }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; transition: var(--transition); }
.footer-links a:hover { color: var(--primary); padding-inline-start: 4px; }
.newsletter-form { display: flex; gap: 8px; margin-top: 16px; }
.newsletter-input {
    flex: 1; padding: 10px 14px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-light); font-size: 0.85rem;
}
.newsletter-input:focus { border-color: var(--primary); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 24px 0; display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 0.85rem; color: var(--text-muted); }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { font-size: 0.85rem; color: var(--text-muted); }
.footer-bottom-links a:hover { color: var(--primary); }

/* ---- Toast / Flash ---- */
.toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    display: flex; flex-direction: column; gap: 12px;
}
[dir="rtl"] .toast-container { right: auto; left: 24px; }
.toast {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; border-radius: var(--radius-sm);
    background: var(--dark-2); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); min-width: 300px;
    animation: slideInRight 0.3s ease;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.warning { border-color: var(--warning); }
.toast-icon { font-size: 1.2rem; }
.toast-msg { font-size: 0.9rem; color: var(--text-light); }
.toast-close { margin-inline-start: auto; cursor: pointer; color: var(--text-muted); font-size: 1rem; }

/* ---- Loader ---- */
.page-loader {
    position: fixed; inset: 0; background: var(--dark);
    display: flex; align-items: center; justify-content: center; z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo { animation: pulse 1.5s ease-in-out infinite; }
.spinner {
    width: 40px; height: 40px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-20px); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.7; transform: scale(0.95); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ---- Utility ---- */
.text-center { text-align: center; } .text-start { text-align: start; }
.mt-1{margin-top:8px} .mt-2{margin-top:16px} .mt-3{margin-top:24px} .mt-4{margin-top:32px}
.mb-1{margin-bottom:8px} .mb-2{margin-bottom:16px} .mb-3{margin-bottom:24px}
.hidden { display: none !important; }
.d-flex { display: flex; } .d-grid { display: grid; }

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
    .contact-grid { grid-template-columns: 1fr; }
    .hero > .container > div { grid-template-columns: 1fr !important; }
    .hero > .container > div > div:last-child { display: none; }
    .hero-stats { gap: 20px; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .cta-section { padding: 60px 40px; }
}

@media (max-width: 768px) {
    .section { padding: 60px 0; }
    .section-sm { padding: 40px 0; }

    /* Grid */
    .grid-3, .services-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }

    /* Navbar */
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .nav-links.open {
        display: flex; flex-direction: column;
        position: fixed; top: 65px; left: 0; right: 0; bottom: 0;
        background: rgba(15,15,35,0.98); backdrop-filter: blur(24px);
        padding: 24px 20px; border-top: 1px solid var(--border);
        gap: 4px; overflow-y: auto; z-index: 999;
        animation: fadeInDown 0.2s ease;
    }
    .nav-links.open .nav-link {
        padding: 14px 16px; font-size: 1rem;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }
    .nav-links.open .nav-link:last-child { border-bottom: none; }
    .footer-logo { max-height: 50px; max-width: 200px; }

    /* Hero */
    .hero { padding-top: 70px; min-height: auto; padding-bottom: 60px; }
    .hero h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
    .hero-sub { font-size: 1rem; }
    .hero-stats { gap: 16px; flex-wrap: wrap; justify-content: center; }
    .hero-stats .stat-item { min-width: 80px; text-align: center; }

    /* Section header */
    .section-header { margin-bottom: 40px; }
    .section-header h2 { font-size: 1.6rem; }

    /* CTA */
    .cta-section { padding: 48px 24px; }
    .cta-section h2 { font-size: 1.5rem; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 8px; }
    .footer-bottom-links { justify-content: center; }

    /* Form */
    .form-row { grid-template-columns: 1fr; }

    /* Cards */
    .card { padding: 24px; }
}

@media (max-width: 580px) {
    .container { padding: 0 16px; }

    /* Grid single col */
    .grid-3, .services-grid, .grid-4 { grid-template-columns: 1fr; }
    .testimonials-grid { grid-template-columns: 1fr; }
    .portfolio-grid { grid-template-columns: 1fr; }

    /* Hero */
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .hero-stats { gap: 12px; }
    .stat-number { font-size: 1.5rem; }

    /* Section header */
    .section-header h2 { font-size: 1.4rem; }

    /* Nav actions — hide login btn on tiny screens */
    .nav-actions .btn { display: none; }

    /* CTA */
    .cta-buttons { flex-direction: column; align-items: stretch; }
    .cta-buttons .btn { width: 100%; justify-content: center; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; }
    .newsletter-form { flex-direction: column; }
    .newsletter-form .btn { width: 100%; }

    /* Product & portfolio cards */
    .product-actions { flex-direction: column; }
    .product-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 380px) {
    .hero h1 { font-size: 1.6rem; }
    .lang-switcher { display: none; }
    .site-logotype--header .logotype-main { font-size: 1.35rem; }
}

/* ---- RTL Specific ---- */
[dir="rtl"] .hero-content { text-align: right; }
[dir="rtl"] .footer-links a:hover { padding-inline-start: 4px; padding-inline-end: 0; }
[dir="rtl"] .toast-container { right: auto; left: 24px; }
[dir="rtl"] #backToTop { right: auto; left: 24px; }

/* RTL nav open position */
[dir="rtl"] .nav-links.open {
    animation: fadeInDown 0.2s ease;
}

/* RTL cart badge */
[dir="rtl"] .cart-count { right: auto; left: -6px; }

/* پنل ادمین layout جداگانه در admin.css — این قواعد فقط سایت عمومی */
body:not(.admin-body) [dir="rtl"] .sidebar { right: auto; left: 0; border-left: none; border-right: 1px solid var(--border); }
