/* 收藏项样式修复 - 确保正确显示 */

/* 收藏项容器 */
.rank_item-collect,
.rank_item_homecollections,
.rank_item-collect.rank_item_homecollections {
    width: var(--card-width) !important;
    flex-shrink: 0 !important;
    position: relative;
    display: block;
    min-width: 0;
}

/* 收藏项产品链接 */
.rank_item-collect .product,
.rank_item_homecollections .product,
.rank_item-collect.rank_item_homecollections .product {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    padding-bottom: calc(100% / var(--aspect-ratio, 16 / 9)) !important;
    overflow: hidden !important;
    border-radius: var(--sl-border-radius-large, 8px) !important;
    text-decoration: none !important;
    color: inherit !important;
    background-color: transparent !important;
}

/* 背景图片 */
.rank_item-collect .module-bg,
.rank_item_homecollections .module-bg,
.rank_item-collect.rank_item_homecollections .module-bg {
    position: absolute !important;
    inset: -5px !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border-radius: var(--sl-border-radius-large, 8px) !important;
    z-index: 0 !important;
}

/* 模糊遮罩 */
.rank_item-collect .blur,
.rank_item_homecollections .blur,
.rank_item-collect.rank_item_homecollections .blur {
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        transparent 100%
    ) !important;
    border-radius: var(--sl-border-radius-large, 8px) !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* 内容容器 */
.rank_item-collect .contain,
.rank_item_homecollections .contain,
.rank_item-collect.rank_item_homecollections .contain {
    position: absolute !important;
    left: var(--sl-spacing-medium, 1rem) !important;
    right: var(--sl-spacing-medium, 1rem) !important;
    bottom: var(--sl-spacing-medium, 1rem) !important;
    z-index: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: var(--sl-spacing-2x-small, 0.25rem) !important;
    pointer-events: none !important;
}

/* 标题样式 */
.rank_item-collect .title,
.rank_item_homecollections .title,
.rank_item-collect.rank_item_homecollections .title {
    font-size: var(--sl-font-size-x-large, 1.5rem) !important;
    font-family: var(--header-font, sans-serif) !important;
    color: var(--sl-default-white, #fff) !important;
    transition: all var(--sl-transition-fast, 0.15s) ease !important;
    transform: translateY(30px) !important;
    margin: 0 !important;
    font-weight: var(--sl-font-weight-semibold, 600) !important;
    line-height: 1.4 !important;
}

/* 描述样式 */
.rank_item-collect .desc,
.rank_item_homecollections .desc,
.rank_item-collect.rank_item_homecollections .desc {
    font-size: 14px !important;
    color: var(--sl-default-white, #fff) !important;
    transition: all var(--sl-transition-fast, 0.15s) ease-out !important;
    opacity: 0 !important;
    transform: scaleY(0) !important;
    transform-origin: center bottom !important;
    margin-top: var(--sl-spacing-small, 0.75rem) !important;
    height: 36px !important;
    line-height: 18px !important;
}

/* Hover 效果 */
.rank_item-collect .product:hover .title,
.rank_item-collect .product:focus .title,
.rank_item_homecollections .product:hover .title,
.rank_item_homecollections .product:focus .title,
.rank_item-collect.rank_item_homecollections .product:hover .title,
.rank_item-collect.rank_item_homecollections .product:focus .title {
    transform: translateY(0px) !important;
}

.rank_item-collect .product:hover .desc,
.rank_item-collect .product:focus .desc,
.rank_item_homecollections .product:hover .desc,
.rank_item_homecollections .product:focus .desc,
.rank_item-collect.rank_item_homecollections .product:hover .desc,
.rank_item-collect.rank_item_homecollections .product:focus .desc {
    opacity: 1 !important;
    transform: scaleY(1) !important;
}

/* 确保收藏项在容器中正确显示 */
.products-container.direction-row .rank_item-collect,
.products-container.direction-row .rank_item_homecollections,
.products-and-scroll-container.collection-group .rank_item-collect,
.products-and-scroll-container.collection-group .rank_item_homecollections {
    width: var(--card-width) !important;
    min-width: var(--card-width) !important;
    flex-shrink: 0 !important;
}

/* 修复 aspect-ratio 兼容性 */
@supports not (aspect-ratio: 16 / 9) {
    .rank_item-collect .product {
        height: calc(var(--card-width, 100%) * 9 / 16) !important;
        padding-bottom: 0 !important;
    }
}

