/*
Theme Name: صنعتی کالا
Theme URI: https://sanatikala.com
Author: Hosein Nikmaram
Author URI: https://nicmaram.ir
Description: قالب ووکامرس تخصصی برای فروشگاه قطعات صنعتی با مگا منو پیشرفته
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sanati-kala
Tags: woocommerce, rtl, custom-menu, featured-images, full-width-template
*/

/* ==========================================================================
   فونت سفارشی - YekanBakh
   ========================================================================== */

@font-face {
    font-family: 'YekanBakh';
    src: url('assets/fonts/YBFontRegular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   استایل‌های اصلی
   ========================================================================== */

body {
    font-family: 'YekanBakh', sans-serif;
    background-color: #f8fafc;
    transition: 0.3s ease all;
}

/* ==========================================================================
   انیمیشن‌های مگا منو
   ========================================================================== */

.mega-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out;
}

.menu-item{
    list-style: none;
    
}
.group:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================================================
   استایل‌های دکمه‌ها
   ========================================================================== */

.btn-option.active {
    background-color: #eff6ff;
    border-color: #2563eb;
    color: #1e40af;
    font-weight: bold;
    box-shadow: 0 0 0 1px #2563eb;
}

.gradient-bg {
    background: linear-gradient(to right, #3b82f6, #1d4ed8);
}

.gradient-bg:hover {
    background: linear-gradient(to right, #2563eb, #1e40af);
}

/* ==========================================================================
   انیمیشن‌ها
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* ==========================================================================
   کارت محصولات
   ========================================================================== */

.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   موبایل
   ========================================================================== */

@media (max-width: 767px) {
    .mega-menu {
        display: none !important;
    }
    
    #mobile-menu {
        z-index: 1000;
        height: auto;
        max-height: 80vh;
        overflow-y: auto;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }
    
    #mobile-menu.translate-y-0 {
        transform: translateY(0);
    }
    
    #mobile-menu.translate-y-full {
        transform: translateY(100%);
    }
    
    #cart-sidebar {
        width: 100%;
    }
}

@media (min-width: 768px) {
    #cart-sidebar {
        width: 24rem;
    }
}

/* ==========================================================================
   سبد خرید
   ========================================================================== */

#cart-sidebar {
    transition: transform 0.3s ease-in-out;
}

#cart-sidebar.-translate-x-full {
    transform: translateX(-100%);
}

#cart-sidebar.translate-x-0 {
    transform: translateX(0);
}

/* ==========================================================================
   ووکامرس - استایل‌های پیشرفته
   ========================================================================== */

.woocommerce-notices-wrapper{
    margin: 20px;
}
.woocommerce-notices-wrapper ul{
    border: 1px solid;
    border-radius: 5px;
}

/* برای خطا (error) */
.woocommerce-notices-wrapper ul.woocommerce-error {
    border-color: #a00;
    background-color: #f8d7da;
    color: #721c24;
}

/* برای موفقیت (success) */
.woocommerce-notices-wrapper ul.woocommerce-message {
    border-color: #46b450;
    background-color: #d4edda;
    color: #155724;
}

/* برای اطلاعات (info) */
.woocommerce-notices-wrapper ul.woocommerce-info {
    border-color: #17a2b8;
    background-color: #d1ecf1;
    color: #0c5460;
}


