/* wps-style.css */
/* استایل اصلی پلاگین */
.wps-products-grid {
    display: grid;
    gap: 25px;
    margin: 30px 0;
}

.wps-columns-1 { grid-template-columns: repeat(1, 1fr); }
.wps-columns-2 { grid-template-columns: repeat(2, 1fr); }
.wps-columns-3 { grid-template-columns: repeat(3, 1fr); }
.wps-columns-4 { grid-template-columns: repeat(4, 1fr); }
.wps-columns-5 { grid-template-columns: repeat(5, 1fr); }
.wps-columns-6 { grid-template-columns: repeat(6, 1fr); }

.wps-product-item {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.wps-product-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #007cba;
}

.wps-product-image {
    position: relative;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.wps-product-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wps-product-item:hover .wps-product-image img {
    transform: scale(1.05);
}

/* دکمه ذخیره */
.wps-save-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.wps-save-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #666;
}

.wps-save-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: #007cba;
}

.wps-save-btn.wps-saved {
    color: #007cba;
    background: white;
}

.wps-save-btn svg {
    width: 20px;
    height: 20px;
}

/* بدج‌های محصول */
.wps-out-of-stock-badge,
.wps-sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 5;
}

.wps-out-of-stock-badge {
    background: #dc3232;
    color: white;
}

.wps-sale-badge {
    background: #46b450;
    color: white;
}

/* محتوای محصول */
.wps-product-content {
    padding: 0 5px;
}

.wps-product-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
}

.wps-product-title a {
    color: #2c3338;
    text-decoration: none;
    transition: color 0.3s ease;
}

.wps-product-title a:hover {
    color: #007cba;
}

.wps-product-price {
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #007cba;
}

.wps-product-price del {
    color: #999;
    font-size: 14px;
    margin-left: 8px;
    font-weight: 400;
}

.wps-product-price ins {
    text-decoration: none;
    background: transparent;
}

