* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: Vazirmatn, "Vazir", Tahoma, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* هدر */
.site-header {
    text-align: center;
    padding: 28px 16px 18px;
}
.site-header .logo {
    width: 84px; height: 84px; object-fit: cover;
    border-radius: 50%; margin: 0 auto 10px;
    border: 3px solid var(--primary);
    background: var(--card);
}
.site-header h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); color: var(--primary); font-weight: 800; }
.tagline { color: var(--muted); font-size: .95rem; }

/* بنر */
.banner { max-width: 1100px; width: 100%; margin: 0 auto; padding: 0 16px; }
.banner img {
    width: 100%; aspect-ratio: 16 / 6; object-fit: cover;
    border-radius: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
@media (max-width: 600px) { .banner img { aspect-ratio: 16 / 9; border-radius: 14px; } }

/* نوار دسته‌بندی‌ها (چسبان) */
.cats-bar {
    position: sticky; top: 0; z-index: 20;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    margin-top: 18px;
}
.cats-scroll {
    display: flex; gap: 12px;
    max-width: 1100px; margin: 0 auto;
    padding: 12px 16px;
    overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.cats-scroll::-webkit-scrollbar { display: none; }
.cat {
    flex: 0 0 auto;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    width: 92px;
    background: none; border: none; color: var(--text);
    padding: 4px 2px; border-radius: 14px;
    transition: transform .15s;
}
.cat:hover { transform: translateY(-2px); }
.cat-img {
    width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
    border: 3px solid var(--border);
    background: var(--card);
    display: grid; place-items: center;
    transition: border-color .2s, box-shadow .2s;
}
.cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-img i { font-style: normal; font-size: 1.8rem; }
.cat-name { font-size: .85rem; font-weight: 600; text-align: center; line-height: 1.3; }
.cat.active .cat-img { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.cat.active .cat-name { color: var(--primary); }

/* محصولات */
main { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 20px 16px 40px; }
.hint, .empty, .loading { text-align: center; color: var(--muted); padding: 30px 0; }
.products {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.products.fade { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.products .empty, .products .loading { grid-column: 1 / -1; }

.product {
    display: flex; gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px; padding: 12px;
    position: relative;
}
.p-img {
    flex: 0 0 110px; height: 110px; border-radius: 12px; overflow: hidden;
    background: var(--bg); display: grid; place-items: center;
}
.p-img img { width: 100%; height: 100%; object-fit: cover; }
.p-img i { font-style: normal; font-size: 2.2rem; }
.p-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.p-body h3 { font-size: 1.05rem; }
.p-desc { color: var(--muted); font-size: .85rem; line-height: 1.6; flex: 1; }
.p-price { color: var(--primary); font-weight: 800; margin-top: 4px; }
.product.sold { opacity: .6; }
.badge {
    position: absolute; top: 10px; left: 10px;
    background: #c0392b; color: #fff; font-size: .72rem;
    padding: 1px 10px; border-radius: 99px;
}

.site-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; border-top: 1px solid var(--border); }

@media (max-width: 400px) {
    .p-img { flex-basis: 88px; height: 88px; }
}
