/* ═══════════════════════════════════════════════════════════════
   🎨 بخش انتخاب محصولات گروهی - صفحه محصول
   ═══════════════════════════════════════════════════════════════ */

.wgc-product-section {
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin: 20px 0 !important;
}

.wgc-section-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 15px !important;
}

.wgc-section-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.wgc-add-button {
    background: #27ae60 !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.wgc-add-button:hover {
    background: #229954 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3) !important;
}

.wgc-add-button:active {
    transform: translateY(0) !important;
}

/* لیست محصولات انتخابی */
.wgc-selected-products {
    margin-top: 15px !important;
}

.wgc-product-row {
    display: flex !important;
    align-items: center !important;
    padding: 12px !important;
    background: #f9f9f9 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 5px !important;
    margin-bottom: 10px !important;
    position: relative !important;
}

.wgc-remove-button {
    background: #e74c3c !important;
    color: #fff !important;
    border: none !important;
    width: 25px !important;
    height: 25px !important;
    border-radius: 50% !important;
    font-size: 16px !important;
    cursor: pointer !important;
    margin-left: 10px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wgc-remove-button:hover {
    background: #c0392b !important;
    transform: rotate(90deg) !important;
}

.wgc-product-name {
    font-weight: 600 !important;
    color: #333 !important;
    margin-left: 10px !important;
}

.wgc-product-attribute {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.wgc-product-attribute span {
    background: #602aeac9 !important;
    color: #fff !important;
    padding: 3px 8px !important;
    border-radius: 3px !important;
    font-size: 12px !important;
}

/* ═══════════════════════════════════════════════════════════════
   🚀 Global Loader
   ═══════════════════════════════════════════════════════════════ */

#wgc-global-loader {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
}

.wgc-spinner {
    width: 50px !important;
    height: 50px !important;
    border: 4px solid rgba(255, 255, 255, 0.3) !important;
    border-top-color: #fff !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   🔲 پاپ‌آپ انتخاب محصول
   ═══════════════════════════════════════════════════════════════ */

.wgc-popup-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    z-index: 99999 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    animation: fadeIn 0.2s ease-out !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wgc-popup-container {
     width: 95% !important;       /* قبلاً 90% بود */
    max-width: 95vw !important;  /* قبلاً 900px بود */
    max-height: 95vh !important; /* قبلاً 80vh بود */
    background-color: #fff !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    animation: slideIn 0.2s ease-out !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wgc-popup-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 20px !important;
    border-bottom: 1px solid #eee !important;
    background: #f9f9f9 !important;
}

.wgc-popup-title {
    font-size: 18px !important;
    font-weight: 600 !important;
.wgc-popup-close {
    font-size: 24px !important;
    transition: none !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.wgc-popup-close:hover {
    color: #e74c3c !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* ═══════════════════════════════════════════════════════════
   🔍 نوار جستجو
   ═══════════════════════════════════════════════════════════ */

.wgc-popup-search {
    padding: 15px 20px !important;
    background: #fff !important;
    border-bottom: 1px solid #eee !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.wgc-search-input {
    flex: 1 !important;
    padding: 10px 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    transition: border-color 0.3s ease !important;
}

.wgc-search-input:focus {
    outline: none !important;
    border-color: #602aeac9 !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}

.wgc-search-button {
    border: 1px #868b88;
    padding: 10px 20px !important;
}
.wgc-search-button {
	border: 1px #868b88;
    padding: 10px 20px !important;
    background: #ffffff !important;
    color: rgb(75, 75, 75) !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.wgc-search-button:hover {
    background: #4d504d !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3) !important;
}

.wgc-search-button:active {
    transform: translateY(0) !important;
}

.wgc-search-loader {
    text-align: center !important;
    padding: 40px 20px !important;
    display: none !important;
}

.wgc-search-loader .wgc-spinner {
    margin: 0 auto 15px !important;
}

.wgc-search-loader p {
    color: #666 !important;
    font-size: 14px !important;
}

/* ═══════════════════════════════════════════════════════════
   📑 تب‌ها + Pagination
   ═══════════════════════════════════════════════════════════ */

.wgc-popup-tabs {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    border-bottom: 1px solid #eee !important;
    background: #fff !important;
    padding: 0 !important;
}

.wgc-tabs-wrapper {
    display: flex !important;
}

.wgc-tab {
    padding: 12px 20px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    color: #666 !important;
    transition: all 0.3s ease !important;
    border-bottom: 3px solid transparent !important;
    background: transparent !important;
}

.wgc-tab:hover {
    color: #333 !important;
    background: #f9f9f9 !important;
}

.wgc-tab.active {
    border-bottom-color: #602aeac9 !important;
    color: #602aeac9 !important;
    background: #fff !important;
}

.wgc-pagination-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 15px !important;
    margin-left: auto !important;
}

.wgc-page-btn {
    padding: 6px 12px !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    color: #333 !important;
}

.wgc-page-btn:hover:not(:disabled) {
    background: #f5f5f5 !important;
    border-color: #999 !important;
}

.wgc-page-btn:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.wgc-page-info {
    font-size: 13px !important;
    color: #666 !important;
    white-space: nowrap !important;
}

.wgc-current-page {
    font-weight: 600 !important;
    color: #602aeac9 !important;
}

/* ═══════════════════════════════════════════════════════════
   📦 محتوای پاپ‌آپ - ✅ FIX: اسکرول در همه اندازه‌ها
   ═══════════════════════════════════════════════════════════ */
.wgc-popup-content {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 20px !important;
    background: #fafafa !important;
    max-height: calc(80vh - 200px) !important;
    min-height: 400px !important;
}

.wgc-tab-content {
    display: none !important;
}

.wgc-tab-content.active {
    display: block !important;
}

/* ═══════════════════════════════════════════════════════════
   🛍️ گرید محصولات
   ═══════════════════════════════════════════════════════════ */

.wgc-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 12px !important;
    align-content: start !important;  /* ← اضافه کنید */
}


.wgc-product-item {
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
}

.wgc-product-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px) !important;
}

.wgc-product-image {
    margin-bottom: 12px !important;
    text-align: center !important;
    overflow: hidden !important;
    border-radius: 6px !important;
    background: #f5f5f5 !important;
}

.wgc-product-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    transition: opacity 0.3s ease !important;
}

.wgc-product-item img[data-src] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
    background-size: 200% 100% !important;
    animation: shimmer 1.5s infinite !important;
    min-height: 150px !important;
    opacity: 0.6 !important;
}

.wgc-product-item img.loaded {
    opacity: 1 !important;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.wgc-product-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 8px !important;
    min-height: 42px !important;
    line-height: 1.4 !important;
    text-align: center !important;
}

.wgc-product-details {
    font-size: 13px !important;
    color: #666 !important;
    margin-bottom: 12px !important;
    text-align: center !important;
}

.wgc-shared-code {
    display: inline-block !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin-right: 5px !important;
    background: #602aeac9 !important;
}

/* ═══════════════════════════════════════════════════════════
   🎛️ ویژگی‌ها
   ═══════════════════════════════════════════════════════════ */

.wgc-popup-attributes {
    margin: 10px 0 !important;
    min-height: 50px !important;
    text-align: right !important;
}

.wgc-attributes-wrapper {
    text-align: right !important;
}

.wgc-attribute-group {
    margin-bottom: 10px !important;
}
.wgc-attribute-label {
    display: block !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #555 !important;
    margin-bottom: 5px !important;
    text-align: right !important;
}

.wgc-attribute-select {
    width: 100% !important;
    padding: 8px 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    background-color: #fff !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    direction: rtl !important;
}

.wgc-attribute-select:focus {
    outline: none !important;
    border-color: #602aeac9 !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}

.wgc-attribute-select:hover {
    border-color: #bbb !important;
}

.wgc-no-attr {
    font-size: 12px !important;
    color: #999 !important;
    font-style: italic !important;
}

.wgc-loading {
    font-size: 14px !important;
    color: #602aeac9 !important;
}

.wgc-error {
    font-size: 12px !important;
    color: #e74c3c !important;
}

/* ═══════════════════════════════════════════════════════════
   🔘 دکمه‌های محصول
   ═══════════════════════════════════════════════════════════ */

.wgc-product-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: auto !important;
}

.wgc-add-product {
    flex: 1 !important;
    padding: 8px 12px !important;
    background: #27ae60 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.wgc-add-product:hover {
    background: #229954 !important;
    transform: translateY(-1px) !important;
}

.wgc-add-product.wgc-added {
    background: #602aeac9 !important;
}

.wgc-product-actions a {
    padding: 8px 12px !important;
    background: #f5f5f5 !important;
    color: #333 !important;
    text-decoration: none !important;
    border-radius: 5px !important;
    font-size: 13px !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
}

.wgc-product-actions a:hover {
    background: #e0e0e0 !important;
}

.wgc-no-results {
    text-align: center !important;
    padding: 40px 20px !important;
    color: #999 !important;
    font-size: 14px !important;
}

/* ═══════════════════════════════════════════════════════════
   🎨 اسکرول‌بار سفارشی
   ═══════════════════════════════════════════════════════════ */

.wgc-popup-content::-webkit-scrollbar {
    width: 8px !important;
}

.wgc-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
}