/* سیستم امتیازدهی */
.wps-rating {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wps-rating-stars {
    display: flex;
    gap: 2px;
}

.wps-star {
    color: #ddd;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

.wps-star.wps-editable:hover {
    color: #ffc107;
    transform: scale(1.2);
}

.wps-star.wps-active {
    color: #ffc107;
}

.wps-rating-info {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wps-average {
    font-weight: 700;
    color: #2c3338;
}

/* دکمه‌های اقدام */
.wps-product-actions {
    margin-top: 15px;
}

.wps-add-to-cart,
.wps-view-product {
    display: block;
    width: 100%;
    background: #007cba;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wps-add-to-cart:hover,
.wps-view-product:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 124, 186, 0.3);
}

.wps-add-to-cart:active,
.wps-view-product:active {
    transform: translateY(0);
}

.wps-out-of-stock {
    display: block;
    width: 100%;
    background: #f8f9fa;
    color: #999;
    border: 1px solid #e5e5e5;
    padding: 14px 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

/* پاگی‌نیشن */
.wps-pagination {
    text-align: center;
    margin-top: 50px;
}

.wps-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    margin: 0 4px;
    border: 2px solid #007cba;
    text-decoration: none;
    color: #007cba;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 45px;
}

.wps-pagination .page-numbers.current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.wps-pagination .page-numbers:hover {
    background: #007cba;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 124, 186, 0.3);
}

.wps-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wps-pagination li {
    margin: 0;
}

/* پیام‌ها */
.wps-message {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 10px;
    color: white;
    z-index: 10000;
    max-width: 350px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    animation: wpsSlideIn 0.3s ease;
}

@keyframes wpsSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.wps-message-success {
    background: linear-gradient(135deg, #46b450, #3a9a43);
}

.wps-message-error {
    background: linear-gradient(135deg, #dc3232, #c02a2a);
}

.wps-message-info {
    background: linear-gradient(135deg, #007cba, #006ba1);
}

/* محصولات ذخیره شده */
.wps-saved-products-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.wps-no-products,
.wps-no-more-products,
.wps-no-saved-products,
.wps-login-required {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    grid-column: 1 / -1;
}

.wps-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* حالت لودینگ */
.wps-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: wpsSpin 1s linear infinite;
    margin-left: 10px;
}

@keyframes wpsSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ریسپانسیو */
@media (max-width: 1200px) {
    .wps-columns-6 { grid-template-columns: repeat(5, 1fr); }
    .wps-columns-5 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 992px) {
    .wps-columns-6,
    .wps-columns-5,
    .wps-columns-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .wps-columns-6,
    .wps-columns-5,
    .wps-columns-4,
    .wps-columns-3 { grid-template-columns: repeat(2, 1fr); }
    
    .wps-product-image img {
        height: 200px;
    }
    
    .wps-product-item {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .wps-products-grid,
    .wps-saved-products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .wps-product-image img {
        height: 220px;
    }
    
    .wps-save-btn {
        width: 38px;
        height: 38px;
    }
    
    .wps-pagination .page-numbers {
        padding: 10px 16px;
        margin: 0 2px;
        font-size: 14px;
        min-width: 40px;
    }
}

/* بهبود نمایش در حالت تاریک */
@media (prefers-color-scheme: dark) {
    .wps-product-item {
        background: #2c3338;
        border-color: #40464d;
    }
    
    .wps-product-title a {
        color: #f0f0f1;
    }
    
    .wps-product-image {
        background: #1d2327;
    }
    
    .wps-out-of-stock {
        background: #1d2327;
        border-color: #40464d;
        color: #a7aaad;
    }
}
/* استایل‌های جدید برای تمپلیت محصول */

/* لینک تصویر محصول */
.wps-product-image-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.wps-product-placeholder {
    width: 100%;
    height: 220px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.wps-placeholder-text {
    color: #999;
    font-size: 14px;
}

/* تولتیپ دکمه ذخیره */
.wps-save-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.wps-save-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.wps-save-btn:hover .wps-save-tooltip {
    opacity: 1;
    visibility: visible;
}

/* بدج‌های محصول */
.wps-product-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 5;
}

.wps-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
    text-align: center;
    line-height: 1;
}

.wps-out-of-stock-badge {
    background: #dc3232;
}

.wps-sale-badge {
    background: #46b450;
}

.wps-featured-badge {
    background: #ffb900;
}

.wps-new-badge {
    background: #007cba;
}

/* overlay محصول */
.wps-product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.wps-product-image:hover .wps-product-overlay {
    opacity: 1;
    visibility: visible;
}

.wps-overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 80%;
}

.wps-quick-view,
.wps-quick-add-to-cart {
    background: white;
    color: #333;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wps-quick-view:hover,
.wps-quick-add-to-cart:hover {
    background: #007cba;
    color: white;
    transform: translateY(-2px);
}

/* محتوای محصول */
.wps-product-excerpt {
    margin: 10px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.wps-product-excerpt p {
    margin: 0;
}

/* وضعیت انبار */
.wps-stock-status {
    margin: 8px 0;
    font-size: 12px;
}

.wps-in-stock {
    color: #46b450;
    font-weight: 600;
}

.wps-low-stock {
    color: #ffb900;
    font-weight: 600;
}

.wps-out-of-stock-text {
    color: #dc3232;
    font-weight: 600;
}

/* دکمه‌های اقدام پیشرفته */
.wps-add-to-cart-btn,
.wps-view-product-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #007cba;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wps-view-product-btn {
    background: #666;
}

.wps-add-to-cart-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 124, 186, 0.3);
}

.wps-view-product-btn:hover {
    background: #555;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 102, 102, 0.3);
}

.wps-btn-loading {
    display: none;
}

.wps-add-to-cart-btn.loading .wps-btn-text {
    opacity: 0;
}

.wps-add-to-cart-btn.loading .wps-btn-loading {
    display: block;
    animation: wpsSpin 1s linear infinite;
}

/* اقدامات برای محصولات ناموجود */
.wps-out-of-stock-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wps-out-of-stock-label {
    text-align: center;
    color: #dc3232;
    font-weight: 600;
    font-size: 14px;
}

.wps-notify-me {
    background: transparent;
    color: #007cba;
    border: 2px solid #007cba;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.wps-notify-me:hover {
    background: #007cba;
    color: white;
}

/* متا اطلاعات */
.wps-product-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
    font-size: 12px;
    color: #666;
}

.wps-product-categories,
.wps-product-tags {
    margin-bottom: 5px;
}

.wps-meta-label {
    font-weight: 600;
    color: #333;
}

.wps-product-categories a,
.wps-product-tags a {
    color: #007cba;
    text-decoration: none;
}

.wps-product-categories a:hover,
.wps-product-tags a:hover {
    text-decoration: underline;
}

/* انیمیشن‌های جدید */
@keyframes wpsBounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0,-8px,0);
    }
    70% {
        transform: translate3d(0,-4px,0);
    }
    90% {
        transform: translate3d(0,-2px,0);
    }
}

