/* =========================================================
   KAMAYO HOMEPAGE - PRODUCT CARD CSS
   File: public_html/assets/css/home/product-card.css
   Version: 2026-05-05 mobile-safe-3col-auto-responsive

   Purpose:
   - Single source for homepage product tabs, grids, product cards,
     product shelf cards and product skeleton loaders.
   - Loads AFTER /assets/css/home.css and category-section.css.
   - No cart calculation, checkout, order, price, reward or delivery logic here.

   Mobile target:
   - 360 / 375 / 390 / 412 CSS width: 3 product columns.
   - Below 345px only: 2 product columns fallback.
   - 360-380px gets compact internal card sizing so ADD / - 1 + does not cut.
========================================================= */

/* =========================================================
   PRODUCT TABS / GRIDS
========================================================= */

.km-tabs,
#km-home-tabs{
    display:flex;
    align-items:center;
    gap:10px;
    overflow-x:auto;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
    padding:0 0 6px;
    margin:0 0 12px;
}

.km-tabs::-webkit-scrollbar,
#km-home-tabs::-webkit-scrollbar{
    display:none;
}

.km-tab{
    appearance:none;
    -webkit-appearance:none;
    flex:0 0 auto;
    min-height:40px;
    padding:0 16px;
    border-radius:999px;
    border:1px solid rgba(16,24,40,.08);
    background:#fff;
    color:#344054;
    font-size:12px;
    font-weight:950;
    cursor:pointer;
    box-shadow:0 5px 14px rgba(15,23,42,.04);
}

.km-tab.active{
    background:#166534;
    color:#fff;
    border-color:var(--km-green,#16a34a);
    box-shadow:0 9px 18px rgba(22,163,74,.20);
}

#km-products-wrap,
#km-offers-wrap,
#km-fast-wrap,
#km-grocery-wrap{
    min-height:320px;
}

.km-grid,
#km-products-wrap .km-grid,
#km-offers-wrap .km-grid,
#km-fast-wrap .km-grid,
#km-grocery-wrap .km-grid{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:16px;
    align-items:stretch;
}

/* =========================================================
   PRODUCT CARD BASE
========================================================= */

.km-card{
    position:relative;
    min-width:0;
    width:100%;
    display:flex;
    flex-direction:column;
    gap:8px;
    min-height:318px;
    padding:12px;
    border-radius:18px;
    background:#fff;
    border:1px solid rgba(16,24,40,.06);
    box-shadow:0 8px 20px rgba(15,23,42,.05);
    overflow:hidden;
}

.km-card-badges{
    position:absolute;
    left:8px;
    top:8px;
    z-index:3;
    display:flex;
    align-items:center;
    gap:4px;
    max-width:calc(100% - 16px);
    min-height:20px;
    pointer-events:none;
    overflow:hidden;
}