.wgc-popup-content::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 4px !important;
}
.wgc-popup-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1 !important;
}

/* ═══════════════════════════════════════════════════════════
   📱 Responsive
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .wgc-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .wgc-tabs-wrapper {
        width: 100% !important;
    }

    .wgc-pagination-wrapper {
        margin-left: 0 !important;
        justify-content: center !important;
        border-top: 1px solid #eee !important;
        padding-top: 12px !important;
        width: 100% !important;
    }

    .wgc-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    }

    .wgc-product-actions {
        flex-direction: column !important;
    }

    .wgc-popup-container {
        width: 100% !important;
        max-height: 90vh !important;
        border-radius: 0 !important;
    }

    .wgc-add-button {
        font-size: 13px !important;
        padding: 9px 14px !important;
    }

    .wgc-product-name {
        font-size: 13px !important;
    }

    .wgc-product-attribute span {
        font-size: 11px !important;
        padding: 2px 6px !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   🔧 فیلدهای مخفی
   ═══════════════════════════════════════════════════════════ */

#wgc-max-products,
#wgc-required-product,
#wgc-required-message {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   🎨 انیمیشن‌ها
   ═══════════════════════════════════════════════════════════ */

@keyframes pulseButton {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.wgc-add-button:focus {
    animation: pulseButton 0.5s ease !important;
}


/* ─────────────────────────────────────────────────────────────
   هدر بخش (عنوان + دکمه افزودن)
   ───────────────────────────────────────────────────────────── */

.wgc-product-section .wgc-section-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 15px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.wgc-product-section .wgc-section-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* دکمه افزودن - با Specificity بالاتر */
.wgc-product-section button.wgc-add-button,
button.wgc-add-button {
    background: #27ae60 !important;
    background-color: #27ae60 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    text-decoration: none !important;
    text-transform: none !important;
}
    letter-spacing: normal !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    outline: none !important;
}

.wgc-product-section button.wgc-add-button:hover,
button.wgc-add-button:hover {
    background: #229954 !important;
    background-color: #229954 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3) !important;
}

.wgc-product-section button.wgc-add-button:active,
button.wgc-add-button:active {
    transform: translateY(0) !important;
    background: #1e8449 !important;
}

.wgc-product-section button.wgc-add-button:focus,
button.wgc-add-button:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2) !important;
}

/* ─────────────────────────────────────────────────────────────
   لیست محصولات انتخابی
   ───────────────────────────────────────────────────────────── */

.wgc-selected-products {
    min-height: 40px !important;
}

.wgc-selected-products:empty {
    display: none !important;
}