.wps-product-item.added-to-cart {
    animation: wpsBounce 0.8s ease;
}

/* بهبود ریسپانسیو */
@media (max-width: 768px) {
    .wps-overlay-actions {
        width: 90%;
    }
    
    .wps-quick-view,
    .wps-quick-add-to-cart {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .wps-product-badges {
        top: 8px;
        right: 8px;
    }
    
    .wps-badge {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .wps-product-excerpt {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .wps-product-meta {
        display: none;
    }
    
    .wps-stock-status {
        font-size: 11px;
    }
}
/* استایل‌های اضافی برای المنتور و بهبود نمایش */

/* حالت لودینگ برای دکمه ذخیره */
.wps-save-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.wps-save-btn.loading svg {
    animation: wpsSpin 1s linear infinite;
}

/* بهبود نمایش در المنتور */
.elementor-widget-wps_products .wps-products-grid {
    width: 100%;
}

/* استایل برای دکمه‌های جدید */
.wps-add-to-cart-btn .wps-btn-loading {
    display: none;
}

.wps-add-to-cart-btn.loading .wps-btn-icon {
    display: none;
}

.wps-add-to-cart-btn.loading .wps-btn-loading {
    display: block;
    animation: wpsSpin 1s linear infinite;
}

/* بهبود ریسپانسیو برای المنتور */
@media (max-width: 768px) {
    .elementor-widget-wps_products .wps-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .elementor-widget-wps_products .wps-products-grid {
        grid-template-columns: 1fr !important;
    }
}

/* تضمین سازگاری با تم‌های مختلف */
.wps-products-grid * {
    box-sizing: border-box;
}

/* بهبود نمایش تولتیپ */
.wps-save-tooltip {
    font-size: 11px;
    white-space: nowrap;
}

/* پشتیبانی از RTL کامل */
.wps-products-grid {
    direction: rtl;
}

.wps-product-item {
    text-align: right;
}

.wps-rating-stars {
    direction: ltr;
}

.wps-pagination ul {
    direction: rtl;
}
/* استایل‌های اضافی برای لودینگ */
.wps-add-to-cart-btn.wps-loading {
    pointer-events: none;
    opacity: 0.8;
}

.wps-btn-loading {
    display: none;
    animation: wpsSpin 1s linear infinite;
}

.wps-add-to-cart-btn.wps-loading .wps-btn-loading {
    display: inline-block;
}

.wps-add-to-cart-btn.wps-loading .wps-btn-icon {
    display: none;
}

@keyframes wpsSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wps-product-item.wps-added-to-cart {
    animation: wpsBounce 0.6s ease;
}

@keyframes wpsBounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0,-10px,0);
    }
    70% {
        transform: translate3d(0,-5px,0);
    }
    90% {
        transform: translate3d(0,-2px,0);
    }
}
/* استایل برای شمارنده سبد خرید */
.cart-count,
.wc-menu-item-cart-count,
.header-cart-count,
.count {
    display: inline-block !important;
    min-width: 20px;
    height: 20px;
    background: #007cba;
    color: white;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    line-height: 20px;
    animation: wpsBounce 0.5s ease;
}

/* انیمیشن برای تغییر شمارنده */
@keyframes wpsCountBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cart-count.updated,
.wc-menu-item-cart-count.updated {
    animation: wpsCountBounce 0.3s ease;
}