/* ══════════════════════════════════════════════════════════════════════════
   product-card.css — карточка банковского продукта (.pc), ред. 4
   Разметка: includes/components/product-card.php — единственный источник.

   «Карточки» (по умолчанию):
     [лого] Банк
            ★ 4,8
     ─────────────────────────
     Название продукта
     ─────────────────────────
     • Подпись ........ значение   ×3
     (         кнопка-таблетка         )
          Реклама · юрлицо · лиц.
   Картинка карты, лицензия в шапке и плашки преимуществ здесь скрыты.

   «Список» — .horizontal-view на контейнере (ViewManager), от 1000px:
     [картинка карты + банк, продукт, рейтинг] [3 условия] [кнопка]
     [плашки преимуществ                                ] [Реклама]
   ══════════════════════════════════════════════════════════════════════════ */

.pc {
    --pc-bg:      var(--card-bg, #fff);
    --pc-border:  var(--border-color, rgba(0,0,0,.08));
    --pc-line:    rgba(0,0,0,.08);
    --pc-text:    var(--text-primary, #111827);
    --pc-muted:   #6b7280;
    --pc-dot:     #d1d5db;
    --pc-tag-bg:  #f1f3f7;
    --pc-tag-fg:  #4b5563;
    --pc-img-bg:  #f3f4f6;
    --pc-star:    #f59e0b;
    --pc-accent:  #5a67d8;
    --pc-accent-hi: #4c51bf;

    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    min-width: 0;
    padding: 24px;
    box-sizing: border-box;
    background: var(--pc-bg);
    border: 1px solid var(--pc-border);
    border-radius: 20px;
    color: var(--pc-text);
}

[data-theme="dark"] .pc {
    --pc-bg:      rgba(255,255,255,.035);
    --pc-border:  rgba(255,255,255,.06);
    --pc-line:    rgba(255,255,255,.07);
    --pc-muted:   #8b93a7;
    --pc-dot:     #4b5263;
    --pc-tag-bg:  rgba(255,255,255,.05);
    --pc-tag-fg:  #aeb6c7;
    --pc-img-bg:  rgba(255,255,255,.05);
    --pc-star:    #fbbf24;
}

/* ── Шапка (вид «Карточки») ──────────────────────────────────────────── */
.pc-main {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
        "logo bank"
        "logo rating"
        "name name";
    column-gap: 14px;
    align-items: center;
}
.pc-id { display: contents; }

.pc-logo {
    grid-area: logo;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--pc-img-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: var(--pc-muted);
}
.pc-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pc-img { display: none; }

.pc-bankline { grid-area: bank; align-self: end; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pc-bank {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--pc-text) !important;
    text-decoration: none !important;
}
a.pc-bank:hover { color: var(--pc-accent) !important; }
.pc-lic { display: none; font-size: 12px; color: var(--pc-muted); }

.pc-rating {
    grid-area: rating;
    align-self: start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pc-text);
}
.pc-rating svg { color: var(--pc-star); }

.pc-name {
    grid-area: name;
    margin: 16px 0 0;
    padding: 12px 0;
    border-top: 1px solid var(--pc-line);
    border-bottom: 1px solid var(--pc-line);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--pc-text);
    overflow-wrap: anywhere;
}

/* ── Условия: «• подпись ........ значение» ──────────────────────────── */
.pc-metrics { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.pc-metric {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}
.pc-metric dt {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--pc-muted);
}
.pc-metric dt::before {
    content: "";
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pc-dot);
    transform: translateY(-2px);
}
.pc-metric dt .psk-tooltip { color: inherit; }
.pc-metric dd {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--pc-text);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pc-tags { display: none; }

/* ── Кнопка и пометка ────────────────────────────────────────────────── */
.pc-action { margin-top: auto; padding-top: 8px; }
.pc-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--pc-accent);
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .2s ease;
}
.pc-cta:hover { background: var(--pc-accent-hi); }
.pc-cta:focus-visible { outline: 3px solid rgba(90,103,216,.5); outline-offset: 2px; }

.pc-ad { margin-top: -6px; font-size: 11px; line-height: 1.4; color: var(--pc-muted); text-align: center; }

/* ══════════════════════════════════════════════════════════════════════════
   СПИСОК
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1000px) {
    .horizontal-view .pc {
        display: grid;
        grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) 228px;
        grid-template-areas:
            "main metrics action"
            "tags tags    ad";
        column-gap: 32px;
        row-gap: 16px;
        align-items: center;
        height: auto;
        padding: 20px 24px;
        border-radius: 16px;
    }
    .horizontal-view .pc-main { grid-area: main; display: flex; gap: 16px; align-items: center; }
    .horizontal-view .pc-logo { display: none; }
    .horizontal-view .pc-img {
        display: block;
        flex: 0 0 100px;
        width: 100px;
        height: 64px;
        border-radius: 8px;
        overflow: hidden;
        background: var(--pc-img-bg);
    }
    .horizontal-view .pc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
    .horizontal-view .pc-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .horizontal-view .pc-bank { font-size: 16px; font-weight: 700; }
    .horizontal-view .pc-lic { display: inline; }
    .horizontal-view .pc-rating { order: 3; margin-top: 3px; }
    .horizontal-view .pc-name {
        margin: 0;
        padding: 0;
        border: 0;
        font-size: 13px;
        font-weight: 400;
        color: var(--pc-muted);
    }

    .horizontal-view .pc-metrics {
        grid-area: metrics;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
    .horizontal-view .pc-metric { display: block; }
    .horizontal-view .pc-metric dt { display: block; font-size: 13px; }
    .horizontal-view .pc-metric dt::before { display: none; }
    .horizontal-view .pc-metric dd { margin-top: 3px; font-size: 16px; font-weight: 700; text-align: left; }

    .horizontal-view .pc-tags {
        grid-area: tags;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .horizontal-view .pc-tags li {
        padding: 4px 10px;
        border-radius: 999px;
        background: var(--pc-tag-bg);
        color: var(--pc-tag-fg);
        font-size: 12px;
        font-weight: 500;
        line-height: 1.4;
    }
    .horizontal-view .pc-action { grid-area: action; margin-top: 0; padding-top: 0; }
    .horizontal-view .pc-cta { border-radius: 10px; min-height: 44px; }
    .horizontal-view .pc-ad { grid-area: ad; margin-top: 0; text-align: right; }
}

@media (max-width: 480px) {
    .pc { padding: 20px; }
}