/* ردیف هر محصول */
.wgc-product-row {
    display: flex !important;
    align-items: center !important;
    background: #fafafa !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
    padding: 10px 12px !important;
    margin-bottom: 8px !important;
    transition: all 0.3s ease !important;
}

.wgc-product-row:hover {
    background: #f5f5f5 !important;
    border-color: #d0d0d0 !important;
}

.wgc-product-row:last-child {
    margin-bottom: 0 !important;
}

/* دکمه حذف */
.wgc-product-row button.wgc-remove-button,
button.wgc-remove-button {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    background-color: #fff !important;
    border: 1px solid #e74c3c !important;
    border-radius: 4px !important;
    color: #e74c3c !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    margin-left: 10px !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.wgc-product-row button.wgc-remove-button:hover,
button.wgc-remove-button:hover {
    background: #e74c3c !important;
    background-color: #e74c3c !important;
    color: #fff !important;
    transform: scale(1.1) !important;
}

/* نام محصول */
.wgc-product-name {
    flex-grow: 1 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #333 !important;
    line-height: 1.4 !important;
}

/* ویژگی‌های محصول */
.wgc-product-attribute {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 6px !important;
}

.wgc-product-attribute span {
    font-size: 12px !important;
    color: #666 !important;
    background: #fff !important;
    padding: 3px 8px !important;
    border-radius: 3px !important;
    border: 1px solid #e0e0e0 !important;
}
/* ═══════════════════════════════════════════════════════════════
   🚀 Global Loader
   ═══════════════════════════════════════════════════════════════ */

#wgc-global-loader {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    pointer-events: all !important;
}

#wgc-global-loader.hidden {
    display: none !important;
    pointer-events: none !important;
}

.wgc-spinner {
    width: 50px !important;
    height: 50px !important;
    border: 4px solid rgba(255, 255, 255, 0.3) !important;
    border-top-color: #fff !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* برای جلوگیری از کلیک روی پس‌زمینه هنگام نمایش لودر */
body.wgc-loading {
    overflow: hidden !important;
}

body.wgc-loading::before {
    content: "" !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 99999 !important;
}

/* ═══════════════════════════════════════════════════════════════
   🎯 بهبود تجربه کاربری در صفحه محصول
   ═══════════════════════════════════════════════════════════════ */

/* جلوگیری از خراب شدن چیدمان در کنار سایر المان‌ها */
.wgc-product-section {
    position: relative !important;
    z-index: 1 !important;
}

/* تنظیم فاصله با سایر باکس‌ها در قالب */
.single-product .wgc-product-section {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
}

/* تراز بهتر دکمه افزودن در موبایل */
@media (max-width: 480px) {
    .wgc-product-section .wgc-section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .wgc-product-section button.wgc-add-button {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ─────────────────────────────────────────────────────────────
   استایل‌های کمکی
   ───────────────────────────────────────────────────────────── */

/* متن راهنما در پایین بخش */
.wgc-product-section .wgc-helper-text {
    font-size: 12px !important;
    color: #777 !important;
    margin-top: 8px !important;
}

/* خط جداکننده ملایم */
.wgc-product-section .wgc-divider {
    height: 1px !important;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent) !important;
    margin: 15px 0 !important;
}

/* آیکون کوچک در کنار عنوان */
.wgc-product-section .wgc-section-title .dashicons {
    font-size: 18px !important;
    vertical-align: middle !important;
    margin-left: 4px !important;
    color: #602aeac9 !important;
}

/* ─────────────────────────────────────────────────────────────
   حالت‌های خالی و خطا
   ───────────────────────────────────────────────────────────── */

.wgc-product-section .wgc-empty-state {
    text-align: center !important;
    font-size: 13px !important;
    color: #999 !important;
    padding: 10px 0 !important;
}

.wgc-product-section .wgc-error-message {
    font-size: 13px !important;
    color: #e74c3c !important;
    margin-top: 8px !important;
}

/* ─────────────────────────────────────────────────────────────
   بهبود ریسپانسیو برای بخش انتخاب‌شده‌ها
   ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .wgc-product-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }

    .wgc-product-row button.wgc-remove-button {
        align-self: flex-end !important;
    }

    .wgc-product-name {
        font-size: 13px !important;
    }

    .wgc-product-attribute span {
        font-size: 11px !important;
    }
}
}

.wgc-search-loader .wgc-spinner {
    margin: 0 auto 15px !important;
}

.wgc-search-loader p {
    color: #666 !important;
    font-size: 14px !important;
}

/* ═══════════════════════════════════════════════════════════
   📑 تب‌ها + Pagination در یک ردیف
   ═══════════════════════════════════════════════════════════ */

.wgc-popup-tabs {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    border-bottom: 1px solid #eee !important;
    background: #fff !important;
    padding: 0 !important;
}

/* تب‌ها در سمت راست */
.wgc-tab {
    padding: 12px 20px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    color: #666 !important;
    transition: all 0.3s ease !important;
    border-bottom: 3px solid transparent !important;
    background: transparent !important;
}

.wgc-tab:hover {
    color: #333 !important;
    background: #f9f9f9 !important;
}

.wgc-tab.active {
    border-bottom-color: #602aeac9 !important;
    color: #602aeac9 !important;
    background: #fff !important;
}

/* Pagination در سمت چپ (انتهای ردیف) */
.wgc-pagination-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 15px !important;
    margin-right: auto !important; /* ✅ این خط کلیدی است */
}

.wgc-page-btn {
    padding: 6px 12px !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    color: #333 !important;
}

.wgc-page-btn:hover:not(:disabled) {
    background: #f5f5f5 !important;
    border-color: #999 !important;
}

.wgc-page-btn:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.wgc-page-info {
    font-size: 13px !important;
    color: #666 !important;
    white-space: nowrap !important;
}

.wgc-current-page {
    font-weight: 600 !important;
    color: #602aeac9 !important;
}

/* ═══════════════════════════════════════════════════════════
   📱 Responsive برای موبایل
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .wgc-popup-tabs {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .wgc-pagination-wrapper {
        margin-right: 0 !important;
        justify-content: center !important;
        border-top: 1px solid #eee !important;
        padding-top: 12px !important;
        width: 100% !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   🛍️ گرید محصولات در پاپ‌آپ
   ═══════════════════════════════════════════════════════════════ */

wgc-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 12px !important;
}

