/* Vergleich (comparison) page — custom-scrollbar approach.
   No outer overflow container. Each row is its own div that clips
   horizontally; an inner div is translated via JS. The custom scrollbar
   thumb at top and bottom drives the translation. Sticky rows use
   position: sticky on the row div itself — works against the document
   scroll because rows are in document flow without overflow ancestors. */

/* Breadcrumb */
.vergleich-breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.vergleich-breadcrumb .breadcrumb-sep { color: #d1d5db; }
.vergleich-breadcrumb .breadcrumb-current { color: #374151; font-weight: 500; }

.vergleich-intro {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: #1f2937;
}

.vg-stack {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    margin-bottom: 1.5rem;
    /* No overflow here — rows handle their own clipping. */
}
/* Round the top corners of the first row to match the stack */
.vg-stack > .vg-row:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

/* Row */
.vg-row {
    overflow: hidden;
    background: #fff;
}

/* Inner grid that we translate. width: max-content so it can be wider
   than the row container; the row clips the overflow. */
.vg-row-inner {
    display: grid;
    width: max-content;
    min-width: 100%;
    will-change: transform;
    font-size: 0.92rem;
}

/* Sticky rows pin against document scroll */
.vg-row-sticky {
    position: sticky;
    z-index: 4;
}
.vg-row-sticky[data-vg-sticky-tier="1"] {
    top: var(--header-height, 64px);
    z-index: 5;
}
.vg-row-sticky[data-vg-sticky-tier="2"] {
    top: calc(var(--header-height, 64px) + 130px);
    z-index: 4;
}

.vg-cell {
    padding: 0.85rem 0.95rem;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #e5e7eb;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.vg-stack > .vg-row:last-of-type:not(.vg-scrollbar) .vg-cell {
    border-bottom: none;
}

/* Row labels (first column) — double border on right.
   z-index keeps them above the product cells that slide left under them
   when the user scrolls horizontally (counter-translate via JS). */
.vg-label {
    background: #fff;
    color: #374151;
    font-weight: 600;
    border-right: 3px double #e5e7eb;
    position: relative;
    z-index: 2;
    will-change: transform;
}

/* Custom scrollbars */
.vg-scrollbar {
    height: 28px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: stretch;
    user-select: none;
}
.vg-scrollbar-bottom {
    position: sticky;
    bottom: 0;
    z-index: 6;
    border-top: 1px solid #e5e7eb;
    border-bottom: none;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Arrow buttons */
.vg-scroll-btn {
    flex: 0 0 36px;
    background: #f8fafc;
    border: none;
    border-right: 1px solid #e5e7eb;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 120ms, color 120ms;
    padding: 0;
}
.vg-scroll-btn:last-child {
    border-right: none;
    border-left: 1px solid #e5e7eb;
}
.vg-scroll-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.vg-scroll-btn:active {
    background: #cbd5e1;
}

/* Track (clickable area for the thumb) */
.vg-scrollbar-track {
    flex: 1 1 auto;
    position: relative;
    cursor: pointer;
}

.vg-scrollbar-thumb {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    background: #94a3b8;
    border-radius: 9999px;
    cursor: grab;
    will-change: transform, width;
    transition: background-color 120ms;
}
.vg-scrollbar-thumb:hover { background: #64748b; }
.vg-scrollbar-thumb:active { cursor: grabbing; background: #475569; }

/* Product header cell — fixed 130px */
.vg-cell-product {
    border-bottom: 2px solid #e5e7eb;
    height: 130px;
    box-sizing: border-box;
    background: #fff;
}
.vg-row-product .vg-corner {
    height: 130px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e5e7eb;
}
.vg-product-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-decoration: none;
    color: inherit;
}
.vg-product-title {
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    font-size: 0.92rem;
}

/* Score */
.vg-cell-score {
    color: #111827;
    font-weight: 500;
    border-bottom: 2px solid #e5e7eb;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vg-row-score .vg-corner {
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
}
.vg-score-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 120ms;
}
.vg-score-link:hover { opacity: 0.75; }
.vg-score-link:hover strong { text-decoration: underline; }
.vg-score-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.vg-cell-center { text-align: center; }

.vg-cell-image .vg-product-img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.4rem;
    display: block;
    margin: 0 auto;
}

.vg-cell-brand {
    color: #4b5563;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vg-cell-cta {
    padding-top: 0.4rem;
    padding-bottom: 1rem;
}

/* Review link row */
.vg-review-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 120ms;
}
.vg-review-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}
.vg-review-link svg { transition: transform 120ms; }
.vg-review-link:hover svg { transform: translateX(2px); }

/* Amazon CTA — matches the .btn-store.btn-amazon style on the review page */
.btn-store {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    transition: transform 0.15s, opacity 0.15s;
    background: #e5e7eb;
    color: #111;
    box-sizing: border-box;
}
.btn-store:hover {
    opacity: 0.9;
    transform: translateY(1px);
    color: #111;
}
.btn-store.btn-amazon {
    background: #ff9900;
}

.vg-cell-pros { background: #ecfdf5; color: #065f46; }
.vg-cell-cons { background: #fef2f2; color: #991b1b; }

.vergleich-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.vergleich-list li {
    position: relative;
    padding-left: 1.2rem;
    font-size: 12px;
    line-height: 1.4;
}
.vergleich-list li::before {
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    width: 1.1rem;
    text-align: center;
}
.vergleich-list-pros li::before { content: "+"; color: #047857; }
.vergleich-list-cons li::before { content: "−"; color: #b91c1c; }

.vergleich-shops {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    color: #374151;
    font-size: 0.9rem;
}
.vergleich-shop-badge {
    display: inline-block;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    border-radius: 0.4rem;
    padding: 0.2rem 0.6rem;
    margin-left: 0.5rem;
    font-weight: 500;
}

@media (max-width: 800px) {
    .vg-row-inner { font-size: 0.85rem; }
    .vg-cell-image .vg-product-img { width: 90px; height: 90px; }
}
