/* product_card.css — 产品卡（列表 / 推荐位）
   列表：短名 + 元信息；仅 Quick View（无 Get Quote） */

.product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background: #fff;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .product-card:hover,
    .product-card:focus-within {
        transform: translateY(-2px);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
    }
}

/* ── 图片区 + Quick View 浮层 ── */
.product-card__media-wrap {
    position: relative;
    flex-shrink: 0;
}

.product-card__media {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    background: #0a0a0a;
    line-height: 0;
    font-size: 0;
}

.product-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.35s ease, transform 0.45s ease;
}

.product-card__image--secondary {
    position: absolute;
    inset: 0;
    opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
    /* 仅主图做轻位移；有第二张时主图淡出，不共用 scale */
    .product-card:hover .product-card__media:not(.has-hover-image) .product-card__image,
    .product-card:focus-within .product-card__media:not(.has-hover-image) .product-card__image {
        transform: scale(1.03);
    }

    .product-card:hover .product-card__media.has-hover-image .product-card__image--primary,
    .product-card:focus-within .product-card__media.has-hover-image .product-card__image--primary {
        opacity: 0;
        transform: scale(1.02);
    }

    .product-card:hover .product-card__image--secondary,
    .product-card:focus-within .product-card__image--secondary {
        opacity: 1;
        /* 第二张：呼吸放大 + 微旋转 */
        animation: productCardHoverBreath 3.4s ease-in-out infinite;
    }
}

@keyframes productCardHoverBreath {
    0%,
    100% {
        transform: scale(1.04) rotate(0.55deg);
    }
    50% {
        transform: scale(1.09) rotate(-0.55deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-card:hover .product-card__image--secondary,
    .product-card:focus-within .product-card__image--secondary {
        animation: none;
        transform: scale(1.04);
    }
}

.product-card__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
}

.product-card__quick {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-primary, #1a1a1a);
    background: rgba(255, 255, 255, 0.96);
    border: none;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    cursor: pointer;
    white-space: nowrap;
    transform: translate(-50%, -50%) scale(0.94);
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease, background 0.2s ease;
}

.product-card__quick svg {
    flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
    .product-card:hover .product-card__quick,
    .product-card:focus-within .product-card__quick,
    .product-card__quick:focus-visible {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    .product-card__quick:hover {
        background: #fff;
    }
}

@media (hover: none), (pointer: coarse) {
    .product-card__quick {
        left: auto;
        top: 8px;
        right: 8px;
        min-height: 30px;
        min-width: 30px;
        padding: 0;
        border-radius: 50%;
        transform: none;
        opacity: 1;
        font-size: 0;
        gap: 0;
    }

    .product-card__quick svg {
        width: 15px;
        height: 15px;
    }
}

/* ── 文案区 ── */
.product-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0;
    padding: 12px 12px 10px;
}

.product-card__name {
    margin: 0;
    padding: 0;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-primary, #1a1a1a);
}

.product-card__name a {
    color: inherit;
    text-decoration: none;
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.product-card__name a:hover {
    color: var(--color-accent);
}

/* 系列 · SKU · 尺寸 · 材质（按列表语境显隐） */
.product-card__meta {
    margin: 6px 0 0;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.01em;
    color: var(--lp-text-secondary, #5f6368);
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .product-card {
        border-radius: 10px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .product-card__quick {
        display: none !important;
    }

    .product-card__media {
        aspect-ratio: 1;
    }

    .product-card__body {
        padding: 8px 10px 10px;
    }

    .product-card__name {
        font-size: 0.82rem;
        line-height: 1.3;
    }

    .product-card__meta {
        font-size: 0.68rem;
    }
}
