/* ====== Avina — Store/Product production polish ====== */
/* اسکلتون شیمر، اسکرولر دسته‌بندی موبایل، گلس‌مورفیسم — سازگار با RTL */

/* ---------- Skeleton shimmer ---------- */
.sk {
    position: relative;
    overflow: hidden;
    background: #1c2026;
    border-radius: 0.75rem;
}
.sk::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
    animation: sk-shimmer 1.3s infinite;
}
@keyframes sk-shimmer {
    100% { transform: translateX(100%); }
}
.sk-line { height: 0.85rem; border-radius: 0.4rem; margin-bottom: 0.6rem; }
.sk-line.sm { width: 40%; }
.sk-line.md { width: 70%; }
.sk-line.lg { width: 100%; }
.sk-box { width: 100%; border-radius: 1rem; }

@media (prefers-reduced-motion: reduce) {
    .sk::after { animation: none; }
}

/* ---------- Top-categories responsive (grid → mobile horizontal snap scroller) ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (max-width: 640px) {
    .cat-grid {
        display: flex;
        overflow-x: auto;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        /* محو نرم لبه‌ها برای اشاره به ادامهٔ لیست (هر دو طرف، مستقل از جهت) */
        -webkit-mask-image: linear-gradient(to left, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
                mask-image: linear-gradient(to left, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
    }
    .cat-grid > * {
        flex: 0 0 80%;
        scroll-snap-align: start;
    }
}

/* hide scrollbar utility */
.scrollbar-none { scrollbar-width: none; }
.scrollbar-none::-webkit-scrollbar { display: none; }

/* ---------- Glassmorphism utility ---------- */
.glass {
    background: rgba(28, 32, 38, 0.6);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
            backdrop-filter: blur(12px) saturate(120%);
    border: 1px solid rgba(170, 199, 255, 0.12);
}

/* ---------- Persistent podcast/audio bar (survives full-page navigation) ---------- */
#avina-audio-bar {
    position: fixed;
    bottom: 0;
    right: 260px; /* جا برای سایدبارِ دسکتاپ (RTL: سایدبار سمت راست) */
    left: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem 1rem;
    background: linear-gradient(135deg, #141a2c, #0a0d20);
    border-top: 1px solid rgba(170, 199, 255, 0.2);
    box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.45);
    animation: aabUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes aabUp { from { transform: translateY(100%); opacity: 0.4; } to { transform: translateY(0); opacity: 1; } }
body:has(.app-layout.sidebar-collapsed) #avina-audio-bar { right: 0; }

.aab-thumb {
    width: 46px; height: 46px; border-radius: 0.55rem; overflow: hidden; flex-shrink: 0;
    background: linear-gradient(135deg, #4248d4, #ff79c6);
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.aab-thumb img { width: 100%; height: 100%; object-fit: cover; }
.aab-info { min-width: 0; flex-shrink: 0; max-width: 180px; }
.aab-kind { color: #aac7ff; font-size: 0.66rem; font-weight: 800; }
.aab-title { color: #fff; font-weight: 800; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aab-audio { flex: 1 1 auto; min-width: 120px; max-width: 520px; height: 40px; }
.aab-close {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 0.6rem; cursor: pointer; font-size: 0.9rem;
    background: rgba(255, 180, 171, 0.12); border: 1px solid rgba(255, 180, 171, 0.3); color: #ffb4ab;
}
.aab-close:hover { background: rgba(255, 180, 171, 0.22); }

body.has-audio-bar { padding-bottom: 78px; }

@media (max-width: 768px) {
    #avina-audio-bar { right: 0; gap: 0.5rem; padding: 0.5rem 0.6rem; }
    .aab-info { display: none; }
    .aab-audio { max-width: none; }
}