.km-badge,
.km-discount-badge{
    min-width:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:20px;
    padding:0 7px;
    border-radius:999px;
    background:var(--km-green,#16a34a);
    color:#fff;
    font-size:9px;
    font-weight:950;
    line-height:1;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    box-shadow:0 5px 12px rgba(22,163,74,.18);
}

.km-badge-stockout,
.km-out-stock-badge{
    background:#b91c1c;
    color:#fff;
}

.km-tab:focus-visible,
.km-view-btn:focus-visible,
.km-add-btn:focus-visible,
.km-choose-btn:focus-visible,
.km-qty-btn:focus-visible{
    outline:3px solid rgba(20,83,45,.42);
    outline-offset:3px;
    box-shadow:0 0 0 4px rgba(220,252,231,.95);
}

.km-image-box{
    width:100%;
    aspect-ratio:1/1;
    min-height:0;
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    border-radius:16px;
    background:#f6f8fb;
}

.km-image-box img{
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
    object-position:center;
    padding:8px;
    margin:0;
    transform:scale(1);
    transition:transform .22s ease;
    will-change:transform;
}

@media (hover:hover) and (pointer:fine){
    .km-card:hover .km-image-box img,
    .km-shelf-card:hover .km-shelf-image img{
        transform:scale(1.06);
    }
}

.km-name{
    min-width:0;
    min-height:38px;
    max-height:38px;
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    color:#101828;
    font-size:13px;
    line-height:1.42;
    font-weight:950;
    word-break:break-word;
}

.km-pack-meta,
.km-meta{
    min-width:0;
    min-height:16px;
    color:#475467;
    font-size:11px;
    line-height:1.35;
    font-weight:850;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.km-options,
.km-options-label{
    color:#64748b;
    font-weight:850;
}

.km-points-row{
    min-width:0;
    min-height:24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:6px;
}

.km-points-chip{
    max-width:64%;
    min-width:0;
    min-height:22px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:0 7px;
    border-radius:999px;
    background:#ecfdf3;
    color:#047857;
    font-size:10px;
    line-height:1;
    font-weight:950;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.km-stock-text,
.km-stock{
    min-width:0;
    color:#475467;
    font-size:10px;
    line-height:1;
    font-weight:900;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.km-stock-out,
.km-out-stock{
    color:#b91c1c;
}

.km-price-row,
.km-shelf-price-row{
    min-width:0;
    min-height:29px;
    display:flex;
    align-items:flex-end;
    gap:6px;
    flex-wrap:nowrap;
    margin-top:auto;
    overflow:hidden;
}

.km-price-now,
.km-shelf-price{
    min-width:0;
    color:#0f172a;
    font-size:20px;
    line-height:1.05;
    font-weight:950;
    letter-spacing:-.035em;
    white-space:nowrap;
}

.km-price-mrp,
.km-shelf-mrp{
    min-width:0;
    color:#64748b;
    font-size:11px;
    font-weight:850;
    text-decoration:line-through;
    white-space:nowrap;
    margin-bottom:2px;
    overflow:hidden;
    text-overflow:ellipsis;
}

.km-card-bottom{
    width:100%;
    min-width:0;
    display:grid;
    grid-template-columns:58px minmax(0,1fr);
    gap:8px;
    align-items:stretch;
    flex:0 0 auto;
    min-height:42px;
}

.km-action-box{
    width:100%;
    min-width:0;
    display:flex;
    align-items:stretch;
    overflow:visible;
}

.km-view-btn,
.km-add-btn,
.km-choose-btn{
    appearance:none;
    -webkit-appearance:none;
    width:100%;
    min-width:0;
    min-height:42px;
    height:42px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:13px;
    font-size:11px;
    line-height:1;
    font-weight:950;
    white-space:nowrap;
    text-align:center;
    cursor:pointer;
    user-select:none;
    text-decoration:none;
    overflow:hidden;
    text-overflow:ellipsis;
}

.km-view-btn{
    border:1px solid rgba(16,24,40,.08);
    background:#fff;
    color:#111827;
    box-shadow:0 4px 12px rgba(15,23,42,.04);
}

.km-add-btn,
.km-choose-btn{
    border:1px solid rgba(22,163,74,.22);
    background:#ecfdf3;
    color:#047857;
}

.km-add-btn:not(:disabled):active,
.km-choose-btn:not(:disabled):active,
.km-view-btn:not(:disabled):active{
    transform:translateY(1px);
}

.km-add-btn:disabled,
.km-choose-btn:disabled,
.km-view-btn:disabled{
    opacity:.58;
    cursor:not-allowed;
}

/* ADD -> - 1 + stable pill */
.km-qty-controller{
    width:100%;
    min-width:0;
    min-height:42px;
    height:42px;
    display:grid!important;
    grid-template-columns:32px minmax(20px,1fr) 32px;
    align-items:center;
    gap:4px;
    padding:4px;
    border-radius:13px;
    background:var(--km-green,#16a34a);
    border:1px solid var(--km-green,#16a34a);
    color:#fff;
    overflow:hidden;
}

.km-qty-btn{
    appearance:none;
    -webkit-appearance:none;
    width:32px;
    min-width:32px;
    height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:0;
    border-radius:10px;
    background:transparent;
    color:#fff;
    font-size:18px;
    line-height:1;
    font-weight:950;
    cursor:pointer;
}

.km-qty-btn:disabled{
    opacity:.55;
    cursor:not-allowed;
}

.km-qty-number{
    min-width:0;
    text-align:center;
    color:#fff;
    font-size:13px;
    line-height:1;
    font-weight:950;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* =========================================================
   CATEGORY SHELF / HORIZONTAL CARDS
========================================================= */

.km-category-shelf-section[hidden]{
    display:none!important;
}

.km-category-shelf-wrap{
    overflow-x:auto;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
}

.km-category-shelf-wrap::-webkit-scrollbar{
    display:none;
}

.km-category-shelf-track{
    display:flex;
    gap:12px;
    align-items:stretch;
}

.km-shelf-card{
    flex:0 0 166px;
    width:166px;
    min-width:166px;
    display:flex;
    flex-direction:column;
    gap:8px;
    padding:10px;
    border-radius:16px;
    background:#fff;
    border:1px solid rgba(16,24,40,.06);
    box-shadow:0 8px 18px rgba(15,23,42,.05);
    overflow:hidden;
}

.km-shelf-image{
    width:100%;
    aspect-ratio:1/1;
    border-radius:14px;
    background:#f6f8fb;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
}

.km-shelf-image img{
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
    object-position:center;
    padding:8px;
    margin:0;
    transform:scale(1);
    transition:transform .22s ease;
    will-change:transform;
}

.km-shelf-name{
    min-height:34px;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
    font-size:12px;
    font-weight:950;
    line-height:1.35;
    word-break:break-word;
}

.km-shelf-meta{
    font-size:10px;
    font-weight:850;
    color:#667085;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* =========================================================
   SKELETON / RESERVED LAYOUT
========================================================= */

.km-grid-skeleton,
.km-skeleton-grid{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:16px;
}

.km-skeleton-card{
    min-height:314px;
    border-radius:18px;
    background:linear-gradient(90deg,#f3f4f6 25%,#ffffff 38%,#f3f4f6 63%);
    background-size:400% 100%;
    animation:kmSkeleton 1.15s ease-in-out infinite;
    border:1px solid rgba(16,24,40,.06);
}

.km-skeleton-image,
.km-skeleton-line,
.km-skeleton-btn{
    background:linear-gradient(90deg,#f1f5f9 25%,#e9eef5 37%,#f1f5f9 63%);
    background-size:400% 100%;
    animation:kmSkeleton 1.2s ease infinite;
    border-radius:12px;
}

.km-skeleton-image{
    width:100%;
    aspect-ratio:1/1;
    margin-bottom:10px;
}

.km-skeleton-line{
    height:11px;
    margin-bottom:8px;
}

.km-skeleton-line.short{width:46%;}
.km-skeleton-line.mid{width:70%;}
.km-skeleton-line.long{width:92%;}

.km-skeleton-btn{
    height:34px;
    width:96px;
    margin-top:12px;
}

@keyframes kmSkeleton{
    0%{background-position:100% 50%;}
    100%{background-position:0 50%;}
}

/* =========================================================
   PRODUCT RESPONSIVE BASE
========================================================= */

@media (max-width:1199.98px){
    .km-grid,
    #km-products-wrap .km-grid,
    #km-offers-wrap .km-grid,
    #km-fast-wrap .km-grid,
    #km-grocery-wrap .km-grid,
    .km-grid-skeleton,
    .km-skeleton-grid{
        grid-template-columns:repeat(5,minmax(0,1fr));
    }
}

@media (max-width:991.98px){
    .km-grid,
    #km-products-wrap .km-grid,
    #km-offers-wrap .km-grid,
    #km-fast-wrap .km-grid,
    #km-grocery-wrap .km-grid,
    .km-grid-skeleton,
    .km-skeleton-grid{
        grid-template-columns:repeat(4,minmax(0,1fr));
        gap:12px;
    }

    .km-card{
        min-height:300px;
        padding:9px;
        border-radius:16px;
        gap:7px;
    }
}

/* =========================================================
   MOBILE QUICK-COMMERCE 3-COLUMN SYSTEM
========================================================= */

@media (max-width:767.98px){
    .km-grid,
    #km-products-wrap .km-grid,
    #km-offers-wrap .km-grid,
    #km-fast-wrap .km-grid,
    #km-grocery-wrap .km-grid,
    .km-grid-skeleton,
    .km-skeleton-grid,
    html.km-mobile-device .km-grid,
    html.km-mobile-device #km-products-wrap .km-grid,
    html.km-mobile-device #km-offers-wrap .km-grid,
    html.km-mobile-device #km-fast-wrap .km-grid,
    html.km-mobile-device #km-grocery-wrap .km-grid,
    html.km-mobile-device .km-grid-skeleton,
    html.km-mobile-device .km-skeleton-grid,
    html.km-mobile-compact .km-grid,
    html.km-mobile-compact #km-products-wrap .km-grid,
    html.km-mobile-compact #km-offers-wrap .km-grid,
    html.km-mobile-compact #km-fast-wrap .km-grid,
    html.km-mobile-compact #km-grocery-wrap .km-grid,
    html.km-mobile-compact .km-grid-skeleton,
    html.km-mobile-compact .km-skeleton-grid,
    html.km-mobile-wide .km-grid,
    html.km-mobile-wide #km-products-wrap .km-grid,
    html.km-mobile-wide #km-offers-wrap .km-grid,
    html.km-mobile-wide #km-fast-wrap .km-grid,
    html.km-mobile-wide #km-grocery-wrap .km-grid,
    html.km-mobile-wide .km-grid-skeleton,
    html.km-mobile-wide .km-skeleton-grid{
        display:grid!important;
        grid-template-columns:repeat(3,minmax(0,1fr))!important;
        gap:8px!important;
        align-items:stretch!important;
        width:100%!important;
        min-width:0!important;
    }

    .km-card,
    html.km-mobile-device .km-card,
    html.km-mobile-compact .km-card,
    html.km-mobile-wide .km-card{
        position:relative!important;
        width:100%!important;
        min-width:0!important;
        min-height:0!important;
        height:auto!important;
        padding:7px!important;
        gap:5px!important;
        border-radius:13px!important;
        background:#fff!important;
        border:1px solid rgba(16,24,40,.07)!important;
        box-shadow:0 5px 14px rgba(15,23,42,.045)!important;
        overflow:hidden!important;
    }

    .km-image-box,
    html.km-mobile-device .km-image-box,
    html.km-mobile-compact .km-image-box,
    html.km-mobile-wide .km-image-box{
        width:100%!important;
        height:96px!important;
        min-height:96px!important;
        max-height:96px!important;
        aspect-ratio:auto!important;
        flex:0 0 96px!important;
        border-radius:11px!important;
        background:#f7fafc!important;
        border:1px solid rgba(16,24,40,.035)!important;
        display:flex!important;
        align-items:center!important;
        justify-content:center!important;
        overflow:hidden!important;
    }

    .km-image-box img,
    html.km-mobile-device .km-image-box img,
    html.km-mobile-compact .km-image-box img,
    html.km-mobile-wide .km-image-box img{
        width:100%!important;
        height:100%!important;
        object-fit:contain!important;
        object-position:center!important;
        padding:3px!important;
        margin:0!important;
    }

    .km-card-badges,
    html.km-mobile-device .km-card-badges,
    html.km-mobile-compact .km-card-badges,
    html.km-mobile-wide .km-card-badges{
        top:6px!important;
        left:6px!important;
        gap:3px!important;
        max-width:calc(100% - 12px)!important;
        min-height:17px!important;
    }

    .km-badge,
    .km-discount-badge,
    html.km-mobile-device .km-badge,
    html.km-mobile-device .km-discount-badge,
    html.km-mobile-compact .km-badge,
    html.km-mobile-compact .km-discount-badge,
    html.km-mobile-wide .km-badge,
    html.km-mobile-wide .km-discount-badge{
        min-height:17px!important;
        max-width:100%!important;
        padding:0 5px!important;
        border-radius:999px!important;
        font-size:8px!important;
        line-height:1!important;
        font-weight:950!important;
        box-shadow:0 4px 9px rgba(22,163,74,.18)!important;
    }

    .km-name,
    html.km-mobile-device .km-name,
    html.km-mobile-compact .km-name,
    html.km-mobile-wide .km-name{
        min-width:0!important;
        min-height:34px!important;
        max-height:34px!important;
        margin-top:1px!important;
        color:#0f172a!important;
        font-size:11.8px!important;
        line-height:1.42!important;
        font-weight:950!important;
        letter-spacing:-.015em!important;
        overflow:hidden!important;
        display:-webkit-box!important;
        -webkit-line-clamp:2!important;
        -webkit-box-orient:vertical!important;
        word-break:break-word!important;
    }

    .km-pack-meta,
    .km-meta,
    html.km-mobile-device .km-pack-meta,
    html.km-mobile-device .km-meta,
    html.km-mobile-compact .km-pack-meta,
    html.km-mobile-compact .km-meta,
    html.km-mobile-wide .km-pack-meta,
    html.km-mobile-wide .km-meta{
        min-width:0!important;
        min-height:14px!important;
        color:#64748b!important;
        font-size:9.6px!important;
        line-height:1.25!important;
        font-weight:850!important;
        white-space:nowrap!important;
        overflow:hidden!important;
        text-overflow:ellipsis!important;
    }

    .km-options,
    .km-options-label{
        font-size:9.4px!important;
        color:#475569!important;
        font-weight:850!important;
    }

    .km-points-row,
    html.km-mobile-device .km-points-row,
    html.km-mobile-compact .km-points-row,
    html.km-mobile-wide .km-points-row{
        min-width:0!important;
        min-height:18px!important;
        display:flex!important;
        align-items:center!important;
        justify-content:flex-start!important;
        gap:4px!important;
        overflow:hidden!important;
    }

    .km-points-chip,
    html.km-mobile-device .km-points-chip,
    html.km-mobile-compact .km-points-chip,
    html.km-mobile-wide .km-points-chip{
        min-width:0!important;
        max-width:100%!important;
        min-height:17px!important;
        padding:0 5px!important;
        border-radius:999px!important;
        background:#ecfdf3!important;
        color:#047857!important;
        font-size:8.2px!important;
        line-height:1!important;
        font-weight:950!important;
        white-space:nowrap!important;
        overflow:hidden!important;
        text-overflow:ellipsis!important;
    }

    .km-stock-text,
    .km-stock,
    html.km-mobile-device .km-stock-text,
    html.km-mobile-device .km-stock,
    html.km-mobile-compact .km-stock-text,
    html.km-mobile-compact .km-stock,
    html.km-mobile-wide .km-stock-text,
    html.km-mobile-wide .km-stock{
        display:none!important;
    }

    .km-stock-out,
    .km-out-stock,
    html.km-mobile-device .km-stock-out,
    html.km-mobile-device .km-out-stock,
    html.km-mobile-compact .km-stock-out,
    html.km-mobile-compact .km-out-stock,
    html.km-mobile-wide .km-stock-out,
    html.km-mobile-wide .km-out-stock{
        display:inline-flex!important;
        min-height:17px!important;
        align-items:center!important;
        color:#b91c1c!important;
        font-size:8.2px!important;
        font-weight:950!important;
    }

    .km-price-row,
    .km-shelf-price-row,
    html.km-mobile-device .km-price-row,
    html.km-mobile-device .km-shelf-price-row,
    html.km-mobile-compact .km-price-row,
    html.km-mobile-compact .km-shelf-price-row,
    html.km-mobile-wide .km-price-row,
    html.km-mobile-wide .km-shelf-price-row{
        min-width:0!important;
        min-height:23px!important;
        margin-top:1px!important;
        display:flex!important;
        align-items:flex-end!important;
        gap:3px!important;
        flex-wrap:nowrap!important;
        overflow:hidden!important;
    }

    .km-price-now,
    .km-shelf-price,
    html.km-mobile-device .km-price-now,
    html.km-mobile-device .km-shelf-price,
    html.km-mobile-compact .km-price-now,
    html.km-mobile-compact .km-shelf-price,
    html.km-mobile-wide .km-price-now,
    html.km-mobile-wide .km-shelf-price{
        min-width:0!important;
        color:#0f172a!important;
        font-size:16.5px!important;
        line-height:1.05!important;
        font-weight:950!important;
        letter-spacing:-.04em!important;
        white-space:nowrap!important;
    }

    .km-price-mrp,
    .km-shelf-mrp,
    html.km-mobile-device .km-price-mrp,
    html.km-mobile-device .km-shelf-mrp,
    html.km-mobile-compact .km-price-mrp,
    html.km-mobile-compact .km-shelf-mrp,
    html.km-mobile-wide .km-price-mrp,
    html.km-mobile-wide .km-shelf-mrp{
        min-width:0!important;
        color:#64748b!important;
        font-size:8.8px!important;
        line-height:1!important;
        font-weight:850!important;
        text-decoration:line-through!important;
        margin-bottom:2px!important;
        white-space:nowrap!important;
        overflow:hidden!important;
        text-overflow:ellipsis!important;
    }

    .km-card-bottom,
    html.km-mobile-device .km-card-bottom,
    html.km-mobile-compact .km-card-bottom,
    html.km-mobile-wide .km-card-bottom{
        width:100%!important;
        min-width:0!important;
        display:grid!important;
        grid-template-columns:minmax(0,1fr)!important;
        gap:0!important;
        min-height:40px!important;
        margin-top:2px!important;
    }

    .km-card-bottom .km-view-btn,
    html.km-mobile-device .km-card-bottom .km-view-btn,
    html.km-mobile-compact .km-card-bottom .km-view-btn,
    html.km-mobile-wide .km-card-bottom .km-view-btn{
        display:none!important;
    }

    .km-action-box,
    html.km-mobile-device .km-action-box,
    html.km-mobile-compact .km-action-box,
    html.km-mobile-wide .km-action-box{
        width:100%!important;
        min-width:0!important;
        display:flex!important;
        align-items:stretch!important;
        overflow:visible!important;
    }

    .km-add-btn,
    .km-choose-btn,
    html.km-mobile-device .km-add-btn,
    html.km-mobile-device .km-choose-btn,
    html.km-mobile-compact .km-add-btn,
    html.km-mobile-compact .km-choose-btn,
    html.km-mobile-wide .km-add-btn,
    html.km-mobile-wide .km-choose-btn{
        width:100%!important;
        min-width:0!important;
        min-height:40px!important;
        height:40px!important;
        border-radius:10px!important;
        border:1px solid #80d5a2!important;
        background:#effdf4!important;
        color:#047857!important;
        font-size:9.8px!important;
        line-height:1!important;
        font-weight:950!important;
        padding:0 4px!important;
        letter-spacing:0!important;
        display:inline-flex!important;
        align-items:center!important;
        justify-content:center!important;
        box-shadow:inset 0 0 0 1px rgba(255,255,255,.35)!important;
        overflow:hidden!important;
        text-overflow:ellipsis!important;
    }

    .km-qty-controller,
    html.km-mobile-device .km-qty-controller,
    html.km-mobile-compact .km-qty-controller,
    html.km-mobile-wide .km-qty-controller{
        width:100%!important;
        min-width:0!important;
        min-height:40px!important;
        height:40px!important;
        display:grid!important;
        grid-template-columns:31px minmax(14px,1fr) 31px!important;
        gap:1px!important;
        align-items:center!important;
        padding:2px!important;
        border-radius:10px!important;
        background:#16a34a!important;
        border:1px solid #16a34a!important;
        color:#fff!important;
        overflow:hidden!important;
    }

    .km-qty-btn,
    html.km-mobile-device .km-qty-btn,
    html.km-mobile-compact .km-qty-btn,
    html.km-mobile-wide .km-qty-btn{
        width:31px!important;
        min-width:31px!important;
        height:34px!important;
        border-radius:8px!important;
        font-size:15px!important;
        padding:0!important;
    }

    .km-qty-number,
    html.km-mobile-device .km-qty-number,
    html.km-mobile-compact .km-qty-number,
    html.km-mobile-wide .km-qty-number{
        min-width:0!important;
        font-size:11px!important;
        font-weight:950!important;
        color:#fff!important;
        text-align:center!important;
        overflow:hidden!important;
        text-overflow:ellipsis!important;
    }

    .km-shelf-card{
        flex-basis:138px!important;
        width:138px!important;
        min-width:138px!important;
    }
}

/* 360 / 375 compact guard: 3 columns stay, inside card becomes tighter. */
@media (max-width:380px){
    .km-grid,
    #km-products-wrap .km-grid,
    #km-offers-wrap .km-grid,
    #km-fast-wrap .km-grid,
    #km-grocery-wrap .km-grid,
    html.km-mobile-device .km-grid,
    html.km-mobile-device #km-products-wrap .km-grid,
    html.km-mobile-device #km-offers-wrap .km-grid,
    html.km-mobile-device #km-fast-wrap .km-grid,
    html.km-mobile-device #km-grocery-wrap .km-grid,
    html.km-mobile-compact .km-grid,
    html.km-mobile-compact #km-products-wrap .km-grid,
    html.km-mobile-compact #km-offers-wrap .km-grid,
    html.km-mobile-compact #km-fast-wrap .km-grid,
    html.km-mobile-compact #km-grocery-wrap .km-grid{
        grid-template-columns:repeat(3,minmax(0,1fr))!important;
        gap:7px!important;
    }

    .km-card,
    html.km-mobile-device .km-card,
    html.km-mobile-compact .km-card{
        padding:5px!important;
        gap:4px!important;
        border-radius:12px!important;
    }

    .km-image-box,
    html.km-mobile-device .km-image-box,
    html.km-mobile-compact .km-image-box{
        height:86px!important;
        min-height:86px!important;
        max-height:86px!important;
        flex-basis:86px!important;
        border-radius:10px!important;
    }

    .km-name,
    html.km-mobile-device .km-name,
    html.km-mobile-compact .km-name{
        min-height:32px!important;
        max-height:32px!important;
        font-size:11px!important;
        line-height:1.42!important;
    }

    .km-pack-meta,
    .km-meta,
    html.km-mobile-device .km-pack-meta,
    html.km-mobile-device .km-meta,
    html.km-mobile-compact .km-pack-meta,
    html.km-mobile-compact .km-meta{
        min-height:13px!important;
        font-size:9px!important;
    }

    .km-points-row,
    html.km-mobile-device .km-points-row,
    html.km-mobile-compact .km-points-row{
        min-height:16px!important;
    }

    .km-points-chip,
    html.km-mobile-device .km-points-chip,
    html.km-mobile-compact .km-points-chip{
        min-height:16px!important;
        padding:0 4px!important;
        font-size:7.8px!important;
    }

    .km-price-row,
    .km-shelf-price-row,
    html.km-mobile-device .km-price-row,
    html.km-mobile-device .km-shelf-price-row,
    html.km-mobile-compact .km-price-row,
    html.km-mobile-compact .km-shelf-price-row{
        min-height:22px!important;
        gap:2px!important;
    }

    .km-price-now,
    .km-shelf-price,
    html.km-mobile-device .km-price-now,
    html.km-mobile-device .km-shelf-price,
    html.km-mobile-compact .km-price-now,
    html.km-mobile-compact .km-shelf-price{
        font-size:15.4px!important;
    }

    .km-price-mrp,
    .km-shelf-mrp,
    html.km-mobile-device .km-price-mrp,
    html.km-mobile-device .km-shelf-mrp,
    html.km-mobile-compact .km-price-mrp,
    html.km-mobile-compact .km-shelf-mrp{
        font-size:8px!important;
        margin-bottom:1px!important;
    }

    .km-card-bottom,
    html.km-mobile-device .km-card-bottom,
    html.km-mobile-compact .km-card-bottom{
        min-height:38px!important;
        margin-top:1px!important;
    }

    .km-add-btn,
    .km-choose-btn,
    html.km-mobile-device .km-add-btn,
    html.km-mobile-device .km-choose-btn,
    html.km-mobile-compact .km-add-btn,
    html.km-mobile-compact .km-choose-btn{
        min-height:38px!important;
        height:38px!important;
        font-size:9.2px!important;
        padding:0 3px!important;
    }

    .km-qty-controller,
    html.km-mobile-device .km-qty-controller,
    html.km-mobile-compact .km-qty-controller{
        min-height:38px!important;
        height:38px!important;
        grid-template-columns:28px minmax(12px,1fr) 28px!important;
        gap:1px!important;
        padding:2px!important;
    }

    .km-qty-btn,
    html.km-mobile-device .km-qty-btn,
    html.km-mobile-compact .km-qty-btn{
        width:28px!important;
        min-width:28px!important;
        height:32px!important;
        font-size:14px!important;
    }

    .km-qty-number,
    html.km-mobile-device .km-qty-number,
    html.km-mobile-compact .km-qty-number{
        font-size:10.5px!important;
    }
}

/* Emergency fallback only. Normal 360px stays 3 columns. */
@media (max-width:344.98px){
    .km-grid,
    #km-products-wrap .km-grid,
    #km-offers-wrap .km-grid,
    #km-fast-wrap .km-grid,
    #km-grocery-wrap .km-grid,
    html.km-mobile-device .km-grid,
    html.km-mobile-device #km-products-wrap .km-grid,
    html.km-mobile-device #km-offers-wrap .km-grid,
    html.km-mobile-device #km-fast-wrap .km-grid,
    html.km-mobile-device #km-grocery-wrap .km-grid,
    html.km-mobile-compact .km-grid,
    html.km-mobile-compact #km-products-wrap .km-grid,
    html.km-mobile-compact #km-offers-wrap .km-grid,
    html.km-mobile-compact #km-fast-wrap .km-grid,
    html.km-mobile-compact #km-grocery-wrap .km-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:9px!important;
    }

    .km-image-box,
    html.km-mobile-device .km-image-box,
    html.km-mobile-compact .km-image-box{
        height:104px!important;
        min-height:104px!important;
        max-height:104px!important;
        flex-basis:104px!important;
    }
}

@media (prefers-reduced-motion:reduce){
    .km-card,
    .km-shelf-card,
    .km-image-box img,
    .km-shelf-image img,
    .km-tab,
    .km-view-btn,
    .km-add-btn,
    .km-choose-btn,
    .km-qty-btn{
        transition:none!important;
        animation:none!important;
        transform:none!important;
    }
}