.wgc-product-item {
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
}

.wgc-product-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px) !important;
}

/* تصویر محصول */
.wgc-product-image {
    margin-bottom: 12px !important;
    text-align: center !important;
    overflow: hidden !important;
    border-radius: 6px !important;
    background: #f5f5f5 !important;
}

.wgc-product-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    transition: opacity 0.3s ease !important;
}

/* 🖼️ Lazy Loading Images */
.wgc-product-item img[data-src] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
    background-size: 200% 100% !important;
    animation: shimmer 1.5s infinite !important;
    min-height: 150px !important;
    opacity: 0.6 !important;
}

.wgc-product-item img.loaded {
    opacity: 1 !important;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* عنوان محصول */
.wgc-product-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 8px !important;
    min-height: 42px !important;
    line-height: 1.4 !important;
    text-align: center !important;
}

/* جزئیات محصول */
.wgc-product-details {
    font-size: 13px !important;
    color: #666 !important;
    margin-bottom: 12px !important;
    text-align: center !important;
}

/* کد اشتراکی */
.wgc-shared-code {
    display: inline-block !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin-right: 5px !important;
    background: #602aeac9 !important;
}

/* ═══════════════════════════════════════════════════════════════
   🎛️ ویژگی‌ها (Attributes)
   ═══════════════════════════════════════════════════════════════ */

.wgc-popup-attributes {
    margin: 10px 0 !important;
    min-height: 50px !important;
    text-align: right !important;
}

.wgc-attributes-wrapper {
    text-align: right !important;
}

.wgc-attribute-group {
    margin-bottom: 10px !important;
}

.wgc-attribute-label {
    display: block !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #555 !important;
    margin-bottom: 5px !important;
    text-align: right !important;
}

.wgc-attribute-select {
    width: 100% !important;
    padding: 8px 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    background-color: #fff !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    direction: rtl !important;
}

.wgc-attribute-select:focus {
    outline: none !important;
    border-color: #602aeac9 !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}
.wgc-attribute-select:hover {
    border-color: #bbb !important;
}

.wgc-no-attr {
    font-size: 12px !important;
    color: #999 !important;
    font-style: italic !important;
}

.wgc-loading {
    font-size: 14px !important;
    color: #602aeac9 !important;
}

.wgc-error {
    font-size: 12px !important;
    color: #e74c3c !important;
}

/* ═══════════════════════════════════════════════════════════════
   🔘 دکمه‌های محصول در کارت
   ═══════════════════════════════════════════════════════════════ */

.wgc-product-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: auto !important;
}

.wgc-add-product {
    flex: 1 !important;
    padding: 8px 12px !important;
    background: #27ae60 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.wgc-add-product:hover {
    background: #229954 !important;
    transform: translateY(-1px) !important;
}

.wgc-add-product.wgc-added {
    background: #602aeac9 !important;
}

.wgc-product-actions a {
    padding: 8px 12px !important;
    background: #f5f5f5 !important;
    color: #333 !important;
    text-decoration: none !important;
    border-radius: 5px !important;
    font-size: 13px !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
}

.wgc-product-actions a:hover {
    background: #e0e0e0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   🔎 وضعیت‌ها: بدون نتیجه، لودینگ، خطا
   ═══════════════════════════════════════════════════════════════ */

.wgc-no-results {
    text-align: center !important;
    padding: 40px 20px !important;
    color: #999 !important;
    font-size: 14px !important;
}

/* برای هماهنگی کامل، در صورت نیاز می‌توانید استایل‌های زیر را نیز تنظیم کنید: */

.wgc-search-loader {
    text-align: center !important;
    padding: 40px 20px !important;
    display: none !important;
}

.wgc-search-loader .wgc-spinner {
    margin: 0 auto 15px !important;
}

.wgc-search-loader p {
    color: #666 !important;
    font-size: 14px !important;
}
/* عناصر مختلف */
.wgc-popup-search,
.wgc-popup-tabs,
.wgc-popup-content {
    direction: rtl !important;
    text-align: right !important;
}

/* ورودی جستجو */
.wgc-search-input {
    direction: rtl !important;
    text-align: right !important;
}

/* برچسب‌ها و متن‌ها */
.wgc-popup-title,
.wgc-product-title,
.wgc-product-details,
.wgc-attribute-label,
.wgc-no-attr,
.wgc-loading,
.wgc-error,
.wgc-no-results,
.wgc-page-info {
    direction: rtl !important;
    text-align: right !important;
}

/* تراز محتوای محصولات در تب */
.wgc-product-item {
    direction: rtl !important;
}

/* ویژگی‌ها */
.wgc-popup-attributes,
.wgc-attributes-wrapper,
.wgc-attribute-group {
    direction: rtl !important;
    text-align: right !important;
}

/* ردیف محصولات انتخاب‌شده */
.wgc-product-row {
    direction: rtl !important;
}

/* پیام‌های خالی و خطا در بخش اصلی */
.wgc-product-section .wgc-empty-state,
.wgc-product-section .wgc-error-message {
    direction: rtl !important;
    text-align: right !important;
}

/* وضعیت لودینگ در بخش اصلی */
.wgc-product-section .wgc-loading,
.wgc-product-section .wgc-error {
    direction: rtl !important;
    text-align: right !important;
}


/* ═══════════════════════════════════════════════════════════════
   بخش ۱۲ - بهبودهای جزئی و سازگاری با قالب
   ═══════════════════════════════════════════════════════════════ */

.wgc-product-section {
    box-sizing: border-box !important;
}

/* جلوگیری از تداخل با کلاس‌های عمومی قالب */
.wgc-product-section * {
    box-sizing: border-box !important;
}

/* اطمینان از اینکه دکمه‌ها شبیه دکمه‌های WooCommerce هستند */
.wgc-add-product,
.wgc-add-button {
    font-family: inherit !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    border-radius: 4px !important;
}

/* هماهنگی سایز فونت با بدنه سایت */
.wgc-product-section,
.wgc-popup-container {
    font-size: 14px !important;
}

/* بهبود نمایش در حالت Dark Mode احتمالی (در برخی قالب‌ها) */
@media (prefers-color-scheme: dark) {
    .wgc-popup-container {
        background: #1f1f1f !important;
        color: #f5f5f5 !important;
    }

    .wgc-popup-header {
        background: #2a2a2a !important;
        border-bottom-color: #3a3a3a !important;
    }

    .wgc-popup-search {
        background: #1f1f1f !important;
        border-bottom-color: #333 !important;
    }

    .wgc-search-input {
        background: #2a2a2a !important;
        border-color: #444 !important;
        color: #f5f5f5 !important;
    }

    .wgc-search-input::placeholder {
        color: #aaa !important;
    }

    .wgc-product-item {
        background: #2a2a2a !important;
        border-color: #3a3a3a !important;
    }

    .wgc-product-row {
        background: #2a2a2a !important;
        border-color: #3a3a3a !important;
    }
}

    animation: pulseButton 0.5s ease !important;
}
/* ═══════════════════════════════════════════════════════════════════════
   🔔 استایل ناتیف سفارشی سازگار با Woodmart
   ═══════════════════════════════════════════════════════════════════════ */
