/* Wrapper */
.rwpc-wrapper {
    position: relative;
    width: 100%;
    padding: 60px 0 40px;
    perspective: 1600px;
    /* overflow: hidden is now permanently removed to allow overflow */
}

/* Track (row of cards) */
.rwpc-track {
    --rwpc-gap: 40px;
    --rwpc-curve-intensity: 12deg;
    --rwpc-curve-depth: 30px;

    display: flex;
    justify-content: center;
    gap: var(--rwpc-gap);
    transform-style: preserve-3d;
    width: 100%;
    /* Allow scrolling for navigation */

    padding: 0 20px; /* Add padding to prevent first/last card from sticking to edge */
    scroll-behavior: smooth; /* Make JS scrolling smooth */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}
/* Hide scrollbar for Webkit browsers (Chrome, Safari) */
.rwpc-track::-webkit-scrollbar {
    display: none;
}


/* Card */
.rwpc-card {
    position: relative;
    width: 260px;
    flex-shrink: 0; /* Important for horizontal scrolling */
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transform-origin: center bottom;
    /* ADDED: Smooth transition for the curve effect */
    transition: transform 0.3s ease-out, box-shadow 0.3s ease; 
}

/* ADDED: Hover effect to make card static (flat) */
.rwpc-card:hover {
    /* Use !important to override the inline transform set by JavaScript */
    transform: translateY(0) rotateZ(0deg) scale(1.05) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    z-index: 10; /* Bring hovered card to front */
}

/* Image Thumbnail Container (new styles for height/margin) */
.rwpc-thumb {
    overflow: hidden;
}

.rwpc-thumb img {
    display: block;
    width: 100%;
    height: auto; /* Default to auto height */
    object-fit: cover; /* Ensures images fill the container if height is set */
}

.rwpc-title {
    font-size: 16px;
    line-height: 1.4;
    margin: 12px 16px 6px;
    font-weight: 600;
}

.rwpc-title a {
    color: #333;
    text-decoration: none;
}

.rwpc-price {
    margin: 0 16px 12px;
    font-weight: 600;
    color: #444;
}

.rwpc-add-to-cart {
    margin: 0 16px 18px;
	 text-align: center;
}

.rwpc-add-to-cart .button {
    width: 100%;
    border-radius: 999px;
    padding: 8px 18px;
    text-align: center;
}

/* Rating stars in corner (replacing bookmark) */
.rwpc-rating {
    position: absolute;
    top: 10px;
    right: 16px;
    z-index: 5;
}

.rwpc-rating .star-rating {
    margin: 0;
}

/* Curve effect using nth-child-like offset via data-index & JS */
.rwpc-card {
    transform: translateY(0) rotateZ(0deg);
}

/* Navigation */
.rwpc-nav {
    margin-top: 26px;
    display: flex;
    justify-content: center;
    gap: 18px;
}

.rwpc-nav-btn {
    position: relative;
    border: none;
    border-radius: 999px;
    padding: 8px 32px;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    outline: none;
}

.rwpc-nav-btn:hover {
    background: rgba(0, 0, 0, 0.35);
}

.rwpc-nav-icon {
    display: block;
    width: 28px;
    height: 16px;
    position: relative;
}

.rwpc-nav-icon::before,
.rwpc-nav-icon::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: #fff;
}

/* Horizontal line */
.rwpc-nav-icon::before {
    top: 50%;
    left: 4px;
    right: 4px;
    height: 2px;
    transform: translateY(-50%);
}

/* Curved hook */
.rwpc-nav-icon::after {
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    top: 3px;
}

.rwpc-nav-icon-left::after {
    left: 4px;
    border-right: none;
    border-bottom: none;
}

.rwpc-nav-icon-right::after {
    right: 4px;
    border-left: none;
    border-bottom: none;
}

/* Responsive (Now using a unified scrolling method) */
@media (max-width: 1024px) {
    /* Keep the curve transformation, but the track is now always scrollable */
    .rwpc-track {
        /* No need to override overflow-x: auto here, it's set above */
        padding: 0 20px;
        justify-content: flex-start; /* Align left for better mobile scrolling */
    }

    .rwpc-card {
        flex: 0 0 260px;
    }
}