/*
Theme Name: SPS Auto Parts
Theme URI: https://sps.example.com
Author: SPS Team
Description: قالب اختصاصی فروش لوازم یدکی SPS با تم قرمز و مشکی
Version: 1.0.0
Text Domain: sps-theme
Tags: e-commerce, woocommerce, rtl-language
*/

/* ==================== متغیرهای رنگی ==================== */
:root {
    --sps-red: #E30613;
    --sps-red-dark: #B00410;
    --sps-red-light: #FF1A2B;
    --sps-black: #0A0A0A;
    --sps-black-soft: #1A1A1A;
    --sps-gray: #6B6B6B;
    --sps-gray-light: #F5F5F5;
    --sps-white: #FFFFFF;
    --sps-border: #E5E5E5;
    --sps-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --sps-shadow-hover: 0 12px 40px rgba(227,6,19,0.25);
    --sps-transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==================== ریست و پایه ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', 'IRANSans', Tahoma, sans-serif;
    background: var(--sps-white);
    color: var(--sps-black);
    line-height: 1.7;
    direction: rtl;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--sps-transition); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== هدر ==================== */
.sps-topbar {
    background: var(--sps-black);
    color: var(--sps-white);
    padding: 10px 0;
    font-size: 13px;
}

.sps-topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sps-topbar-info a:hover { color: var(--sps-red); }

.sps-header {
    background: var(--sps-white);
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 999;
    transition: var(--sps-transition);
}

.sps-header.sps-scrolled {
    padding: 5px 0;
    box-shadow: 0 4px 25px rgba(0,0,0,0.12);
}

.sps-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 30px;
}

/* لوگو */
.sps-logo {
    font-size: 32px;
    font-weight: 900;
    color: var(--sps-black);
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sps-logo span {
    color: var(--sps-red);
    position: relative;
}

.sps-logo span::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 0;
    width: 100%;
    height: 4px;
    background: var(--sps-red);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.sps-logo:hover span::after { transform: scaleX(1); }

/* منو */
.sps-nav ul {
    display: flex;
    gap: 32px;
}

.sps-nav a {
    font-weight: 600;
    font-size: 15px;
    position: relative;
    padding: 8px 0;
    color: var(--sps-black);
}

.sps-nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--sps-red);
    transition: width 0.35s ease;
}

.sps-nav a:hover { color: var(--sps-red); }
.sps-nav a:hover::before { width: 100%; }

/* اکشن‌های هدر */
.sps-header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sps-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sps-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--sps-transition);
}

.sps-icon-btn:hover {
    background: var(--sps-red);
    color: var(--sps-white);
    transform: translateY(-3px) rotate(8deg);
}

.sps-cart-count {
    position: absolute;
    top: -4px;
    left: -4px;
    background: var(--sps-red);
    color: var(--sps-white);
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    animation: sps-pulse 2s infinite;
}

/* ==================== بنر اصلی ==================== */
.sps-hero {
    background: linear-gradient(135deg, var(--sps-black) 0%, var(--sps-black-soft) 100%);
    color: var(--sps-white);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.sps-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(227,6,19,0.3), transparent 70%);
    border-radius: 50%;
    animation: sps-float 8s ease-in-out infinite;
}

.sps-hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.sps-hero-title {
    font-size: 54px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 24px;
    animation: sps-fadeUp 0.8s ease both;
}

.sps-hero-title .sps-highlight {
    color: var(--sps-red);
    position: relative;
    display: inline-block;
}

.sps-hero-title .sps-highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 0;
    width: 100%;
    height: 12px;
    background: rgba(227,6,19,0.25);
    z-index: -1;
    animation: sps-slideIn 1s ease 0.5s both;
}

.sps-hero-desc {
    font-size: 18px;
    color: #B0B0B0;
    margin-bottom: 35px;
    animation: sps-fadeUp 0.8s ease 0.2s both;
}

.sps-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    background: var(--sps-red);
    color: var(--sps-white);
    font-weight: 700;
    font-size: 15px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--sps-transition);
    animation: sps-fadeUp 0.8s ease 0.4s both;
}

.sps-btn::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: right 0.6s ease;
}

.sps-btn:hover {
    background: var(--sps-red-dark);
    transform: translateY(-4px);
    box-shadow: var(--sps-shadow-hover);
}

.sps-btn:hover::before { right: 100%; }

.sps-btn-outline {
    background: transparent;
    border: 2px solid var(--sps-white);
    margin-right: 15px;
}

.sps-btn-outline:hover {
    background: var(--sps-white);
    color: var(--sps-black);
}

/* ==================== بخش دسته‌بندی ==================== */
.sps-section { padding: 80px 0; }

.sps-section-title {
    text-align: center;
    margin-bottom: 60px;
}

.sps-section-title h2 {
    font-size: 38px;
    font-weight: 900;
    color: var(--sps-black);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.sps-section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 4px;
    background: var(--sps-red);
    border-radius: 2px;
}

