/* Product comparison demo — custom website component */
.pcmp-demo {
    --pcmp-accent: #2563eb;
    --pcmp-accent-soft: #dbeafe;
    --pcmp-text: #1e293b;
    --pcmp-muted: #64748b;
    --pcmp-border: #e2e8f0;
    --pcmp-win: #dcfce7;
    --pcmp-lose: #fef2f2;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--pcmp-text);
    background: #f8fafc;
}

.pcmp-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff;
    padding: 1.35rem 1.25rem 1.5rem;
}

.pcmp-header h2 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.25rem, 2vw + 0.8rem, 1.65rem);
    font-weight: 800;
}

.pcmp-header p {
    margin: 0;
    max-width: 42rem;
    font-size: 0.92rem;
    opacity: 0.92;
    line-height: 1.5;
}

.pcmp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--pcmp-border);
}

.pcmp-catalog-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pcmp-chip {
    border: 1px solid var(--pcmp-border);
    background: #fff;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--pcmp-text);
}

.pcmp-chip.active {
    background: var(--pcmp-accent);
    border-color: var(--pcmp-accent);
    color: #fff;
}

.pcmp-search {
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--pcmp-border);
    border-radius: 8px;
    font-size: 0.88rem;
}

.pcmp-main {
    padding: 1rem 1.25rem 5.5rem;
}

.pcmp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
}

.pcmp-card {
    background: #fff;
    border: 1px solid var(--pcmp-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.pcmp-card.selected {
    border-color: var(--pcmp-accent);
    box-shadow: 0 0 0 2px var(--pcmp-accent-soft);
}

.pcmp-card-img {
    aspect-ratio: 4/3;
    background: #f1f5f9;
    overflow: hidden;
}

.pcmp-img-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.pcmp-card-img.pcmp-img-wrap {
    display: flex;
}

.pcmp-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pcmp-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 5rem;
    padding: 0.65rem;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.35;
    font-weight: 600;
    color: var(--pcmp-muted);
    background: #e2e8f0;
}

.pcmp-img-placeholder--compact {
    min-height: 0;
    padding: 0.15rem;
    font-size: 0.5rem;
    line-height: 1.2;
}

.pcmp-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pcmp-card-body {
    padding: 0.75rem 0.85rem 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pcmp-card-brand {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pcmp-muted);
}

.pcmp-card-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.pcmp-card-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--pcmp-accent);
}

.pcmp-card-specs {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.78rem;
    color: var(--pcmp-muted);
    line-height: 1.45;
}

.pcmp-card-actions {
    margin-top: auto;
    padding-top: 0.5rem;
}

.pcmp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--pcmp-border);
    background: #fff;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--pcmp-text);
}

.pcmp-btn:hover {
    border-color: #94a3b8;
}

.pcmp-btn--primary {
    background: var(--pcmp-accent);
    border-color: var(--pcmp-accent);
    color: #fff;
}

.pcmp-btn--primary:hover {
    background: #1d4ed8;
}

.pcmp-btn--block {
    width: 100%;
}

.pcmp-btn.selected {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.pcmp-tray {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: #fff;
    border-top: 1px solid var(--pcmp-border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
    padding: 0.65rem 1.25rem;
    transform: translateY(110%);
    transition: transform 0.25s ease;
}

.pcmp-tray.visible {
    transform: translateY(0);
}

.pcmp-tray-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}

.pcmp-tray-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--pcmp-muted);
}

.pcmp-tray-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    flex: 1;
}

.pcmp-tray-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.pcmp-tray-pill img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.pcmp-tray-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.pcmp-tray-thumb img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.pcmp-tray-pill button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.15rem;
}

.pcmp-compare-section {
    margin-top: 1.5rem;
    scroll-margin-top: 1rem;
}

.pcmp-compare-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}

.pcmp-compare-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.pcmp-check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--pcmp-muted);
    cursor: pointer;
}

.pcmp-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--pcmp-border);
    border-radius: 12px;
    background: #fff;
}

.pcmp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 640px;
}

.pcmp-table th,
.pcmp-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    text-align: left;
}

.pcmp-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--pcmp-border);
    vertical-align: bottom;
}

.pcmp-table .pcmp-col-product {
    min-width: 140px;
    text-align: center;
}

.pcmp-table .pcmp-col-product img {
    width: 88px;
    height: 66px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin: 0 auto 0.4rem;
}

.pcmp-table-img {
    width: 88px;
    height: 66px;
    margin: 0 auto 0.4rem;
    border-radius: 8px;
    overflow: hidden;
}

.pcmp-table-img .pcmp-img-placeholder {
    min-height: 66px;
    font-size: 0.62rem;
    padding: 0.35rem;
}

.pcmp-table .pcmp-col-product strong {
    display: block;
    font-size: 0.88rem;
}

.pcmp-table .pcmp-col-product span {
    font-size: 0.78rem;
    color: var(--pcmp-muted);
}

.pcmp-table .pcmp-group-row td {
    background: #eff6ff;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1d4ed8;
    padding: 0.45rem 0.75rem;
}

.pcmp-table .pcmp-spec-label {
    font-weight: 600;
    color: #475569;
    width: 160px;
    background: #fafafa;
}

.pcmp-table td.cell-best {
    background: var(--pcmp-win);
    font-weight: 700;
}

.pcmp-table td.cell-worst {
    background: var(--pcmp-lose);
}

.pcmp-marketing {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
    padding: 1.25rem;
    background: #f1f5f9;
    border-top: 1px solid var(--pcmp-border);
}

.pcmp-info-card {
    background: #fff;
    border: 1px solid var(--pcmp-border);
    border-radius: 12px;
    padding: 1rem;
}

.pcmp-info-card h3 {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
}

.pcmp-info-card p,
.pcmp-info-card ul {
    margin: 0;
    font-size: 0.85rem;
    color: var(--pcmp-muted);
    line-height: 1.5;
}

.pcmp-info-card ul {
    padding-left: 1.1rem;
}

.pcmp-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--pcmp-muted);
    font-size: 0.92rem;
}

@media (max-width: 640px) {
    .pcmp-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pcmp-search {
        max-width: none;
    }
}

@media print {
    .pcmp-header,
    .pcmp-toolbar,
    .pcmp-grid,
    .pcmp-tray,
    .pcmp-marketing,
    .pcmp-compare-tools {
        display: none !important;
    }

    .pcmp-main {
        padding: 0;
    }
}
