/* ===== Avid Shop Hub ===== */
.avid-shophub { padding: 150px 0 90px; min-height: 70vh; }
.avid-shophub .avid-container { max-width: 1250px; }
.avid-shophub-head { padding: 34px 30px; margin-bottom: 26px; }
.avid-shophub-empty {
    text-align: center; padding: 50px 20px; color: var(--text-muted);
    background: var(--bg-card); border: 1px solid var(--glass-border);
    border-radius: 24px; backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}

/* --- نوار سه‌بخشی --- */
.avid-shop-tabs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    padding: 6px; margin-bottom: 34px;
    background: var(--bg-card); border: 1px solid var(--glass-border);
    border-radius: 22px; box-shadow: var(--card-shadow);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.avid-shop-tab {
    appearance: none; border: 0; cursor: pointer; background: transparent;
    color: var(--text-main); font: inherit; font-weight: 700; font-size: .98rem;
    padding: 14px 10px; border-radius: 16px; transition: background .25s, color .25s, transform .25s;
}
.avid-shop-tab:hover { background: rgba(204, 0, 0, .10); }
.avid-shop-tab.is-active { background: var(--red-gradient); color: #fff; box-shadow: 0 8px 22px rgba(204, 0, 0, .35); }
.avid-shop-panel[hidden] { display: none; }
.avid-shop-panel.is-active { animation: avidPanelIn .35s ease; }
@keyframes avidPanelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.avid-shop-more { text-align: center; margin-top: 30px; }
.avid-shop-more a { color: var(--primary-red); font-weight: 800; text-decoration: none; }
.avid-shop-more a:hover { text-decoration: underline; }

/* --- شبکه: دسکتاپ ۵ / لپ‌تاپ ۴ / تبلت ۳ / موبایل ۲ --- */
.avid-pc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 18px; }
@media (min-width: 1280px) { .avid-pc-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1023px) { .avid-pc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .avid-pc-grid { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; } }

/* ===== کارت محصول (طراحی مطابق نمونه) =====
   بدنه از دو بلوک سفید ساخته می‌شود:
     A = بخش بالا (تمام عرض، گوشه‌ی پایین-چپ گرد)
     B = بخش راست-پایین (کنار دکمه)
   + یک فیلت منحنی در گوشه‌ی داخلی؛ دکمه‌ی سبد یک کاشی سفید جداست که با
   فاصله‌ی باریک در بریدگی نشسته است، پس روی هر پس‌زمینه‌ای (روز/شب) درست دیده می‌شود. */
