/* ─────────────────────────────────────────────
   Block: Tuotekategoriakaruselli (fp_category_carousel)
   ───────────────────────────────────────────── */

.fp-cat-section {
    padding: 56px 24px;
    background: #f8f8f8;
}

.fp-cat-inner {
    max-width: 1280px;
    margin: 0 auto;
}

/* ── Section header ── */
.fp-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.fp-cat-header h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin: 0;
    padding: 0;
    color: #2e2e2d;
}

.fp-cat-viewall {
    color: #b51f1f;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.fp-cat-viewall:hover {
    gap: 8px;
    color: #911919;
}

.fp-cat-viewall svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ── Scroller wrapper ── */
.fp-cat-wrap {
    position: relative;
}

.fp-cat-scroller {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-top: 6px;
    padding-bottom: 8px;
    padding-inline: 2px;
    scrollbar-width: none;
}

.fp-cat-scroller::-webkit-scrollbar {
    display: none;
}

/* ── Arrow buttons ── */
.fp-cat-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #d5dce1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s, opacity 0.2s;
    padding: 0;
}

.fp-cat-arrow:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.fp-cat-arrow svg {
    width: 16px;
    height: 16px;
    fill: #2e2e2d;
}

.fp-cat-arrow.is-prev { left: -14px; }
.fp-cat-arrow.is-next { right: -14px; }

/* ── Category card ── */
.fp-cat-card {
    flex-shrink: 0;
    scroll-snap-align: start;
    width: 200px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    position: relative;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.fp-cat-card:visited {
    color: #fff;
}

.fp-cat-card:hover {
    transform: translateY(-4px);
    border-color: #b51f1f;
    color: rgba(255, 255, 255, 0.88);
}

/* Inner border ring — absolute overlay so it paints over the image
   and is never clipped by the parent scroller's overflow */
.fp-cat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    pointer-events: none;
    z-index: 3;
    transition: border-color 0.2s;
}

.fp-cat-card:hover::before {
    border-color: #b51f1f;
}

/* Partially visible card — peek overlay, fades in on hover */
.fp-cat-card.is-peeking::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.40);
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.fp-cat-card.is-peeking:hover::after {
    opacity: 1;
}

/* Suppress overlay while the scroller is in motion */
.fp-cat-scroller.is-scrolling .fp-cat-card.is-peeking:hover::after {
    opacity: 0;
    transition: none;
}

.fp-cat-card-img {
    height: 240px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    overflow: hidden;
    background: #fff;
}

.fp-cat-card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
    display: block;
}

.fp-cat-card:hover .fp-cat-card-img img {
    transform: scale(1.06);
}

.fp-cat-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.60) 100%);
    z-index: 1;
}

.fp-cat-card-name {
    position: relative;
    z-index: 2;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

.fp-cat-card-count {
    position: relative;
    z-index: 2;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.60);
    margin-top: 2px;
}
