/* ============================================================================
   Products listing page (/products)
   Reuses the theme variables + nav/hero/FAQ classes from product.css.
   Adds the catalog toolbar, filters, product grid and token-API CTA banner.
   All styling lives here — no inline or internal CSS.
   ========================================================================== */

.pi-page { position: relative; }

/* --------------------------------- Hero --------------------------------- */
.pi-hero {
    position: relative;
    padding: 150px 24px 60px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}
.pi-hero-title {
    position: relative;
    max-width: 760px;
    margin: 16px 0 0;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.03em;
}
.pi-hero-sub {
    position: relative;
    max-width: 560px;
    margin: 20px 0 0;
    font-size: 16px;
    line-height: 1.8;
    color: var(--pd-muted);
}

/* ------------------------------- Catalog -------------------------------- */
.pi-catalog { padding: 40px 24px 80px; }
.pi-catalog-inner { max-width: 1120px; margin: 0 auto; }

.pi-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pd-border);
}
.pi-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.pi-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid var(--pd-border-2);
    background: var(--pd-surface);
    color: var(--pd-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.pi-chip:hover { color: var(--pd-text); }
.pi-chip.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--pd-brand), var(--pd-brand-2));
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(255, 106, 58, 0.35);
}
.pi-chip-count {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 100px;
    background: var(--pd-surface-2);
    color: inherit;
}
.pi-chip.is-active .pi-chip-count { background: rgba(255, 255, 255, 0.25); }

.pi-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pd-muted); }
.pi-sort select {
    font-family: inherit;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--pd-border-2);
    background: var(--pd-surface);
    color: var(--pd-text);
    cursor: pointer;
}

.pi-empty { text-align: center; color: var(--pd-muted); padding: 60px 0; }

/* --------------------------------- Grid --------------------------------- */
.pi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.pi-card {
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    text-decoration: none;
    color: var(--pd-text);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.pi-card:hover {
    transform: translateY(-4px);
    border-color: var(--pd-brand-line);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}
.pi-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 106, 58, 0.14), rgba(242, 137, 103, 0.06));
    overflow: hidden;
}
.pi-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pi-card-logo {
    width: 56px; height: 56px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ff6a3a, #f28967);
    box-shadow: 0 8px 24px rgba(255, 106, 58, 0.4);
}
.pi-card-logo img { width: 100%; height: 100%; border-radius: 14px; object-fit: cover; }
.pi-card-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pi-card-title { margin: 0; font-size: 17px; font-weight: 800; }
.pi-card-excerpt { margin: 0; font-size: 13px; line-height: 1.7; color: var(--pd-muted); flex: 1; }
.pi-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pi-tag {
    font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 100px;
    background: var(--pd-brand-soft); color: var(--pd-brand-2);
    border: 1px solid var(--pd-brand-line);
}
.pi-card-link { font-size: 13px; font-weight: 700; color: var(--pd-brand); margin-top: 2px; }

/* ---------------------- Token API CTA (dashboard style) ----------------- */
.pi-cta-wrap { padding: 20px 24px 90px; }
.pi-cta {
    position: relative;
    max-width: 1120px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #231c15 0%, #1c1c1c 55%, #201a16 100%);
    border: 1px solid rgba(255, 106, 58, 0.22);
    box-shadow: 0 0 0 1px rgba(255, 106, 58, 0.06), 0 30px 70px rgba(0, 0, 0, 0.45);
}
:root[data-theme="light"] .pi-cta { background: linear-gradient(135deg, #fff 0%, #fbf3ee 100%); }
.pi-cta-glow { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; }
.pi-cta-glow--tr { top: -40%; right: -5%; width: 340px; height: 340px; background: radial-gradient(ellipse, rgba(255, 106, 58, 0.18) 0%, transparent 65%); }
.pi-cta-glow--bl { bottom: -50%; left: -5%; width: 320px; height: 320px; background: radial-gradient(ellipse, rgba(242, 137, 103, 0.12) 0%, transparent 65%); }
.pi-cta-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 32px 36px;
}
.pi-cta-left { display: flex; align-items: center; gap: 18px; }
.pi-cta-icon {
    width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 106, 58, 0.12); border: 1px solid rgba(255, 106, 58, 0.28);
}
.pi-cta-eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--pd-brand-2); }
.pi-cta-title { margin: 0; font-size: 20px; font-weight: 800; color: var(--pd-text); }
.pi-cta-desc { margin: 6px 0 0; font-size: 13px; color: var(--pd-muted); }

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 900px) {
    .pi-catalog { padding: 32px 20px 64px; }
    .pi-grid { grid-template-columns: repeat(2, 1fr); }
    .pi-cta-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
    .pi-grid { grid-template-columns: 1fr; }
    .pi-toolbar { flex-direction: column; align-items: stretch; }
    .pi-sort { justify-content: space-between; }
}