.sps-section-title p {
    color: var(--sps-gray);
    font-size: 16px;
    margin-top: 20px;
}

/* دسته‌بندی ها */
.sps-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.sps-cat-card {
    background: var(--sps-white);
    border: 2px solid var(--sps-border);
    border-radius: 16px;
    padding: 35px 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--sps-transition);
}

.sps-cat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: var(--sps-red);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.sps-cat-card:hover {
    transform: translateY(-10px);
    border-color: var(--sps-red);
    box-shadow: var(--sps-shadow-hover);
}

.sps-cat-card:hover::before { transform: scaleX(1); }

.sps-cat-icon {
    font-size: 48px;
    color: var(--sps-red);
    margin-bottom: 20px;
    transition: var(--sps-transition);
}

.sps-cat-card:hover .sps-cat-icon {
    transform: scale(1.15) rotate(-8deg);
}

.sps-cat-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.sps-cat-card span {
    color: var(--sps-gray);
    font-size: 13px;
}

/* ==================== گرید محصولات ووکامرس ==================== */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin: 0 !important;
}

.woocommerce ul.products li.product {
    background: var(--sps-white);
    border: 1px solid var(--sps-border);
    border-radius: 16px;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
    transition: var(--sps-transition);
    position: relative;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-8px);
    border-color: var(--sps-red);
    box-shadow: var(--sps-shadow-hover);
}

.woocommerce ul.products li.product img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.08);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    padding: 15px 20px 8px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--sps-black) !important;
    transition: var(--sps-transition);
}

.woocommerce ul.products li.product:hover .woocommerce-loop-product__title {
    color: var(--sps-red) !important;
}

.woocommerce ul.products li.product .price {
    padding: 0 20px 15px !important;
    color: var(--sps-red) !important;
    font-weight: 900 !important;
    font-size: 18px !important;
}

.woocommerce ul.products li.product .button {
    margin: 0 20px 20px !important;
    background: var(--sps-black) !important;
    color: var(--sps-white) !important;
    border-radius: 50px !important;
    padding: 12px 24px !important;
    font-weight: 700 !important;
    transition: var(--sps-transition) !important;
    width: calc(100% - 40px) !important;
    text-align: center;
}

.woocommerce ul.products li.product .button:hover {
    background: var(--sps-red) !important;
    transform: scale(1.05);
}

/* برچسب فروش */
.woocommerce span.onsale {
    background: var(--sps-red) !important;
    color: var(--sps-white) !important;
    border-radius: 50px !important;
    padding: 6px 16px !important;
    font-weight: 700 !important;
    min-height: auto !important;
    line-height: 1.4 !important;
    top: 15px !important;
    right: 15px !important;
    left: auto !important;
    animation: sps-pulse 2s infinite;
}

/* ==================== فوتر ==================== */
.sps-footer {
    background: var(--sps-black);
    color: #B0B0B0;
    padding: 70px 0 0;
    margin-top: 80px;
}

.sps-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 50px;
}

.sps-footer-col h4 {
    color: var(--sps-white);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 12px;
}

.sps-footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--sps-red);
}

.sps-footer-col ul li {
    margin-bottom: 12px;
}

.sps-footer-col a {
    color: #B0B0B0;
    font-size: 14px;
    position: relative;
    padding-right: 15px;
}

.sps-footer-col a::before {
    content: '←';
    position: absolute;
    right: 0;
    opacity: 0;
    transition: var(--sps-transition);
}

.sps-footer-col a:hover {
    color: var(--sps-red);
    padding-right: 22px;
}

.sps-footer-col a:hover::before { opacity: 1; }

.sps-copyright {
    border-top: 1px solid #222;
    padding: 25px 0;
    text-align: center;
    font-size: 13px;
}

.sps-copyright strong { color: var(--sps-red); }

/* ==================== انیمیشن‌ها ==================== */
@keyframes sps-fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes sps-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sps-slideIn {
    from { transform: scaleX(0); transform-origin: right; }
    to { transform: scaleX(1); transform-origin: right; }
}

@keyframes sps-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, -30px) rotate(180deg); }
}

@keyframes sps-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes sps-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sps-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* انیمیشن ورود عناصر با اسکرول */
.sps-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sps-reveal.sps-active {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== ریسپانسیو ==================== */
@media (max-width: 992px) {
    .sps-hero-inner { grid-template-columns: 1fr; text-align: center; }
    .sps-hero-title { font-size: 38px; }
    .sps-footer-grid { grid-template-columns: 1fr 1fr; }
    .sps-nav { display: none; }
}

@media (max-width: 600px) {
    .sps-hero-title { font-size: 28px; }
    .sps-section-title h2 { font-size: 26px; }
    .sps-footer-grid { grid-template-columns: 1fr; }
    .sps-topbar .container { flex-direction: column; gap: 8px; }
}