.wgc-add-button:focus {
    animation: pulseButton 0.5s ease !important;
}
    // ═══════════════════════════════════════════════════════════
    // 🔍 جستجوی Ajax لحظه‌ای + Pagination
    // ═══════════════════════════════════════════════════════════
    var currentPage = 1;
    var searchQuery = '';
    var searchTimeout = null;

    // ✅ کلیک روی دکمه جستجو
    $(document).on('click', '.wgc-search-button', function() {
        performSearch();
    });

    // ✅ Enter در نوار جستجو
    $(document).on('keypress', '#wgc-search-input', function(e) {
        if (e.which === 13) {
            e.preventDefault();
            performSearch();
        }
    });

    // ✅ جستجوی لحظه‌ای (با تاخیر 500ms)
    $(document).on('input', '#wgc-search-input', function() {
        var query = $(this).val().trim();
        
        clearTimeout(searchTimeout);
        
        if (query.length >= 2) {
            searchTimeout = setTimeout(function() {
                searchQuery = query;
                currentPage = 1;
                loadProducts();
            }, 500);
        } else if (query.length === 0) {
            searchQuery = '';
            currentPage = 1;
            loadProducts();
        }
    });

    // ✅ دکمه صفحه بعد
    $(document).on('click', '.wgc-next-page', function() {
        if (!$(this).prop('disabled')) {
            currentPage++;
            loadProducts();
        }
    });

    // ✅ دکمه صفحه قبل
    $(document).on('click', '.wgc-prev-page', function() {
        if (!$(this).prop('disabled')) {
            currentPage--;
            loadProducts();
        }
    });

    // ✅ تابع جستجو
    function performSearch() {
        searchQuery = $('#wgc-search-input').val().trim();
        currentPage = 1;
        loadProducts();
    }

    // ✅ تابع بارگذاری محصولات
    function loadProducts() {
        var $grid = $('.wgc-tab-content-shop .wgc-products-grid');
        var $loader = $('.wgc-search-loader');
        
        $loader.fadeIn(150);
        $grid.css('opacity', '0.5');

        $.ajax({
            url: wgc_data.ajax_url,
            type: 'POST',
            data: {
                action: 'wgc_search_products',
                nonce: wgc_data.nonce,
                search: searchQuery,
                page: currentPage,
                categories: window.wgcPopupSettings.shopCategories
            },
            success: function(response) {
                if (response.success) {
                    $grid.html(response.data.html);
                    
                    $('.wgc-current-page').text(response.data.current_page);
                    $('.wgc-total-pages').text(response.data.total_pages);
                    
                    $('.wgc-prev-page').prop('disabled', response.data.current_page <= 1);
                    $('.wgc-next-page').prop('disabled', response.data.current_page >= response.data.total_pages);
                    
                    enableLazyLoadImages();
                    loadPopupAttributesBulk();
                    
                    console.log('✅ محصولات بارگذاری شدند:', response.data.found_posts, 'محصول');
                } else {
                    $grid.html('<p class="wgc-no-results">خطا در بارگذاری محصولات</p>');
                }
            },
            error: function() {
                $grid.html('<p class="wgc-no-results">خطا در ارتباط با سرور</p>');
            },
            complete: function() {
                $loader.fadeOut(200);
                $grid.css('opacity', '1');
            }
        });
    }

    // ✅ ریست کردن جستجو هنگام تعویض تب
    $(document).on('click', '.wgc-tab', function() {
        var targetTab = $(this).data('tab');
        
        if (targetTab === 'shop') {
            $('#wgc-search-input').val('');
            searchQuery = '';
            currentPage = 1;
            loadProducts();
        }
    });

/* ═══════════════════════════════════════════════════════════════
   🔔 نوتیفیکیشن اختصاصی برای خطاها و پیام‌ها
   ═══════════════════════════════════════════════════════════════ */

.wgc-custom-notice {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    min-width: 280px;
    max-width: 380px;
    background: #ffffff;
    color: #333333;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    direction: rtl;
    border-left: 4px solid #2271b1;
    animation: wgc-notice-slide-in 0.3s ease-out;
}

.wgc-notice-success {
    border-left-color: #28a745;
}

.wgc-notice-error {
    border-left-color: #dc3545;
}

.wgc-notice-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.wgc-notice-content {
    flex: 1;
}