/* =============================== */
/* استایل اصلی همه صفحات ووکامرس */
/* =============================== */
.woocommerce-content {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 20px auto;
    max-width: 1200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* =============================== */
/* صفحه سبد خرید خالی */
/* =============================== */
.wp-block-woocommerce-empty-cart-block {
    text-align: center;
    padding: 50px 30px;
}

.wc-block-cart__empty-cart__title {
    color: #1f2937;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.4;
}

.wp-block-separator.is-style-dots {
    background: transparent !important;
    border: 1px dashed #d1d1d1 !important;
    width: 100% !important;
    height: 1px !important;
    margin: 20px;
}

/* عنوان محصولات جدید */
.wp-block-heading.has-text-align-center:last-of-type {
    color: #2563eb;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 30px;
    display: inline-block;
    padding-bottom: 10px;
}

/* محصولات */
.wc-block-grid__products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.wc-block-grid__product {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wc-block-grid__product:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}



.wc-block-grid__product:hover::before {
    transform: scaleX(1);
}

.wc-block-grid__product-image {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wc-block-grid__product-image img {
    max-height: 140px;
    max-width: 100%;
    transition: transform 0.5s ease;
    object-fit: contain;
}

.wc-block-grid__product:hover .wc-block-grid__product-image img {
    transform: scale(1.08);
}

.wc-block-grid__product-title {
    color: #1f2937;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* قیمت */
.wc-block-grid__product-price {
    color: #374151;
    font-weight: 700;
    font-size: 18px;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #e5e7eb;
}

.woocommerce-Price-amount {
    color: #1f2937;
    font-weight: 800;
}

.woocommerce-Price-currencySymbol {
    color: #6b7280;
    font-size: 14px;
    margin-left: 5px;
}

/* دکمه‌ها */
.wp-block-button.wc-block-grid__product-add-to-cart {
    margin-top: 15px;
}

.add_to_cart_button {
    background: #2563eb;
    color: white;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    display: block;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.add_to_cart_button:hover {
    background: #1d4ed8;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.add_to_cart_button::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%;
}


@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* انیمیشن */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-block-grid__product {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.wc-block-grid__product:nth-child(1) { animation-delay: 0.1s; }
.wc-block-grid__product:nth-child(2) { animation-delay: 0.2s; }
.wc-block-grid__product:nth-child(3) { animation-delay: 0.3s; }
.wc-block-grid__product:nth-child(4) { animation-delay: 0.4s; }

/* =============================== */
/* صفحه سبد خرید پر */
/* =============================== */
.wc-block-cart.wp-block-woocommerce-filled-cart-block {
    background: white;
    border-radius: 16px;
    overflow: hidden;
}

/* هدر جدول */
.wc-block-cart-items__header {
    background: #f8fafc;
    border-bottom: 2px solid #2563eb;
}

.wc-block-cart-items__header th {
    color: #1f2937;
    font-weight: 700;
    font-size: 16px;
    padding: 20px;
    text-align: right;
}

/* ردیف محصولات */
.wc-block-cart-items__row {
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.wc-block-cart-items__row:hover {
    background: #f8fafc;
}

/* تصویر محصول */
.wc-block-cart-item__image {
    padding: 20px;
}

.wc-block-cart-item__image img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.wc-block-cart-item__image img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* نام محصول */
.wc-block-components-product-name {
    color: #1f2937;
    font-weight: 700;
    font-size: 17px;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.wc-block-components-product-name:hover {
    color: #2563eb;
}

/* قیمت */
.wc-block-components-product-price__value {
    color: #374151;
    font-weight: 700;
    font-size: 17px;
    display: block;
    margin: 10px 0;
}

/* کوانتی */
.wc-block-components-quantity-selector {
    display: flex;
    align-items: center;
}

.wc-block-components-quantity-selector__input {
    width: 70px;
    text-align: center;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
}

.wc-block-components-quantity-selector__input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wc-block-components-quantity-selector__button {
    width: 40px;
    height: 40px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-block-components-quantity-selector__button:hover:not(:disabled) {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-2px);
}

/* دکمه حذف */
.wc-block-cart-item__remove-link {
    color: #dc2626;
    font-size: 14px;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.wc-block-cart-item__remove-link:hover {
    background: #fee2e2;
    padding: 8px 20px;
}

/* سایدبار */
.wc-block-cart__sidebar {
    background: #f8fafc;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #e5e7eb;
    height: fit-content;
}

/* عنوان جمع کل */
.wc-block-cart__totals-title {
    color: #1f2937;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2563eb;
}

/* کوپن تخفیف */
.wc-block-components-panel__button {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    height: 50px;
    padding: 15px !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: right;
}

.wc-block-components-panel__button:hover {
    background: #f3f4f6;
    border-color: #2563eb;
    transform: translateY(-2px);
}

/* قیمت نهایی */
.wc-block-components-totals-footer-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}


.wc-block-components-totals-item__label {
    color: #374151;
    font-weight: 600;
    font-size: 17px;
}

.wc-block-components-totals-item__value {
    color: #1f2937;
    font-weight: 800;
    font-size: 22px;
}

/* دکمه پرداخت */
.wc-block-cart__submit-button {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 18px;
    font-weight: 700;
    font-size: 17px;
    width: 100%;
    display: block;
    text-align: center;
    transition: all 0.3s ease !important;
    cursor: pointer;
    text-decoration: none;
    margin-top: 25px;
    position: relative;
    overflow: hidden;
}

.wc-block-cart__submit-button:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.wc-block-cart__submit-button::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%;
}



.wc-block-components-button__text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 17px;
}

/* =============================== */
/* صفحه پرداخت */
/* =============================== */
.wc-block-checkout.wp-block-woocommerce-checkout {
    background: white;
    border-radius: 16px;
    overflow: hidden;
}

/* فیلدها */
.wc-block-components-checkout-step {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.wc-block-components-checkout-step:hover {
    border-color: #2563eb;
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.05);
}

.wc-block-components-checkout-step__title {
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* فیلدهای ورودی */
.wc-block-components-text-input input,
.wc-blocks-components-select__select {
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.wc-block-components-text-input input:focus,
.wc-blocks-components-select__select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wc-block-components-text-input.is-active label {
    color: #2563eb;
    font-weight: 600;
    transform: translateY(-25px) scale(0.85);
}

/* چک‌باکس */
.wc-block-components-checkbox__input {
    width: 20px;
    height: 20px;
    margin-left: 10px;
}

.wc-block-components-checkbox__label {
    color: #374151;
    font-size: 15px;
}

/* سایدبار پرداخت */
.wc-block-checkout__sidebar {
    background: #f8fafc;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #e5e7eb;
    height: fit-content;
}

.wc-block-components-checkout-order-summary__title {
    color: #1f2937;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2563eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* دکمه ثبت سفارش */
.wc-block-components-checkout-place-order-button {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 18px;
    font-weight: 700;
    font-size: 17px;
    width: 50%;
    display: block;
    text-align: center;
    transition: all 0.3s ease !important;
    cursor: pointer;
    margin-top: 25px;
}

.wc-block-components-checkout-place-order-button:hover {
    background: linear-gradient(135deg, #0da271, #10b981);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

/* =============================== */
/* صفحه حساب کاربری */
/* =============================== */
.woocommerce-MyAccount-navigation {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e5e7eb;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-MyAccount-navigation li {
    margin-bottom: 10px;
}

.woocommerce-MyAccount-navigation a {
    display: block;
    padding: 14px 20px;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.woocommerce-MyAccount-navigation a:hover {
    background: white;
    color: #2563eb;
    border-color: #e5e7eb;
    transform: translateX(5px);
}

.woocommerce-MyAccount-navigation li.is-active a {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.woocommerce-MyAccount-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #e5e7eb;
}

.woocommerce-MyAccount-content p {
    color: #374151;
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 20px;
}

.woocommerce-MyAccount-content strong {
    color: #1f2937;
    font-weight: 700;
}

.woocommerce-MyAccount-content a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.woocommerce-MyAccount-content a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* =============================== */
/* پاسخگویی موبایل */
/* =============================== */
@media (max-width: 768px) {
    .woocommerce-content {
        padding: 20px;
        margin: 15px;
        border-radius: 12px;
    }
    
    .wc-block-grid__products {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .wc-block-cart-items__header th {
        font-size: 14px;
        padding: 12px;
    }
    
    .wc-block-cart-item__image img {
        width: 70px;
        height: 70px;
    }
    
    .wc-block-components-quantity-selector {
        flex-wrap: wrap;
    }
    
    .wc-block-components-checkout-step {
        padding: 20px;
    }
    
    .woocommerce-MyAccount-navigation {
        padding: 15px;
    }
    
    .woocommerce-MyAccount-navigation a {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .woocommerce-MyAccount-content {
        padding: 20px;
    }
}

/* =============================== */
/* انیمیشن‌های کلی */
/* =============================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =============================== */
/* افکت‌های hover */
/* =============================== */
.wc-block-grid__product,
.wc-block-cart-items__row,
.wc-block-components-checkout-step,
.woocommerce-MyAccount-navigation a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================== */
/* اسکرول بار */
/* =============================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

