/* =========================
   Products Section Slider
========================= */

.products-row-wrapper {
    position: relative;
}

/* IMPORTANT: hide overflow ONLY for slider */
.products-row-wrapper.is-slider {
    overflow: hidden;
}

/* GRID */
.products-row-wrapper.is-grid .products-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* =========================
   SLIDER (Animated – NO SCROLL)
========================= */

.products-row-wrapper.is-slider .products-cards-grid {
    display: flex;
    gap: 20px;

    /* disable scroll behavior */
    overflow: visible;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: auto;

    /* animation handled by JS */
    transform: translateX(0);
    will-change: transform;
    padding-bottom: 0;
}

/* remove scrollbar leftovers safely */
.products-row-wrapper.is-slider .products-cards-grid::-webkit-scrollbar {
    display: none;
}
.products-row-wrapper.is-slider .products-cards-grid {
    scrollbar-width: none;
}

/* card width – unchanged */
.products-row-wrapper.is-slider .product-card-stack {
    flex: 0 0 calc((100% - (4 * 20px)) / 5);
}

/* =========================
   Product Card (FIXED HEIGHT)
========================= */

.product-card-vertical {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    display: flex;
    flex-direction: column;
    min-height: 430px;
    overflow: hidden;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.product-card-vertical:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(0,0,0,.08);
}

/* =========================
   Product Image (TOP FIXED)
========================= */

.product-thumb {
    position: relative;
    width: 100%;
    height: 190px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f8f8;
}

.product-thumb-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.01);
    transition: opacity .75s ease, transform .75s ease, visibility 0s linear .75s;
    backface-visibility: hidden;
    will-change: opacity, transform;
}

.product-thumb-image.is-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity .75s ease, transform .75s ease, visibility 0s linear 0s;
}

/* =========================
   Product Body (STRUCTURED)
========================= */

.product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px;
    text-align: center;
}

/* top – variable */
.product-body-top {
    flex-shrink: 0;
}

/* bottom – fixed */
.product-body-bottom {
    margin-top: auto;
}

/* =========================
   Category
========================= */

.product-category {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

/* =========================
   Title
========================= */

.product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #111;
    transition: color .25s ease;
}

.product-card-vertical:hover .product-name {
    color: var(--primary-color);
}

/* =========================
   Rating
========================= */

.product-rating {
    margin-bottom: 6px;
}

.star-filled { color: #f5b301; }
.star-empty  { color: #ddd; }

/* =========================
   Price (FIXED LINE)
========================= */

.product-prices {
    margin-bottom: 12px;
    white-space: nowrap;
}

.price-current {
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

.price-old {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    margin-inline-end: 6px;
}

/* =========================
   Product Button (LOCKED BOTTOM)
========================= */

.product-btn {
    display: block;
    width: 100%;
    padding: 12px 0;
    text-align: center;

    background-color: var(--primary-color);
    background-image: url("/themes/matjari/assets/img/button-bg.svg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;

    color: #ffffff !important;
    font-weight: 600;
    text-decoration: none;

    border: none;
    border-radius: 6px;

    transition: background-color .25s ease;
}

.product-card-vertical:hover .product-btn,
.product-btn:hover {
    background-color: var(--danger-color, #e22222);
    color: #ffffff !important;
}

/* =========================
   Section Title Decoration
========================= */

.section-head--styled h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-head--styled h2::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    width: 100%;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* =========================
   Responsive
========================= */

@media (max-width: 991px) {
    .products-row-wrapper.is-grid .products-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .products-row-wrapper.is-slider .product-card-stack {
        flex: 0 0 calc((100% - (2 * 20px)) / 3);
    }
}

@media (max-width: 575px) {
    .products-row-wrapper.is-grid .products-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-row-wrapper.is-slider .product-card-stack {
        flex: 0 0 calc((100% - 20px) / 2);
    }
}




.product-card-floating-badge span:last-child{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}


.product-card-stack {
    position: relative;
    padding-top: 18px;
    min-width: 0;
}

.products-row-wrapper.is-grid .product-card-stack {
    width: 100%;
}

.product-card-floating-badge {
    position: absolute;
    top: 0;
    inset-inline-start: 12px;
    z-index: 5;
    max-width: calc(100% - 24px);
    box-shadow: 0 8px 20px rgba(15,23,42,.14);
    pointer-events: none;
}