.wgc-notice-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.wgc-notice-message {
    font-size: 12px;
    color: #555555;
    margin: 0;
}

.wgc-notice-close {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999999;
    padding: 0 4px;
}

.wgc-notice-close:hover {
    color: #555555;
}

@keyframes wgc-notice-slide-in {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

#wgc-notice-wrapper {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 380px;
    pointer-events: none;
}

#wgc-notice-wrapper .wgc-custom-notice {
    pointer-events: auto;
}

.wgc-minimal-btn {
    background: transparent;
    border: none;
    color: #2271b1;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    text-decoration: underline;
}

/* پایان استایل‌های اختصاصی Woo Group Connect */
/* ═══════════════════════════════════════════════════════════════
   🎨 WGC POPUP — نسخه بازسازی‌شده
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.wgc-popup-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.55) !important;
    z-index: 99999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(3px) !important;
}
.wgc-popup-overlay.active {
    display: flex !important;
}

/* ── Container ── */
.wgc-popup-container {
    background: #f4f6f8 !important;
    border-radius: 14px !important;
    width: 95% !important;       /* قبلاً 90% بود */
    max-width: 95vw !important;  /* قبلاً 900px بود */
    max-height: 95vh !important; /* قبلاً 80vh بود */
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25) !important;
    direction: rtl !important;
    font-family: inherit !important;
}

/* ══════════════════════════════════════════════════════════════
   هدر
   ══════════════════════════════════════════════════════════════ */
.wgc-popup-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 18px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    flex-shrink: 0 !important;
}

/* تب‌ها */
.wgc-tabs-wrapper {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
}

.wgc-tab {
    padding: 7px 18px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    color: #6b7280 !important;
    background: #f3f4f6 !important;
    border: 1.5px solid transparent !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    user-select: none !important;
}

.wgc-tab:hover {
    background: #e5e7eb !important;
    color: #374151 !important;
}

.wgc-tab.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
}


/* ══════════════════════════════════════════════════════════════
   نوار جستجو (ثابت)
   ══════════════════════════════════════════════════════════════ */
.wgc-popup-search {
    display: flex !important;
    gap: 10px !important;
    padding: 12px 18px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    flex-shrink: 0 !important;
}

.wgc-search-inner {
    flex: 1 !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.wgc-search-icon {
    position: absolute !important;
    right: 12px !important;
    color: #9ca3af !important;
    pointer-events: none !important;
}

.wgc-search-input {
    width: 100% !important;
    padding: 9px 38px 9px 36px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    outline: none !important;
    transition: border-color 0.2s !important;
    background: #f9fafb !important;
    direction: rtl !important;
    color: #1f2937 !important;
}
.wgc-search-input:focus {
    border-color: #2563eb !important;
    background: #fff !important;
}

.wgc-search-clear {
    position: absolute !important;
    left: 10px !important;
    background: none !important;
    border: none !important;
    font-size: 18px !important;
    color: #9ca3af !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
}
.wgc-search-clear:hover { color: #dc2626 !important; }

.wgc-search-button {
    padding: 9px 20px !important;
    background: #2563eb !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: background 0.2s !important;
    flex-shrink: 0 !important;
}
.wgc-search-button:hover { background: #1d4ed8 !important; }

/* ══════════════════════════════════════════════════════════════
   بدنه پاپ‌آپ (فقط این بخش اسکرول می‌شود)
   ══════════════════════════════════════════════════════════════ */
.wgc-popup-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 18px !important;
    padding-bottom: 30px !important;
    scroll-behavior: smooth !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
}

.wgc-popup-overlay {
    overflow: hidden !important;
}

/* اطمینان از نمایش کامل دکمه افزودن */
.wgc-product-item .wgc-product-actions {
    padding-bottom: 12px !important;
    padding-top: 8px !important;
}
.wgc-popup-body::-webkit-scrollbar { width: 6px !important; }
.wgc-popup-body::-webkit-scrollbar-track { background: #f1f5f9 !important; }
.wgc-popup-body::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 3px !important;
}

/* ── Tab Content ── */
.wgc-tab-content { display: none !important; }
.wgc-tab-content.active { display: block !important; }

/* ══════════════════════════════════════════════════════════════
   فوتر: Pagination (ثابت)
   ══════════════════════════════════════════════════════════════ */
.wgc-popup-footer {
    padding: 12px 18px !important;
    background: #ffffff !important;
    border-top: 1px solid #e5e7eb !important;
    flex-shrink: 0 !important;
}

.wgc-pagination-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
}

.wgc-page-btn {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 7px 16px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #374151 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}
.wgc-page-btn:hover:not(:disabled) {
    background: #2563eb !important;
    color: #fff !important;
    border-color: #2563eb !important;
}
.wgc-page-btn:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.wgc-page-info {
    font-size: 13px !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
}

/* ══════════════════════════════════════════════════════════════
   🛍️ گرید محصولات
   ══════════════════════════════════════════════════════════════ */
.wgc-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 12px !important;
    align-content: start !important;  /* ← اضافه کنید */
}

/* ══════════════════════════════════════════════════════════════
   🃏 کارت محصول
   ══════════════════════════════════════════════════════════════ */
.wgc-product-item {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    transition: box-shadow 0.25s ease, transform 0.25s ease !important;
}
.wgc-product-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.10) !important;
    transform: translateY(-3px) !important;
}

/* ── تصویر ── */
.wgc-product-image {
    position: relative !important;
    overflow: hidden !important;
    background: #f3f4f6 !important;
    aspect-ratio: 1 / 1 !important;
    cursor: pointer !important;
}
.wgc-product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.3s ease, opacity 0.3s ease !important;
    opacity: 0 !important;
}
.wgc-product-image img.loaded {
    opacity: 1 !important;
}
.wgc-product-image:hover img {
    transform: scale(1.05) !important;
}

