/* ==========================================================
   RELATED PRODUCTS — HORIZONTAL SLIDER
   ========================================================== */

.related-products-section.layout-slider {
    margin-top: 2.75rem;
    padding: 2.25rem 0 2.75rem;
    border-top: 1px solid #E3E6EB; /* abu premium */
    background-color: #FFFFFF; /* PUTIH */
}

/* HEADER */
.related-products-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.3rem;
}

.related-products-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #101010; /* hitam elegan */
}

.related-products-summary {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    color: #4A4A4A; /* abu premium */
}

.rp-slider-hint {
    font-size: 0.8rem;
    color: #6B7280;
    white-space: nowrap;
}

/* SLIDER SHELL */
.rp-slider-shell {
    position: relative;
}

/* CONTAINER SLIDER */
.rp-slider {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* scrollbar */
.rp-slider::-webkit-scrollbar {
    height: 6px;
}
.rp-slider::-webkit-scrollbar-track {
    background: transparent;
}
.rp-slider::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 999px;
}
.rp-slider:hover::-webkit-scrollbar-thumb {
    background: #9CA3AF;
}

/* Fading right */
.rp-slider-fade-right {
    pointer-events: none;
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(to left, #FFFFFF 40%, rgba(255, 255, 255, 0));
}

/* CARD SLIDE */
.rp-card-slide {
    scroll-snap-align: start;
    flex: 0 0 220px;
}

@media (min-width: 640px) {
    .rp-card-slide {
        flex-basis: 230px;
    }
}
@media (min-width: 1024px) {
    .rp-card-slide {
        flex-basis: 250px;
    }
}

/* CARD BASE */
.rp-card {
    background-color: #FFFFFF;
    border-radius: 0.9rem;
    border: 1px solid #E3E6EB; /* abu premium */
    overflow: hidden;

    display: flex;
    flex-direction: column;

    box-shadow: 0 10px 30px rgba(30, 107, 255, 0.04); /* biru soft */
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.rp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(30, 107, 255, 0.12); /* biru hover */
    border-color: #D1D5DB;
}

.rp-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* IMAGE */
.rp-card-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background-color: #F3F4F6;
}

.rp-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.rp-card:hover .rp-card-image {
    transform: scale(1.05);
}

/* BADGE CATEGORY */
.rp-card-badge {
    position: absolute;
    left: 0.6rem;
    top: 0.6rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.85); /* tetap gelap agar kontras */
    color: #F9FAFB;
    font-size: 0.7rem;
    font-weight: 500;
}

/* BODY */
.rp-card-body {
    padding: 0.75rem 0.9rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1 1 auto;
}

/* PRICE */
.rp-card-price {
    font-size: 0.98rem;
    font-weight: 700;
    color: #1E6BFF; /* biru brand */
    margin-bottom: 0.1rem;
}

/* TITLE */
.rp-card-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #101010; /* hitam elegan */
    line-height: 1.4;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* DESCRIPTION */
.rp-card-desc {
    margin: 0.1rem 0 0.25rem;
    font-size: 0.8rem;
    color: #6B7280;
    line-height: 1.4;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* FOOTER: REVIEW + CTA */
.rp-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

/* REVIEW */
.rp-card-review {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6B7280;
}

.rp-card-review-empty {
    color: #9CA3AF;
    font-style: italic;
}

.rp-card-stars {
    color: #F59E0B; /* kuning rating */
    font-size: 0.82rem;
}

.rp-card-review-count {
    font-size: 0.74rem;
}

/* CTA TEXT */
.rp-card-cta {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1E6BFF; /* biru brand */
    white-space: nowrap;
}

/* PAGINATION – gaya pill premium */
.related-products-pagination {
    margin-top: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: #F5F7FB; /* strip lembut */
    border: 1px solid #E3E6EB;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

/* link dasar */
.rp-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background-color: transparent;

    font-size: 0.82rem;
    font-weight: 500;
    color: #4A4A4A;
    text-decoration: none;

    transition: background-color 0.16s ease, 
                color 0.16s ease, 
                border-color 0.16s ease, 
                box-shadow 0.16s ease,
                transform 0.12s ease;
}

/* hover state angka biasa */
.rp-page-link:hover:not(.current):not(.disabled) {
    background-color: #FFFFFF;
    border-color: #D1D5DB;
    color: #101010;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
    transform: translateY(-1px);
}

/* ACTIVE PAGE (biru gradient bulat) */
.rp-page-link.current {
    background: linear-gradient(135deg, #1E6BFF, #0C56E9);
    color: #FFFFFF;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(30, 107, 255, 0.35);
    cursor: default;
}

/* ARROWS (prev / next) */
.rp-page-link.prev,
.rp-page-link.next {
    font-size: 0.9rem;
    font-weight: 600;
    background-color: #FFFFFF;
    border-color: #D1D5DB;
    color: #374151;
    box-shadow: 0 4px 10px rgba(30, 107, 255, 0.12);
}

.rp-page-link.prev:hover,
.rp-page-link.next:hover {
    background: #101010;
    color: #FFFFFF;
    border-color: #101010;
}

/* optional: state disabled kalau mau dipakai di PHP nanti */
.rp-page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .related-products-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .rp-slider-fade-right {
        width: 40px;
    }
}

@media (max-width: 480px) {
    .related-products-section.layout-slider {
        padding-inline: 0.75rem;
    }
    .rp-card-slide {
        flex-basis: 200px;
    }

    .related-products-pagination {
        padding: 0.3rem 0.5rem;
        gap: 0.25rem;
    }

    .rp-page-link {
        min-width: 1.9rem;
        height: 1.9rem;
        font-size: 0.78rem;
    }

    .rp-page-link.prev,
    .rp-page-link.next {
        padding: 0 0.45rem;
    }
}

/* ===============================
   SLIDER NAVIGATION ARROWS
   =============================== */

.rp-slider-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.rp-arrow {
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: bold;
    color: #374151;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: all .18s ease;
    box-shadow: 0 4px 12px rgba(30, 107, 255, 0.08); /* biru soft */
}

.rp-arrow:hover {
    background: #101010;
    color: #FFFFFF;
    border-color: #101010;
    transform: translateY(-2px);
}

.rp-arrow:active {
    transform: scale(0.92);
}

/* hide arrows on mobile */
@media (max-width: 640px) {
    .rp-slider-nav {
        display: none;
    }
}
