/* :root variables removed - using assets/css/variables.css */

.carousel-container-posts {
    font-family: var(--cb-font-main);
    margin: 40px 0;
    position: relative;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.carousel-title,
.purpose-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cb-text-main);
    margin: 0;
}

.highlight-text {
    color: var(--cb-color-primary);
    background: linear-gradient(120deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 100%);
    padding: 0 5px;
    border-radius: 4px;
}

#view-all-btn {
    background: var(--cb-gradient-primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--cb-font-main);
    font-size: 0.9rem;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

#view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-inner {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 4px;
    /* Space for shadow */
    -ms-overflow-style: none;
    scrollbar-width: none;
    width: 100%;

    /* Scroll Snap */
    scroll-snap-type: x mandatory;
    padding-left: 0;
    /* Align first item to left edge */
}

.carousel-inner::-webkit-scrollbar {
    display: none;
}

/* Card Styling */
.card {
    flex: 0 0 280px;
    background: var(--cb-bg-card);
    border-radius: var(--cb-radius-md);
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: auto;

    /* Scroll Snap Alignment */
    scroll-snap-align: start;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #e2e8f0;
}

.carousel-card-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
}

.carousel-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.card:hover .carousel-card-image img {
    transform: scale(1.05);
}

.card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cb-text-main);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
    /* Fixed height for title alignment */
}

.card .price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cb-text-main);
    margin: 0;
    margin-top: auto;
    /* Push to bottom */
}

/* BeforeBuy Score Badge */
.score {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 2;
}

.score .score-text {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(90deg, #399CAC, #008E42);
    -webkit-background-clip: text;
    background-clip: text;
    /* Standard property */
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1;
}

.score p {
    font-size: 0.5rem;
    text-transform: uppercase;
    color: #64748b;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Nav Buttons */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--cb-color-primary);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: var(--cb-color-primary);
    color: #fff;
    border-color: var(--cb-color-primary);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: -22px;
}

.carousel-next {
    right: -22px;
}

@media (max-width: 768px) {

    /* Navigation: Hidden on mobile for natural swipe/scroll */
    .carousel-prev,
    .carousel-next {
        display: none !important;
    }

    .carousel-inner {
        gap: 16px;
    }

    /* Cards: 220px width to show enough content + peek */
    .card {
        flex: 0 0 220px;
    }

    /* Header: Reduced title font size */
    .carousel-title,
    .purpose-heading {
        font-size: 1.25rem;
    }

    /* Header: Reduced button padding and font size */
    #view-all-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}