/* ── آیکون ذره‌بین (همیشه نمایان، گوشه چپ-بالا) ── */
.wgc-zoom-btn {
    position: absolute !important;
    left: 8px !important;
    top: 8px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 999px !important;
    border: none !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(4px) !important;  /* افکت شیشه‌ای */
    color: #6b6b6b !important;
    cursor: pointer !important;

       opacity: 1 !important;
    transition: none !important;
    z-index: 2 !important;
}

.wgc-zoom-btn svg {
    width: 16px !important;
    height: 16px !important;
    stroke: #d1d1d1 !important;  /* رنگ مشکی */
}

/* حذف تغییرات hover */
.wgc-product-image:hover .wgc-zoom-btn,
.wgc-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    color: #c0c0c0 !important;
    transform: none !important;
}

/* ── کادر قیمت/SKU روی تصویر ── */
.wgc-image-badge {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    background: rgba(255,255,255,0.92) !important;
    backdrop-filter: blur(4px) !important;
    padding: 5px 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
}
.wgc-badge-price {
    font-size: 12.5px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    white-space: nowrap !important;
}
.wgc-badge-sku {
    font-size: 11px !important;
    color: #6b7280 !important;
    background: #f3f4f6 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 80px !important;
}
.wgc-badge-code {
    font-size: 11px !important;
    color: #fff !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
}

/* ── عنوان محصول ── */
.wgc-product-title {
    display: block !important;
    padding: 10px 12px 4px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}
.wgc-product-title:hover {
    color: #2563eb !important;
    text-decoration: underline !important;
}

/* ── ویژگی‌ها ── */
.wgc-popup-attributes {
    padding: 6px 12px !important;
    flex: 1 !important;
}
.wgc-popup-attributes select {
    width: 100% !important;
    padding: 6px 10px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 7px !important;
    font-size: 12.5px !important;
    background: #f9fafb !important;
    color: #374151 !important;
    margin-bottom: 5px !important;
    cursor: pointer !important;
    outline: none !important;
}
.wgc-popup-attributes select:focus {
    border-color: #2563eb !important;
}

/* spinner کوچک برای لود ویژگی */
.wgc-spinner-sm {
    display: inline-block !important;
    width: 14px !important;
    height: 14px !important;
    border: 2px solid #e5e7eb !important;
    border-top-color: #2563eb !important;
    border-radius: 50% !important;
    animation: wgc-spin 0.7s linear infinite !important;
}
@keyframes wgc-spin {
    to { transform: rotate(360deg); }
}

/* ── دکمه‌های اکشن ── */
.wgc-product-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 10px 12px !important;
    border-top: 1px solid #f3f4f6 !important;
    flex-wrap: wrap !important;
}

/* دکمه افزودن */
.wgc-btn-add {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 8px 10px !important;
    background: #2563eb !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    min-width: 0 !important;
}
.wgc-btn-add:hover { background: #1d4ed8 !important; }
.wgc-btn-add:active { transform: scale(0.97) !important; }

/* دکمه پرینت */
.wgc-btn-print {
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #374151 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    flex-shrink: 0 !important;
}
.wgc-btn-print:hover {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #fff !important;
}

/* ── Lazy Loading (shimmer) ── */
.wgc-lazy-img:not(.loaded) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
    background-size: 200% 100% !important;
    animation: wgc-shimmer 1.5s infinite !important;
}
@keyframes wgc-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── No Results ── */
.wgc-no-results {
    text-align: center !important;
    color: #6b7280 !important;
    padding: 40px 20px !important;
    font-size: 14px !important;
    grid-column: 1 / -1 !important;
}

/* ══════════════════════════════════════════════════════════════
   🔍 Modal بزرگ‌نمایی تصویر
   ══════════════════════════════════════════════════════════════ */
.wgc-zoom-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
     display: none;
    align-items: center !important;
    justify-content: center !important;
}
.wgc-zoom-modal-overlay {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.75) !important;
    cursor: pointer !important;
}
.wgc-zoom-modal-content {
    position: relative !important;
    z-index: 1 !important;
    background: #fff !important;
    border-radius: 12px !important;
    padding: 16px !important;
    max-width: min(520px, 92vw) !important;
    width: 100% !important;
    text-align: center !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
}
.wgc-zoom-modal-content img {
    width: 100% !important;
    border-radius: 8px !important;
    max-height: 70vh !important;
    object-fit: contain !important;
}
.wgc-zoom-modal-content p {
    margin: 10px 0 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #111827 !important;
}
.wgc-zoom-modal-close {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: none !important;
    background: #f3f4f6 !important;
    color: #374151 !important;
    font-size: 18px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}
.wgc-zoom-modal-close:hover { background: #fee2e2 !important; color: #dc2626 !important; }

/* ══════════════════════════════════════════════════════════════
   📱 Responsive — Mobile
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .wgc-popup-container {
        width: 95% !important;       /* قبلاً 100% بود */
        max-width: 95vw !important;  /* اضافه کن */
        max-height: 95vh !important; /* قبلاً 90vh بود */
        border-radius: 0 !important;
    }
    .wgc-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
		align-content: start !important;  /* ← اضافه کنید */

    }
    .wgc-popup-body { padding: 12px !important; }
    .wgc-product-title { font-size: 12px !important; }
}

@media (max-width: 480px) {
    .wgc-products-grid {
        grid-template-columns: 1fr !important;
		align-content: start !important;  /* ← اضافه کنید */

    }
    .wgc-popup-header { padding: 10px 14px !important; }
    .wgc-popup-search { padding: 10px 14px !important; }
}
/* ========== دکمه‌های آیکونی کوچک در پاپ‌آپ ========== */

.wgc-product-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: auto !important;
    direction: rtl !important;
}
/* دکمه افزودن - استفاده از استایل موجود با تنظیمات جدید */
.wgc-product-actions .wgc-add-product {
    flex: 1 !important;
    min-height: 44px !important;
}
/* فلش سفارشی برای select های پاپ‌آپ */
.wgc-attribute-select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23666" d="M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: left 10px center !important;
    background-size: 12px !important;
    
    padding-left: 30px !important;
    padding-right: 10px !important;
}
/* ── حذف فاصله‌ها و چسباندن تصویر به لبه کارت ── */

