
.section__products--item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    box-shadow: 0px 1px 2px 0px #0000000D;
    border-radius: 16px;
    /* min-width: 165px; */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.section__products--item:hover{
    transform: translateY(-4px);
    box-shadow:0 8px 24px rgba(0, 0, 0, 0.08),0 2px 6px rgba(0, 0, 0, 0.03);
    border-color: rgba(52, 68, 110, 0.12);
}

.products__item--detail .title {
    color: var(--color-primary-2);
    font-size: 12px;
    font-weight: 700;
    width: 100%;
    text-wrap: nowrap;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.products__item--detail .text {
    color: var(--color-primary-3);
    font-size: 12px;
}

.products__item--price {
    color: #BA1A1A;
    font-size: 11px;
    text-decoration: line-through;
}

.products__item--discount .price {
    color: var(--color-primary-2);
    font-size: 12px;
    font-weight: 700;
}

.products__item--discount .price-text {
    color: var(--color-primary-2);
    font-size: 10px;
}

.products__item--cart {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.products__cart--add {
    width: 32px;
    height: 32px;
    background-color: #1D2D56;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.products__item--header {
    position: relative;
}
.products__item--header img{
    margin: auto;
    object-fit: cover;
}

.products__item--category {
    position: absolute;
    top: 8px;
    font-size: 11px;
    background: #1D2D56;
    color: var(--color-white);
    padding: 2px 8px;
    border-radius: 100px;
    right: 6px;
}


/* ========================================
   PRODUCT SKELETON LOADING
======================================== */

body.loading .section__products--item {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

/* Hide original content */
body.loading .products__item--header img,
body.loading .products__item--category,
body.loading .products__item--detail h3,
body.loading .products__item--detail span,
body.loading .products__cart--price span,
body.loading .products__cart--add svg {
    visibility: hidden;
}

/* Shared skeleton placeholders */
body.loading .products__item--header::before,
body.loading .products__item--detail::before,
body.loading .products__item--detail::after,
body.loading .products__cart--price::before,
body.loading .products__cart--price::after {
    content: "";
    position: absolute;
    display: block;
    right: 0;
    background: #F0EFF8;
    border-radius: 6px;
}

/* Image skeleton */
body.loading .products__item--header {
    min-height: 144px;
}

body.loading .products__item--header::before {
    inset: 0;
    border-radius: 12px;
}

/* Detail and price layout */
body.loading .products__item--detail,
body.loading .products__cart--price {
    position: relative;
}

body.loading .products__item--detail {
    min-height: 36px;
}

body.loading .products__cart--price {
    min-height: 34px;
}

/* Title */
body.loading .products__item--detail::before {
    top: 2px;
    width: 85%;
    height: 12px;
}

/* Description */
body.loading .products__item--detail::after {
    bottom: 2px;
    width: 60%;
    height: 9px;
}

/* Old price */
body.loading .products__cart--price::before {
    top: 2px;
    width: 65px;
    max-width: 100%;
    height: 9px;
}

/* Final price */
body.loading .products__cart--price::after {
    bottom: 2px;
    width: 85px;
    max-width: 100%;
    height: 12px;
}

/* Cart button */
body.loading .products__cart--add {
    background: #F0EFF8;
}

/* ========================================
   SINGLE SHIMMER PER CARD
======================================== */

body.loading .section__products--item::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 45%;
    z-index: 5;
    pointer-events: none;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.55),
        transparent
    );

    transform: translate3d(-230%, 0, 0);
}

/* Animate only visible cards */
body.loading .section__products--item::after {
    animation: productShimmer 1.8s ease-in-out infinite;
}

@keyframes productShimmer {
    to {
        transform: translate3d(350%, 0, 0);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    body.loading .section__products--item::after {
        animation: none;
    }
}



/* ==========================================
   EMPTY PRODUCTS VISIBILITY
========================================== */

.products__empty[hidden] {
    display: none !important;
}

/* ==========================================
   TEMPORARY SKELETON CARDS
========================================== */

body.loading .products__skeleton--temporary {
    pointer-events: none;
    user-select: none;
}

.products__skeleton--temporary {
    min-width: 0;
}

/* ==========================================
   PRODUCTS REQUEST STATE
========================================== */

.products[aria-busy="true"] {
    min-height: 0;
}

.products-scroll-sentinel {
    height: 1px;
    pointer-events: none;
}

.products__load-more[hidden] {
    display: none !important;
}


/* Homepage Swiper cards: animate an inner surface, never the Swiper slide transform. */
.first__products .parent__products--swiper,
.second__products .parent__products--swiper {
    overflow: hidden;
    padding-block: 12px;
}

.first__products .products__swiper,
.second__products .products__swiper {
    overflow: visible;
}

.home-product-card {
    display: block;
    padding: 0;
    gap: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.home-product-card > .products__item--surface {
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
    background: transparent;
    box-shadow: 0 1px 2px 0 #0000000D;
    transition: transform .3s ease, box-shadow .3s ease;
}

.home-product-card:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
    .home-product-card:hover { z-index: 4; }
    .home-product-card:hover > .products__item--surface {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-product-card > .products__item--surface { transition: none; }
    .home-product-card:hover > .products__item--surface { transform: none; }
}
