/* ============================================================
   СТРАНИЦА ВИДА ПРЕДМЕТА (/item/:slug)
   Каталожная страница: агрегаты по всем экземплярам, активные
   лоты и история продаж. Палитра редкостей повторяет item_detail.
   ============================================================ */

.itp-page {
    --rar: #64748b;
    --rar-soft: rgba(100,116,139,0.15);
    --bg-card: #111e32;
    --border-subtle: #2a3f5c;
    --text-primary: #eef5fd;
    --text-secondary: #b0c3db;
    --text-muted: #7a92ae;
    --shadow-heavy: 0 20px 60px -20px rgba(0,0,0,0.8);
    --radius-card: 20px;

    max-width: 1100px;
    margin: 0 auto;
    color: var(--text-primary);
}

.itp-page.rarity-Обычный     { --rar: #7a8a9e; --rar-soft: rgba(122,138,158,0.15); }
.itp-page.rarity-Необычный   { --rar: #34b86a; --rar-soft: rgba(52,184,106,0.18); }
.itp-page.rarity-Редкий      { --rar: #3b8fd9; --rar-soft: rgba(59,143,217,0.18); }
.itp-page.rarity-Эпический   { --rar: #9b7ae0; --rar-soft: rgba(155,122,224,0.20); }
.itp-page.rarity-Легендарный { --rar: #e8b830; --rar-soft: rgba(232,184,48,0.22); }
.itp-page.rarity-Мифический  { --rar: #e8657a; --rar-soft: rgba(232,101,122,0.22); }

/* --- ХЛЕБНЫЕ КРОШКИ --- */
.itp-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.itp-crumbs a { color: var(--text-secondary); text-decoration: none; }
.itp-crumbs a:hover { color: var(--rar); }

/* --- ГЕРОЙ --- */
.itp-hero {
    display: grid;
    grid-template-columns: minmax(240px, 32%) minmax(0, 1fr);
    gap: 28px;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-heavy);
}

.itp-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: radial-gradient(circle at 50% 40%, var(--rar-soft), transparent 70%);
    border: 1px solid var(--rar);
    border-radius: 18px;
}

.itp-frame img {
    max-width: 78%;
    max-height: 78%;
    object-fit: contain;
}

.itp-frame-ph {
    font-size: 4rem;
    color: var(--rar);
    opacity: 0.6;
}

.itp-rarity {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
    background: rgba(8,16,28,0.85);
    border: 1px solid var(--rar);
    border-radius: 999px;
}

.itp-dot {
    width: 8px;
    height: 8px;
    background: var(--rar);
    border-radius: 50%;
}

.itp-title {
    margin: 0 0 12px;
    font-size: 1.9rem;
    line-height: 1.2;
}

.itp-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.itp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 0.83rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
}

.itp-chip a { color: inherit; text-decoration: none; }
.itp-chip a:hover { color: var(--rar); }

.itp-desc {
    margin: 0 0 18px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- АГРЕГАТЫ --- */
.itp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}

.itp-stat {
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.itp-stat dt {
    margin-bottom: 4px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.itp-stat dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.itp-stat .v-price { color: #ffd873; }

.itp-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.itp-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--rar-soft);
    border-radius: 8px;
}

/* --- ПАНЕЛИ --- */
.itp-panel {
    margin-top: 20px;
    padding: 22px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
}

.itp-panel-h {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 1.15rem;
}

.itp-panel-h i { color: var(--rar); }

.itp-empty {
    text-align: center;
    color: var(--text-secondary);
}

.itp-empty i {
    font-size: 2.4rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.itp-empty p { margin: 4px 0; }
.itp-empty .hint { font-size: 0.88rem; color: var(--text-muted); }
.itp-empty a { color: var(--rar); }

/* --- АКТИВНЫЕ ЛОТЫ --- */
.itp-lots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.itp-lot {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.itp-lot:hover {
    border-color: var(--rar);
    transform: translateY(-2px);
}

.itp-lot-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffd873;
}

.itp-lot-meta,
.itp-lot-seller,
.itp-lot .market-timer {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* --- ИСТОРИЯ ПРОДАЖ --- */
.itp-sales {
    width: 100%;
    border-collapse: collapse;
}

.itp-sales th,
.itp-sales td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.itp-sales th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.itp-sales td.v-price {
    font-weight: 600;
    color: #ffd873;
}

.itp-sales tbody tr:last-child td { border-bottom: none; }

@media (max-width: 720px) {
    .itp-hero {
        grid-template-columns: minmax(0, 1fr);
        padding: 20px;
    }

    .itp-frame { max-width: 260px; margin: 0 auto; }
    .itp-title { font-size: 1.5rem; }
}
