/* 顾客前台共用 Discover 商品卡片；页面仅决定网格或滑动布局。 */
.product-card .product-color-swatches,
.header-search-product .header-search-colors {
    translate: -4px 0;
}

.product-card.theme-product-card.product-card--image-actions {
    --product-card-action-inset: 18px;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    padding: 0;
    box-sizing: border-box;
}

/* 商品图片始终为正方形，随各页面的卡片宽度缩放。 */
.product-card.theme-product-card.product-card--image-actions {
    --product-card-info-gradient: none;
    background: transparent;
    /* 图片独立裁剪，外层不能裁掉颜色圆圈和焦点描边。 */
    border-radius: 20px !important;
    overflow: visible !important;
    border: 0;
    box-shadow: none;
}

.product-card.theme-product-card.product-card--image-actions .product-card-media-shell {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0;
    background: transparent;
    border-radius: 20px;
}

.product-card.theme-product-card.product-card--image-actions .theme-product-media {
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    background: transparent;
    aspect-ratio: auto !important;
}

.product-card.theme-product-card.product-card--image-actions .product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.product-card.theme-product-card.product-card--image-actions .product-card-body {
    min-height: 0;
    flex: 0 0 auto;
    padding: 8px 0 4px;
    color: #111;
    background: transparent;
}

