/* Krishi Care product section only */
.kc-products-section {
    padding: 0 16px;
    margin: 18px 0 22px;
    overflow: hidden;
    color: #20251f;
    font-family: Arial, Helvetica, sans-serif;
}

.kc-products-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 11px;
}

    .kc-products-heading h2 {
        margin: 0;
        font-size: 16px;
        line-height: 1.25;
        font-weight: 800;
    }

    .kc-products-heading a {
        color: #62695f;
        text-decoration: none;
        font-size: 10px;
        white-space: nowrap;
    }

.kc-products-viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

    .kc-products-viewport::-webkit-scrollbar {
        display: none;
    }

.kc-products-track {
    display: grid;
    grid-auto-flow: column;
    /* Four cards visible at once on a typical mobile viewport */
    grid-auto-columns: calc((100vw - 48px) / 4);
    gap: 8px;
    align-items: stretch;
    padding: 1px 1px 2px;
}

.kc-product-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eceee8;
    border-radius: 9px;
    scroll-snap-align: start;
}

.kc-product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8faf6;
    overflow: hidden;
}

    .kc-product-image img {
        display: block;
        width: 100%;
        height: 100%;
        padding: 3px;
        object-fit: contain;
    }

.kc-favorite {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 19px;
    height: 19px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #ffffffed;
    color: #26bd5c;
    font-size: 17px;
    line-height: 1;
}

    .kc-favorite.is-favorite {
        color: #e64755;
    }

.kc-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 4px 4px 6px;
}

.kc-product-origin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    margin-bottom: 4px;
    color: #4f594d;
    font-size: 9px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kc-origin-dot {
    color: #4b9a3d;
    font-size: 7px;
}

.kc-product-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    min-height: 23px;
    margin: 0 0 5px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
}

.kc-product-price {
    margin-top: auto;
    text-align: center;
    color: #269d43;
    font-size: clamp(8px, 2.4vw, 11px);
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.kc-product-unit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-top: 3px;
    color: #61675e;
    font-size: 8px;
    line-height: 1.15;
    white-space: nowrap;
}

.kc-unit-chevron {
    font-size: 12px;
}

.kc-product-action {
    margin-top: auto;
}

.kc-add-to-cart {
    display: block;
    width: 100%;
    min-height: 27px;
    padding: 4px 2px;
    border: 0;
    border-radius: 0 0 8px 8px;
    background: #2dbd50;
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

    .kc-add-to-cart:active {
        background: #239b41;
    }

.kc-carousel-indicator {
    width: 58%;
    height: 4px;
    margin: 10px auto 0;
    overflow: hidden;
    border-radius: 99px;
    background: #edf0ec;
}

    .kc-carousel-indicator span {
        display: block;
        width: 35%;
        height: 100%;
        border-radius: inherit;
        background: #424840;
        transform: translateX(0);
        transition: transform .1s linear;
    }

/* Keep four visible where possible, while avoiding tiny cards on very narrow screens. */
@media (min-width: 430px) {
    .kc-products-track {
        grid-auto-columns: calc((100% - 24px) / 4);
    }
}

@media (max-width: 340px) {
    .kc-products-track {
        grid-auto-columns: calc((100vw - 44px) / 4);
        gap: 6px;
    }

    .kc-product-name {
        font-size: 8px;
    }

    .kc-product-origin {
        font-size: 7px;
    }

    .kc-add-to-cart {
        font-size: 7px;
    }
}


/* Updated layout: three cards in a row; center-align all product details. */
.kc-products-track {
    grid-auto-columns: calc((100vw - 48px) / 3);
    gap: 8px;
}

.kc-product-card,
.kc-product-info,
.kc-product-origin,
.kc-product-name,
.kc-product-price,
.kc-product-unit,
.kc-product-action {
    text-align: center;
}

.kc-product-info {
    align-items: stretch;
}

.kc-product-name {
    width: 100%;
    min-height: 30px;
    margin-left: auto;
    margin-right: auto;
}

.kc-product-price {
    width: 100%;
    font-size: clamp(10px, 3vw, 14px);
}

.kc-product-unit {
    width: 100%;
    margin-top: 4px;
}

.kc-variant-dropdown {
    display: block;
    /*width: 100%;*/
    max-width: 100%;
    min-width: 0;
    padding: 3px 14px 3px 4px;
    border: 1px solid #e1e8dc;
    border-radius: 5px;
    background-color: #fff;
    color: #50584d;
    font: inherit;
    font-size: 10px;
    text-align: center;
    text-align-last: center;
    appearance: auto;
}

.kc-add-to-cart {
    font-size: clamp(8px, 2.5vw, 11px);
}

@media (min-width: 430px) {
    .kc-products-track {
        grid-auto-columns: calc((100% - 16px) / 3);
    }
}

@media (max-width: 340px) {
    .kc-products-track {
        grid-auto-columns: calc((100vw - 44px) / 3);
        gap: 6px;
    }

    .kc-variant-dropdown {
        font-size: 9px;
        padding-left: 2px;
        padding-right: 10px;
    }
}