.wgc-product-item {
    padding: 0 !important;
    overflow: hidden !important;   /* گوشه‌ها گرد بمانند */
}

/* تصویر کاملاً به لبه بچسبه */
.wgc-product-image {
    border-radius: 0 !important;
    margin-bottom: 0 !important;
}

/* فاصله محتوای داخلی زیر تصویر */
.wgc-product-item .wgc-product-title,
.wgc-product-item .wgc-popup-attributes,
.wgc-product-item .wgc-product-actions {
    padding: 0 10px !important;
}

/* اولین آیتم (عنوان) کمی فاصله از تصویر داشته باشه */
.wgc-product-item .wgc-product-title {
    padding-top: 8px !important;
}

/* آخرین آیتم (دکمه‌ها) کمی فاصله از پایین داشته باشه */
.wgc-product-item .wgc-product-actions {
    padding-bottom: 10px !important;
	padding-top: 5px !important;
}

/* حذف فضای اضافی .fpf-fields پلاگین دیگه */
.wgc-product-item .fpf-fields.after-add-to-cart {
    display: none !important;
}
/* ── Zoom Modal: fullscreen ── */
#wgc-zoom-modal {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    align-items: center !important;
    justify-content: center !important;
}

#wgc-zoom-modal.active,
#wgc-zoom-modal[style*="display: block"],
#wgc-zoom-modal[style*="display:block"] {
    display: flex !important;
}

#wgc-zoom-modal-img {
    max-width: 800px;
    max-height: 800px;
    width: auto;
    height: auto;
    object-fit: contain;
}


.wgc-zoom-modal-close {
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    z-index: 1000000 !important;
    background: rgba(255,255,255,0.15) !important;
    border: none !important;
    color: #fff !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    font-size: 22px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(4px) !important;
    transition: background 0.2s !important;
}

.wgc-zoom-modal-close:hover {
    background: rgba(255,255,255,0.3) !important;
}
/* استایل دکمه بستن لایت‌باکس (×) */
.wgc-lightbox-close {
    position: absolute !important;
    top: 20px !important;
    right: 30px !important;
    color: #fff !important;
    font-size: 45px !important;
    cursor: pointer !important;
    background-color: transparent !important;
    text-shadow: none !important;
    transition: none !important;
    line-height: 1 !important;
    padding: 0 !important;
    border: none !important;
}

.wgc-lightbox-close:hover {
    color: red !important;
}
.wgc-wsp-size-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 10px 8px;
}
.wgc-wsp-size-button {
    width: 100%;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    transition: all 0.2s ease;
}
.wgc-wsp-size-button:hover {
    background: #fafafa;
    border-color: #bfbfbf;
}
.wgc-wsp-size-summary .wsp-size-values {
    justify-content: center;
    gap: 6px;
}
.wgc-wsp-size-summary .wsp-size-value {
    font-size: 15px !important;
}
.wgc-wsp-size-summary .wsp-selected-info-display {
    margin: 6px 0 0 !important;
    padding: 0 !important;
    border: none !important;
    text-align: center !important;
}
.wgc-wsp-size-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 10px 16px !important;
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
}
.wgc-wsp-size-button:hover {
    background: #fafafa !important;
    border-color: #d0d0d0 !important;
}
.wgc-wsp-size-button .wsp-button-icon i {
    font-size: 15px;
    color: #333;
}
.wgc-wsp-size-button .wsp-button-text {
    font-size: 12.5px !important;
    font-weight: 500 !important;
    color: #444 !important;
    white-space: nowrap;
}
.wgc-row-flex {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    direction: rtl !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    margin-bottom: 8px !important;
}

/* دکمه + تصویر همیشه کنار هم */
.wgc-row-media {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.wgc-row-thumb {
    width: 48px !important;
    height: 48px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    border: 1px solid #e5e7eb !important;
    flex-shrink: 0 !important;
}

.wgc-row-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.wgc-row-info .wgc-product-name {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
}

.wgc-row-info .wgc-product-attribute {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
}

.wgc-row-info .wgc-product-attribute span {
    font-size: 11.5px !important;
    color: #374151 !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    padding: 2px 8px !important;
    border-radius: 5px !important;
    white-space: nowrap !important;
}

.wgc-row-info .wgc-product-attribute span strong {
    color: #2563eb !important;
}

.wgc-product-wsp-summary {
    font-size: 11px !important;
    color: #555 !important;
    line-height: 1.6 !important;
    word-break: break-word !important;
}

/* موبایل */
@media (max-width: 600px) {
    .wgc-row-thumb {
        width: 40px !important;
        height: 40px !important;
    }
    .wgc-row-info .wgc-product-name {
        font-size: 12px !important;
    }
    .wgc-row-info .wgc-product-attribute span {
        font-size: 10.5px !important;
        padding: 2px 6px !important;
    }
    .wgc-product-wsp-summary {
        font-size: 10px !important;
    }
}
#wgc-popup-container-5417 > div > div.wgc-popup-header > button,
.wgc-popup-header .wgc-popup-close,
.wgc-popup-header button[aria-label="بستن"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    border: 1.5px solid #e0e0e0 !important;
    background: transparent !important;
    color: #e74c3c !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.wgc-popup-header .wgc-popup-close svg,
.wgc-popup-header button[aria-label="بستن"] svg {
    stroke: #e74c3c !important;
    width: 16px !important;
    height: 16px !important;
}

.wgc-popup-header .wgc-popup-close:hover,
.wgc-popup-header button[aria-label="بستن"]:hover {
    background: #f3f4f6 !important;
    border-color: #d0d0d0 !important;
    transform: scale(1.12) !important;
    box-shadow: none !important;
}

.wgc-popup-header .wgc-popup-close:hover svg,
.wgc-popup-header button[aria-label="بستن"]:hover svg {
    stroke: #dc2626 !important;
}