/* ==========================================
   CSS ووکامرس حرفه‌ای - نسخه کامل
   قابلیت استفاده مستقیم در فایل style.css
   ========================================== */

/* ==========================================
   1. تنظیمات کلی و متغیرها
   ========================================== */
:root {
    --primary-color: #ff6b6b;
    --primary-dark: #ff4757;
    --secondary-color: #1a1a1a;
    --secondary-light: #2d3436;
    --accent-color: #0984e3;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-color: #fff;
    --bg-light: #f8f9fa;
    --bg-dark: #1a1a1a;
    --border-color: #e0e0e0;
    --border-radius: 8px;
    --box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    --box-shadow-hover: 0 10px 25px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   2. هدر و نویگیشن
   ========================================== */
.header-wrapper {
    background: var(--secondary-color);
    color: white;
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* لوگو */
.site-logo a {
    color: white;
    font-size: 28px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo img {
    max-height: 45px;
    width: auto;
}

/* منوی اصلی */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-menu {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 30px;
}

.main-menu > li {
    position: relative;
}

.main-menu > li > a {
    color: white;
    text-decoration: none;
    padding: 10px 0;
    font-weight: 600;
    font-size: 16px;
    position: relative;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-menu > li > a:hover {
    color: var(--primary-color);
}

.main-menu > li > a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.main-menu > li > a:hover:after {
    width: 100%;
}

/* مگامنو */
.megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-color);
    min-width: 900px;
    box-shadow: var(--box-shadow-hover);
    border-radius: var(--border-radius);
    padding: 30px;
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: var(--transition);
    z-index: 999;
}

.main-menu > li:hover .megamenu {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.megamenu-columns {
    display: flex;
    width: 100%;
    gap: 30px;
}

.megamenu-column {
    flex: 1;
    min-width: 220px;
}

.megamenu-column h3 {
    color: var(--secondary-color);
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.megamenu-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.megamenu-column ul li {
    margin-bottom: 10px;
}

.megamenu-column ul li a {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 0;
    display: block;
    transition: var(--transition);
    border-radius: 4px;
    padding-left: 10px;
}

.megamenu-column ul li a:hover {
    color: var(--primary-color);
    background: var(--bg-light);
    padding-left: 15px;
}

/* زیرمنوهای معمولی */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-color);
    min-width: 250px;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    padding: 15px 0;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 998;
}

.main-menu li:hover > .submenu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.submenu li {
    margin: 0;
}

.submenu a {
    color: var(--text-light) !important;
    padding: 12px 25px !important;
    display: block;
    white-space: nowrap;
    transition: var(--transition);
}

.submenu a:hover {
    color: var(--primary-color) !important;
    background: var(--bg-light);
}

/* آیتم‌های هدر */
.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* جستجو */
.header-search {
    position: relative;
}

.search-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
}

.search-toggle:hover {
    color: var(--primary-color);
}

.search-form-container {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-color);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-hover);
    display: none;
    min-width: 350px;
    z-index: 1001;
}