.avid-pc {
    --pc-bg: #ffffff;
    --pc-r: 30px;       /* گوشه‌های بیرونی کارت */
    --pc-nw: 62px;      /* عرض بریدگی (تا لبه‌ی چپ بلوک B) */
    --pc-nh: 76px;      /* ارتفاع بریدگی (از پایین کارت تا لبه‌ی پایین بلوک A) */
    --pc-gap: 8px;      /* فاصله‌ی کاشی سبد تا بدنه */
    --pc-tr: 22px;      /* گردی کاشی سبد */
    --pc-in: 24px;      /* گردی گوشه‌ی پایین-چپ بلوک A */
    --pc-r2: 28px;      /* گردی گوشه‌ی پایین-چپ بلوک B */
    --pc-fillet: 30px;  /* منحنی گوشه‌ی داخلی بریدگی */
    position: relative; display: flex; flex-direction: column;
    padding: 9px 9px 0; isolation: isolate; min-width: 0;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .12));
    transition: transform .3s ease, filter .3s ease;
}
html[data-theme="dark"] .avid-pc { --pc-bg: #181d26; filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .55)); }
.avid-pc:hover { transform: translateY(-5px); filter: drop-shadow(0 16px 28px rgba(204, 0, 0, .22)); }

.avid-pc::before,
.avid-pc::after,
.avid-pc-fillet { content: ""; position: absolute; background: var(--pc-bg); z-index: -1; pointer-events: none; }
/* A: بالا، تمام عرض */
.avid-pc::before {
    inset: 0 0 calc(var(--pc-nh) - 2px) 0;
    border-radius: var(--pc-r) var(--pc-r) 0 var(--pc-in);
}
/* B: راستِ بریدگی تا پایین */
.avid-pc::after {
    left: calc(var(--pc-nw) - 2px); right: 0; bottom: 0; top: calc(100% - var(--pc-nh) - 2px);
    border-radius: 0 0 var(--pc-r) var(--pc-r2);
}
/* فیلت منحنی (گوشه‌ی داخلی بریدگی) */
.avid-pc-fillet {
    width: var(--pc-fillet); height: calc(var(--pc-fillet) + 1px);
    left: calc(var(--pc-nw) - var(--pc-fillet));
    bottom: calc(var(--pc-nh) - var(--pc-fillet));
    background: radial-gradient(circle at 0 100%, transparent calc(var(--pc-fillet) - .5px), var(--pc-bg) var(--pc-fillet));
}

/* تصویر + برچسب */
.avid-pc-media { position: relative; display: block; border-radius: 22px; overflow: hidden; aspect-ratio: 25 / 27; background: rgba(127,127,127,.12); }
.avid-pc-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.avid-pc:hover .avid-pc-img { transform: scale(1.05); }
.avid-pc-badge {
    position: absolute; top: 11px; left: 11px; background: #34c24a; color: #fff;
    font-size: .7rem; font-weight: 700; line-height: 1; padding: 6px 13px; border-radius: 999px;
    max-width: calc(100% - 22px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* درصد تخفیف: گوشه‌ی پایین-راست تصویر (خودکار از قیمت اصلی و قیمت با تخفیف) */
.avid-pc-off {
    position: absolute; right: 11px; bottom: 11px; z-index: 2;
    background: linear-gradient(135deg, #ef233c, #b3001b); color: #fff;
    font-size: .72rem; font-weight: 800; line-height: 1; padding: 6px 12px; border-radius: 999px;
    white-space: nowrap; box-shadow: 0 4px 12px rgba(204, 0, 0, .45);
}

/* متن */
.avid-pc-body { position: relative; padding: 14px 13px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.avid-pc-title { font-size: 1.1rem; font-weight: 900; line-height: 1.7; margin: 0; }
.avid-pc-title a { color: #111111; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html[data-theme="dark"] .avid-pc-title a { color: #f3f4f6; }
.avid-pc-desc { color: #8e8e93; font-size: .8rem; line-height: 1.95; margin: 0; min-height: 3.9em; max-width: 78%;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html[data-theme="dark"] .avid-pc-desc { color: #9ca3af; }

/* ردیف قیمت: کنار کاشی سبد؛ قیمت قبلی بالا (ریز و کم‌رنگ) / قیمت نهایی پایین (بُلد) */
.avid-pc-price {
    margin-top: auto; height: var(--pc-nh);
    margin-left: calc(var(--pc-nw) - 10px);
    display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
    gap: 2px; padding-bottom: 17px; text-align: right;
}
.avid-pc-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.avid-pc-amt { font-weight: 900; font-size: 1rem; line-height: 1.4; color: #111111; }
html[data-theme="dark"] .avid-pc-amt { color: #f3f4f6; }
.avid-pc-unit { font-size: .7rem; font-weight: 500; color: #9a9aa0; white-space: nowrap; }
.avid-pc-old { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; opacity: .55; text-decoration: line-through; text-decoration-thickness: 1px; }
.avid-pc-old .avid-pc-amt { font-size: .82rem; font-weight: 500; color: #6b7280; }
.avid-pc-old .avid-pc-unit { font-size: .66rem; }
html[data-theme="dark"] .avid-pc-old .avid-pc-amt { color: #9ca3af; }
.avid-pc-noprice { color: #9ca3af; font-size: .9rem; }

/* کاشی سفید سبد خرید (گوشه‌ی پایین-چپ) */
.avid-pc-cart {
    position: absolute; left: 0; bottom: 0; z-index: 2;
    width: calc(var(--pc-nw) - var(--pc-gap)); height: calc(var(--pc-nh) - var(--pc-gap));
    display: grid; place-items: center; border-radius: var(--pc-tr);
    background: var(--pc-bg); color: #2b2b2b; text-decoration: none;
    transition: background .25s, color .25s, transform .25s;
}
html[data-theme="dark"] .avid-pc-cart { color: #e5e7eb; }
.avid-pc-cart svg { width: 22px; height: 22px; grid-area: 1 / 1; transition: opacity .2s, transform .25s; }
.avid-pc-cart:hover { background: var(--red-gradient); color: #fff; }
.avid-pc-ico-ok { opacity: 0; transform: scale(.4); }
.avid-pc-cart.loading { pointer-events: none; opacity: .7; animation: avidPcPulse .8s ease infinite; }
.avid-pc-cart.added { background: #22c55e; color: #fff; }
.avid-pc-cart.added .avid-pc-ico-cart { opacity: 0; transform: scale(.4); }
.avid-pc-cart.added .avid-pc-ico-ok { opacity: 1; transform: none; }
@keyframes avidPcPulse { 50% { opacity: .35; } }
.avid-pc .added_to_cart { display: none !important; }

/* ===== تبلت و دسکتاپ کوچک ===== */
@media (min-width: 641px) and (max-width: 1279px) {
    .avid-pc-title { font-size: 1rem; }
    .avid-pc-amt { font-size: 1rem; }
}

/* ===== موبایل: فشرده برای دیدن ۴ تا ۶ محصول در هر صفحه ===== */
@media (max-width: 640px) {
    .avid-shophub { padding-top: 130px; }
    .avid-shophub .avid-container { padding: 0 12px; }
    .avid-pc {
        --pc-r: 22px; --pc-nw: 50px; --pc-nh: 62px; --pc-gap: 6px; --pc-tr: 16px;
        --pc-in: 18px; --pc-r2: 20px; --pc-fillet: 22px;
        padding: 7px 7px 0;
    }
    .avid-pc-media { border-radius: 16px; }
    .avid-pc-badge { top: 8px; left: 8px; font-size: .62rem; padding: 4px 9px; }
    .avid-pc-off { right: 8px; bottom: 8px; font-size: .62rem; padding: 4px 9px; }
    .avid-pc-body { padding: 10px 6px 0; gap: 3px; }
    .avid-pc-title { font-size: .82rem; line-height: 1.6; }
    .avid-pc-desc { display: none; }
    .avid-pc-cart svg { width: 19px; height: 19px; }
    .avid-pc-price { margin-left: calc(var(--pc-nw) - 14px); gap: 1px; padding-bottom: 9px; }
    .avid-pc-amt { font-size: .84rem; }
    .avid-pc-unit { font-size: .58rem; }
    .avid-pc-old .avid-pc-amt { font-size: .68rem; }
    .avid-pc-old .avid-pc-unit { font-size: .54rem; }
    /* «تومان» کنار عدد (نه زیر آن) — برای قیمت اصلی و قیمت نهایی */
    .avid-pc-now, .avid-pc-old { flex-direction: row; flex-wrap: nowrap; align-items: baseline; gap: 0 4px; white-space: nowrap; }
    .avid-shop-tab { font-size: .8rem; padding: 12px 4px; }
}

/* ===== موبایل خیلی کوچک: کمی کوچک‌تر تا «تومان» کنار عدد جا شود ===== */
@media (max-width: 360px) {
    .avid-pc-amt { font-size: .76rem; }
    .avid-pc-unit { font-size: .52rem; }
    .avid-pc-old .avid-pc-amt { font-size: .62rem; }
    .avid-pc-old .avid-pc-unit { font-size: .48rem; }
}