:root{
    --ap-primary:var(--mc-primary,#0d6efd);
    --ap-secondary:var(--mc-secondary,#06b6d4);
    --ap-ink:#0f172a;
    --ap-muted:#64748b;
    --ap-border:#e6ebf2;
}

.all-products-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
}

.all-product-card{
    position:relative;
    min-width:0;
    overflow:hidden;
    border:1px solid var(--ap-border);
    border-radius:15px;
    background:#fff;
    box-shadow:0 7px 20px rgba(15,23,42,.07);
    cursor:pointer;
    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.all-product-card:hover{
    transform:translateY(-6px);
    border-color:color-mix(in srgb,var(--ap-primary) 25%,var(--ap-border));
    box-shadow:0 18px 38px rgba(15,23,42,.14);
}

.all-product-card:focus-visible{
    outline:3px solid color-mix(in srgb,var(--ap-primary) 22%,transparent);
    outline-offset:3px;
}

.all-product-media{
    position:relative;
    aspect-ratio:1/1;
    overflow:hidden;
    background:linear-gradient(180deg,#f8fafc,#fff);
}

.all-product-image-link{
    display:block;
    width:100%;
    height:100%;
}

.all-product-media img{
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
    padding:10px;
    transition:transform .42s ease;
}

.all-product-card:hover .all-product-media img{
    transform:scale(1.06);
}

.all-product-discount,
.all-product-tag{
    position:absolute;
    top:10px;
    left:10px;
    z-index:3;
    display:inline-flex;
    align-items:center;
    gap:4px;
    max-width:calc(100% - 60px);
    padding:6px 9px;
    border-radius:8px;
    color:#fff;
    background:#f43f5e;
    box-shadow:0 7px 16px rgba(244,63,94,.24);
    font-size:9px;
    font-weight:900;
    line-height:1;
}

.all-product-tag{
    background:linear-gradient(135deg,var(--ap-primary),var(--ap-secondary));
}

.all-product-wishlist{
    position:absolute;
    top:9px;
    right:9px;
    z-index:4;
    width:36px;
    height:36px;
    display:grid;
    place-items:center;
    border:1px solid rgba(226,232,240,.95);
    border-radius:50%;
    color:#475569;
    background:rgba(255,255,255,.96);
    box-shadow:0 6px 16px rgba(15,23,42,.14);
    transition:.2s;
}

.all-product-wishlist:hover{
    color:#ef4444;
    transform:scale(1.08);
}

.all-product-stock{
    position:absolute;
    left:10px;
    bottom:10px;
    z-index:3;
    display:inline-flex;
    align-items:center;
    gap:4px;
    padding:5px 8px;
    border-radius:999px;
    color:#fff;
    font-size:8px;
    font-weight:900;
}

.all-product-stock.in-stock{
    background:#22c55e;
}

.all-product-stock.limited-stock{
    background:#ef4444;
}

.all-product-body{
    display:flex;
    flex-direction:column;
    min-height:220px;
    padding:12px;
}

.all-product-title{
    display:-webkit-box;
    min-height:42px;
    overflow:hidden;
    color:var(--ap-ink);
    text-decoration:none;
    font-size:13px;
    font-weight:900;
    line-height:1.45;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
}

.all-product-title:hover{
    color:var(--ap-primary);
}

.all-product-sku{
    margin-top:4px;
    color:#94a3b8;
    font-size:9px;
}

.all-product-rating{
    display:flex;
    align-items:center;
    gap:6px;
    margin-top:8px;
    color:#94a3b8;
    font-size:10px;
}

.all-product-rating .stars{
    display:flex;
    gap:1px;
    color:#f59e0b;
}

.all-product-price{
    display:flex;
    flex-wrap:wrap;
    align-items:baseline;
    gap:6px;
    min-height:47px;
    margin-top:9px;
}

.all-product-price strong{
    color:var(--ap-primary);
    font-size:17px;
    font-weight:900;
}

.all-product-price del{
    color:#94a3b8;
    font-size:10px;
}

.all-product-price small{
    width:100%;
    color:#16a34a;
    font-size:9px;
    font-weight:800;
}

.all-product-actions{
    display:grid;
    grid-template-columns:.8fr 1.2fr;
    gap:8px;
    margin-top:auto;
    padding-top:10px;
}

.all-product-buy,
.all-product-cart{
    min-height:39px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    border-radius:9px;
    font-size:10px;
    font-weight:900;
    text-decoration:none;
    transition:.2s;
}

.all-product-buy{
    border:1px solid color-mix(in srgb,var(--ap-primary) 35%,#dbe2ea);
    color:var(--ap-primary);
    background:#fff;
}

.all-product-buy:hover{
    color:#fff;
    background:var(--ap-primary);
}

.all-product-cart{
    border:0;
    color:#fff;
    background:linear-gradient(
        135deg,
        var(--ap-primary),
        color-mix(in srgb,var(--ap-primary) 76%,var(--ap-secondary))
    );
    box-shadow:0 7px 16px color-mix(in srgb,var(--ap-primary) 23%,transparent);
}

.all-product-cart:hover{
    filter:brightness(.95);
    transform:translateY(-1px);
}

.all-product-cart:disabled{
    opacity:.72;
    cursor:not-allowed;
}

.js-reveal-card{
    opacity:0;
    transform:translateY(35px) scale(.985);
}

.js-reveal-card.is-visible{
    opacity:1;
    transform:none;
    transition:
        opacity .58s ease var(--reveal-delay,0ms),
        transform .58s cubic-bezier(.2,.75,.2,1) var(--reveal-delay,0ms),
        box-shadow .25s ease,
        border-color .25s ease;
}

.pagination-wrap{
    margin-top:28px;
}

@media(max-width:1399.98px){
    .all-products-grid{
        grid-template-columns:repeat(4,minmax(0,1fr));
    }
}

@media(max-width:1199.98px){
    .all-products-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
}

@media(max-width:767.98px){
    .all-products-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:10px;
    }

    .all-product-body{
        min-height:205px;
        padding:9px;
    }

    .all-product-title{
        min-height:39px;
        font-size:12px;
    }

    .all-product-actions{
        grid-template-columns:1fr;
        gap:7px;
    }

    .all-product-buy,
    .all-product-cart{
        min-height:37px;
    }
}

@media(max-width:374.98px){
    .all-products-grid{
        gap:8px;
    }

    .all-product-media img{
        padding:6px;
    }

    .all-product-discount,
    .all-product-tag{
        padding:5px 6px;
        font-size:8px;
    }
}

@media(prefers-reduced-motion:reduce){
    .js-reveal-card{
        opacity:1!important;
        transform:none!important;
    }

    .js-reveal-card.is-visible{
        transition:none!important;
    }
}
