/* Utilities: loading, empty states, and shared visual helpers. */

/* استایل برای لودینگ */
.bazaar-u-loader {
    width: var(--bazaar-loader-width, 86px);
    height: var(--bazaar-loader-height, 96px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: bazaar-loader-bounce 2s ease-in-out infinite, bazaar-loader-glow 2s ease-in-out infinite;
    color: #dc2626;
}

.bazaar-u-loader svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bazaar-u-loader.is-small {
    --bazaar-loader-width: 42px;
    --bazaar-loader-height: 48px;
}

.bazaar-u-loader.is-tiny {
    --bazaar-loader-width: 20px;
    --bazaar-loader-height: 22px;
}

.bazaar-u-loader.is-large {
    --bazaar-loader-width: 132px;
    --bazaar-loader-height: 148px;
}

@keyframes bazaar-loader-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-14px) scale(1.05); }
    60% { transform: translateY(4px) scale(0.98); }
}

@keyframes bazaar-loader-glow {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(220, 38, 38, 0)); }
    50% { filter: drop-shadow(0 0 18px rgba(220, 38, 38, 0.82)); }
}

.bazaar-loading-text {
    margin: 0;
    font-size: 13px;
    color: var(--dark-gray);
}

.bazaar-initial-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgb(255, 252, 255);
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

body.theme-dark .bazaar-initial-loader {
    background: var(--body-bg, #0f1115);
}

.bazaar-initial-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-products {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 52vh;
    padding: 40px 0;
    color: var(--dark-gray);
    gap: 10px;
}

.loading-products i {
    display: none;
}

.loading-products::before {
    content: none;
}

.loading-products .bazaar-u-loader {
    flex: 0 0 auto;
}

.product-loading,
.product-feedback-loading,
.wallet-loading-state,
.manage-story-engagement-loading,
.passage-story-strip-empty,
.account-inline-loading,
.product-shell-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.product-loading,
.product-shell-loading {
    min-height: 180px;
    flex-direction: column;
    color: var(--dark-gray);
    text-align: center;
}

.product-feedback-loading,
.wallet-loading-state,
.manage-story-engagement-loading,
.passage-story-strip-empty,
.account-inline-loading {
    flex-direction: row;
}

/* استایل برای پیام خالی */
.empty-message {
    color: var(--dark-gray);
    text-align: center;
    padding: 30px;
    background-color: var(--light-gray);
    border-radius: 10px;
    margin: 20px 0;
}

/* استایل برای تصاویر محصولات در بخش حساب کاربری */
.product-item .product-image-container {
    width: 60px;
    height: 60px;
    margin-right: 10px;
    overflow: hidden;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.product-item .product-thumbnail {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.product-item .no-image {
    font-size: 10px;
    color: #999;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.product-item .no-image i {
    font-size: 16px;
    margin-bottom: 2px;
}

/* حفظ استایل قبلی برای product-item */
.product-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}

.product-item .product-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
    margin-right: 10px;
}

.product-item .product-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.product-item .product-price {
    font-size: 12px;
    color: #4CAF50;
}