.product-card.theme-product-card.product-card--image-actions .product-title-link {
    color: #111;
    font-size: 1rem;
    height: 2.7em;
    min-height: 2.7em;
    max-height: 2.7em;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.product-card.theme-product-card.product-card--image-actions .price {
    color: #111;
    font-size: 0.95rem;
}

.product-card.theme-product-card.product-card--image-actions .sale-price {
    color: #111;
}

.product-card.theme-product-card .original-price,
.header-search-product .header-search-price__original {
    color: #71717a;
    text-decoration: line-through;
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-view {
    position: absolute;
    width: 35px;
    height: 35px;
    top: var(--product-card-action-inset);
    right: var(--product-card-action-inset);
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(-100% - var(--product-card-action-inset)));
    background: #fff linear-gradient(#111, #111) left center / 0% 100% no-repeat;
    background-origin: border-box;
    border: 1px solid rgba(18, 24, 32, 0.2);
    box-shadow: 0 4px 12px rgba(18, 24, 32, 0.2);
    box-sizing: border-box;
    overflow: hidden;
    isolation: isolate;
    transition: opacity 180ms ease, transform 180ms ease, color 0.4s ease, border-color 0.4s ease,
        background-size 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-view:not(:disabled):is(:hover, :focus-visible) {
    color: #fff;
    border-color: #111;
    background-size: 100% 100%;
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-add {
    position: absolute;
    z-index: 5;
    left: var(--product-card-action-inset);
    right: var(--product-card-action-inset);
    bottom: var(--product-card-action-inset);
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.product-card.theme-product-card.product-card--image-actions .product-card-media-shell:hover .product-card-quick-add,
.product-card.theme-product-card.product-card--image-actions .product-card-quick-add:has(.is-loading),
.product-card.theme-product-card.product-card--image-actions .product-card-quick-add:has(:focus-visible) {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-add button {
    display: flex;
    width: 100%;
    height: 41px;
    padding: 0 9px 0 20px;
    justify-content: space-between;
    background: #fff linear-gradient(#111, #111) left center / 0% 100% no-repeat;
    background-origin: border-box;
    color: #111;
    border: 1px solid rgba(18, 24, 32, 0.2);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(18, 24, 32, 0.2);
    box-sizing: border-box;
}

.product-card.theme-product-card.product-card--image-actions .product-card-add-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    font-size: 13px;
    font-weight: 700;
}

.product-card.theme-product-card.product-card--image-actions .product-card-add-icon {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    overflow: visible;
    clip: auto;
    color: #fff;
    background: #000;
    border-radius: 50%;
}

.product-card.theme-product-card.product-card--image-actions .product-card-add-icon .icon-sm {
    width: 14px;
    height: 14px;
}

@media (hover: none) {
    .product-card.theme-product-card.product-card--image-actions .product-card-quick-add {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-card.theme-product-card.product-card--image-actions .product-card-quick-add {
        transition: none;
    }
}

.product-card.theme-product-card.product-card--image-actions .product-card-options-row {
    min-height: 0;
    margin-top: 4px;
    margin-bottom: 0;
}

.product-card.theme-product-card.product-card--image-actions .product-color-swatches {
    padding: 2px 6px;
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-add button {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: color 0.4s ease, border-color 0.4s ease,
        background-size 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-add button:not(:disabled):is(:hover, :focus-visible) {
    color: #fff;
    border-color: #111;
    background-size: 100% 100%;
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-add button:not(:disabled):is(:hover, :focus-visible) .product-card-add-icon {
    color: #111;
    background: #fff;
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-add button.is-loading {
    opacity: 1;
    color: #fff;
    background: #111;
    cursor: progress;
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-add button.is-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.2);
    animation: product-card-add-progress 1.2s ease-in-out infinite;
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-add button.is-loading .product-card-add-icon {
    color: #fff;
    background: transparent;
    border: 2px solid currentColor;
    border-top-color: transparent;
    box-sizing: border-box;
    animation: product-quick-view-spin 720ms linear infinite;
}

.product-card.theme-product-card.product-card--image-actions .product-card-quick-add button.is-loading .icon {
    visibility: hidden;
}

@keyframes product-card-add-progress {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .product-card.theme-product-card.product-card--image-actions .product-card-quick-view,
    .product-card.theme-product-card.product-card--image-actions .product-card-quick-add button {
        transition: none;
    }

    .product-card.theme-product-card.product-card--image-actions .product-card-quick-add button.is-loading::before {
        animation: none;
    }

    .product-card.theme-product-card.product-card--image-actions .product-card-quick-add button.is-loading .product-card-add-icon {
        animation-duration: 1.5s;
    }
}

.product-card.theme-product-card.product-card--image-actions .product-title-link:hover { color: #111; }
.product-card.theme-product-card.product-card--image-actions .product-price-stack { margin-top: 5px; }
.product-card.theme-product-card.product-card--image-actions .product-card-body { display: flex; flex-direction: column; }
.product-card.theme-product-card.product-card--image-actions .product-card-body h3 { width: 100%; min-width: 0; font-size: 1rem; }
.product-card.theme-product-card.product-card--image-actions .product-card-media-shell { flex: 0 0 auto; }
.product-card.theme-product-card.product-card--image-actions .theme-product-media { position: absolute; inset: 0; }
.product-card.theme-product-card.product-card--image-actions .product-color-swatches { gap: 8px; flex-wrap: wrap; }
.product-card.theme-product-card.product-card--image-actions .sku-color-swatch { width: 22px; height: 22px; }
.product-card.theme-product-card.product-card--image-actions .product-img { transform: none !important; }

@media (max-width: 640px) {
    .product-card.theme-product-card.product-card--image-actions .product-card-quick-add { left: 8px; right: 8px; bottom: 8px; }
    .product-card.theme-product-card.product-card--image-actions .product-card-quick-add button { padding: 0 8px 0 12px; }
    .product-card.theme-product-card.product-card--image-actions .product-card-add-label { font-size: 12px; }
    .product-card.theme-product-card.product-card--image-actions .product-card-quick-view { top: 8px; right: 8px; }
}

.product-card.theme-product-card.product-card--image-actions:hover .product-card-quick-view,
.product-card.theme-product-card.product-card--image-actions:has(:focus-visible) .product-card-quick-view {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}
.product-card.theme-product-card.product-card--image-actions .product-card-quick-view .icon-sm { width: 18px; height: 18px; }
.product-card.theme-product-card.product-card--image-actions .product-card-quick-add button:disabled:not(.is-loading) { opacity: 0.42; cursor: not-allowed; }
.product-card.theme-product-card.product-card--image-actions .product-card-add-label { min-width: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
@media (hover: none) {
    .product-card.theme-product-card.product-card--image-actions .product-card-quick-view { opacity: 1; pointer-events: auto; transform: none; }
}

.product-card.theme-product-card.product-card--image-actions:is(:hover, :focus-within) {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.product-card-add-cart { display: none; }

@media (max-width: 1100px) {
    .product-card .product-card-quick-view { display: none; }

    .product-card.theme-product-card.product-card--image-actions .product-title-link,
    .product-card.theme-product-card.product-card--image-actions .product-card-body h3 { font-size: calc(1rem - 1px); }
    .product-card.theme-product-card.product-card--image-actions .price { font-size: calc(0.95rem - 1px); }
    .product-card.theme-product-card.product-card--image-actions .original-price { font-size: calc(0.78rem - 1px); }
    .product-card.theme-product-card.product-card--image-actions .sku-color-swatch { width: 21px; height: 21px; }

    .product-card.theme-product-card.product-card--image-actions .product-card-quick-add {
        left: auto;
        right: 10px;
        bottom: 10px;
        width: 32px;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .product-card.theme-product-card.product-card--image-actions .product-card-quick-add button {
        width: 32px;
        height: 32px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .product-card.theme-product-card.product-card--image-actions .product-card-add-label,
    .product-card.theme-product-card.product-card--image-actions .product-card-add-plus { display: none; }

    .product-card.theme-product-card.product-card--image-actions .product-card-add-cart { display: block; }

    .product-card.theme-product-card.product-card--image-actions .product-card-add-icon {
        flex: 0 0 20px;
        width: 20px;
        height: 20px;
        color: inherit;
        background: transparent;
    }

    .product-card.theme-product-card.product-card--image-actions .product-card-add-icon .icon-sm {
        width: 16px;
        height: 16px;
    }
}