.search-form-container.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.search-form input[type="search"] {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* سبد خرید */
.cart-icon {
    position: relative;
}

.cart-link {
    color: white;
    font-size: 20px;
    text-decoration: none;
    display: block;
    padding: 8px;
    transition: var(--transition);
}

.cart-link:hover {
    color: var(--primary-color);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* منوی موبایل */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

/* ==========================================
   3. صفحات محصولات و فروشگاه
   ========================================== */

/* صفحه محصولات */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.product-card {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.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-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

.product-content {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.product-title a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.old-price {
    font-size: 16px;
    color: var(--text-lighter);
    text-decoration: line-through;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    color: #ffc107;
}

.rating-count {
    color: var(--text-light);
    font-size: 14px;
}

.add-to-cart-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ==========================================
   4. صفحه تک محصول
   ========================================== */
.single-product-wrapper {
    padding: 50px 0;
}

.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.product-gallery {
    position: relative;
}

.main-product-image {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 15px;
}

.main-product-image img {
    width: 100%;
    height: auto;
    display: block;
}

.product-thumbnails {
    display: flex;
    gap: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumbnail.active,
.thumbnail:hover {
    border-color: var(--primary-color);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px 0;
}

.product-title-single {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.product-price-single {
    font-size: 28px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 20px;
}

.product-description {
    margin-bottom: 30px;
    color: var(--text-light);
    line-height: 1.8;
}

.product-meta {
    margin-bottom: 30px;
}

.meta-item {
    display: flex;
    margin-bottom: 10px;
}

.meta-label {
    font-weight: 600;
    min-width: 100px;
    color: var(--secondary-light);
}

.variations {
    margin-bottom: 30px;
}

.variation-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.variation-select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    width: 200px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.quantity-label {
    font-weight: 600;
}

.quantity-input {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.quantity-btn {
    background: var(--bg-light);
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-input input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
}

.single-add-to-cart {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: var(--border-radius);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.single-add-to-cart:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

.product-tabs {
    margin-top: 50px;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
}

.tab-button {
    padding: 15px 30px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
}

.tab-button.active {
    color: var(--primary-color);
}

.tab-button.active:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* ==========================================
   5. سبد خرید
   ========================================== */
.cart-page {
    padding: 50px 0;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.cart-table th {
    background: var(--bg-light);
    padding: 20px;
    text-align: left;
    font-weight: 600;
    color: var(--secondary-color);
}

.cart-table td {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-name a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.cart-item-name a:hover {
    color: var(--primary-color);
}

.cart-quantity {
    display: flex;
    align-items: center;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.quantity-control button {
    background: var(--bg-light);
    border: none;
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: var(--transition);
}

.quantity-control button:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-control input {
    width: 50px;
    height: 35px;
    border: none;
    text-align: center;
}

.remove-item {
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
}

.cart-totals {
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--border-radius);
}

.totals-table {
    width: 100%;
    margin-bottom: 30px;
}

.totals-table tr {
    border-bottom: 1px solid var(--border-color);
}

.totals-table td {
    padding: 15px 0;
}

.totals-label {
    color: var(--text-light);
}

.totals-value {
    text-align: right;
    font-weight: 600;
}

.total-row .totals-value {
    font-size: 24px;
    color: var(--primary-color);
}

.proceed-checkout {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: var(--border-radius);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}

.proceed-checkout:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ==========================================
   6. چک اوت
   ========================================== */
.checkout-page {
    padding: 50px 0;
}

.checkout-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 50px;
}

.checkout-form {
    background: var(--bg-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.checkout-title {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--secondary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-light);
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.order-review {
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--border-radius);
    position: sticky;
    top: 100px;
}

.order-review-title {
    font-size: 20px;
    margin-bottom: 25px;
    color: var(--secondary-color);
}

.review-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.place-order-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: var(--border-radius);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    margin-top: 20px;
}

.place-order-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ==========================================
   7. فوتر
   ========================================== */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h3 {
    font-size: 20px;
    margin-bottom: 25px;
    color: white;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #999;
}

/* ==========================================
   8. ریسپانسیو
   ========================================== */
@media (max-width: 1200px) {
    .megamenu {
        min-width: 700px;
    }
}

@media (max-width: 992px) {
    .product-details {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .checkout-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 15px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-navigation {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--secondary-color);
        display: none;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    .main-navigation.active {
        display: block;
        animation: slideDown 0.3s ease;
    }
    
    .main-menu {
        flex-direction: column;
        gap: 0;
    }
    
    .main-menu > li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .main-menu > li > a {
        padding: 15px 0;
    }
    
    .megamenu,
    .submenu {
        position: static;
        display: none;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
        min-width: auto;
        opacity: 1;
        transform: none;
        padding: 15px;
        margin: 10px 0;
    }
    
    .main-menu li:hover .megamenu,
    .main-menu li:hover > .submenu {
        display: none;
    }
    
    .megamenu.active,
    .submenu.active {
        display: block;
    }
    
    .megamenu-columns {
        flex-direction: column;
    }
    
    .search-form-container {
        min-width: 280px;
        right: -50px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cart-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .header-actions {
        gap: 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   9. انیمیشن‌ها
   ========================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ==========================================
   10. کلاس‌های کمکی
   ========================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }

.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }

.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.rounded { border-radius: var(--border-radius); }
.shadow { box-shadow: var(--box-shadow); }

.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }

.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--secondary-light);
}

/* ==========================================
   11. حالت‌های مختلف
   ========================================== */
.header-wrapper.scrolled {
    padding: 10px 0;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
}

.product-card.out-of-stock .add-to-cart-btn {
    background: #ccc;
    cursor: not-allowed;
}

.product-card.out-of-stock .add-to-cart-btn:hover {
    transform: none;
}

/* ==========================================
   12. آیکون‌ها
   ========================================== */
.icon {
    display: inline-block;
    font-size: inherit;
}

/* ==========================================
   13. پیغام‌های سیستم
   ========================================== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 10px;
}

.woocommerce-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.woocommerce-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.woocommerce-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================
   14. لودینگ و انیمیشن‌ها
   ========================================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   15. استایل‌های اضافی برای بهبود UX
   ========================================== */
/* Focus states for accessibility */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Better hover effects for mobile */
@media (hover: none) {
    .product-card:hover {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .header-wrapper,
    .footer,
    .add-to-cart-btn,
    .proceed-checkout,
    .place-order-btn {
        display: none !important;
    }
}