/* ============================================================
   audience-shopping.css · 观众端直播购物商品抽屉
   ============================================================ */

/* 直播间信息下方的领取券入口：金黄票面、深金副券、虚线撕口与上下缺口。 */
.audience-coupon {
    position: absolute;
    z-index: 4;
    top: 98px;
    left: 12px;
    width: 210px;
    height: 86px;
    padding: 0;
    display: flex;
    overflow: visible;
    border: 0;
    border-radius: 15px;
    color: #573600;
    background: transparent;
    filter: drop-shadow(0 4px 11px rgba(83, 48, 0, 0.26));
    font: inherit;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-140px) scale(0.56);
    transform-origin: 0 0;
    transition: opacity 180ms ease, visibility 0s linear 220ms;
}

html[data-live-mode="shopping"] .audience-viewer[data-stage="living"] .audience-coupon {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* 进入购物直播时，从观众屏幕左侧弹入并带一点回弹。 */
    transform: translateX(0) scale(0.58);
    animation: audienceCouponSlideIn 520ms cubic-bezier(0.2, 0.82, 0.24, 1.08) both;
    transition: opacity 180ms ease, visibility 0s linear 0s;
}

html[data-live-mode="shopping"] .audience-viewer[data-stage="living"] .audience-coupon:active {
    transform: translateY(1px) scale(0.56);
}

html[data-live-mode="shopping"] .audience-viewer[data-stage="living"] .audience-coupon.is-claimed {
    pointer-events: none;
    animation: audienceCouponClaimOut 360ms cubic-bezier(0.4, 0, 0.8, 0.2) forwards;
}

@keyframes audienceCouponSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-140px) scale(0.52);
    }

    72% {
        opacity: 1;
        transform: translateX(7px) scale(0.6);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(0.58);
    }
}

@keyframes audienceCouponClaimOut {
    0% {
        opacity: 1;
        transform: translateX(0) scale(0.58);
    }

    38% {
        opacity: 1;
        transform: translateX(5px) scale(0.61);
    }

    100% {
        opacity: 0;
        visibility: hidden;
        transform: translateX(-132px) scale(0.48) rotate(-3deg);
    }
}

.audience-coupon-side {
    width: 68px;
    flex: 0 0 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #ffe88d;
    border-radius: 15px 7px 7px 15px;
    background: #ca8700;
}

.audience-coupon-side strong {
    width: 50px;
    font-size: 12px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

.audience-coupon-side > span {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 2px 1px rgba(85, 49, 0, 0.34));
}

.audience-coupon-cutline {
    position: absolute;
    z-index: 2;
    top: 8px;
    bottom: 8px;
    left: 68px;
    border-left: 2px dashed rgba(255, 255, 255, 0.88);
}

.audience-coupon-cutline::before,
.audience-coupon-cutline::after {
    display: none;
}

.audience-coupon-main {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 17px 30px 16px;
    align-content: center;
    column-gap: 5px;
    padding: 7px 10px 7px 13px;
    border-radius: 7px 15px 15px 7px;
    background: linear-gradient(112deg, #ffc80d 0%, #ffc20e 50%, #ffad22 100%);
}

.audience-coupon-main strong {
    grid-column: 1 / -1;
    overflow: hidden;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audience-coupon-main b {
    grid-column: 1 / -1;
    font-size: 25px;
    font-weight: 800;
    line-height: 29px;
    letter-spacing: -0.8px;
}

.audience-coupon-main > span,
.audience-coupon-main small {
    overflow: hidden;
    color: rgba(87, 54, 0, 0.76);
    font-size: 9px;
    line-height: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audience-coupon-main small {
    text-align: right;
}

.audience-video-stage.audience-paused .audience-coupon {
    z-index: 21;
}

/* 右下角主播讲解商品：复用参考图的白色商品卡层级，并压缩成适合演示手机的尺寸。 */
.audience-shopping-teaser {
    position: absolute;
    z-index: 7;
    right: 12px;
    bottom: 86px;
    width: 106px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.94);
    border-radius: 14px;
    background: #fff;
    box-shadow:
        0 12px 30px rgba(19, 13, 10, 0.34),
        0 2px 7px rgba(19, 13, 10, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 220ms ease,
        visibility 0s linear 220ms;
}

html[data-live-mode="shopping"] .audience-viewer[data-stage="living"] .audience-shopping-teaser.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* 页面打开时直接呈现，不播放弹入或淡入过程。 */
    transition: none;
}

.audience-shopping-teaser-main {
    width: 100%;
    padding: 0;
    display: block;
    border: 0;
    color: #17151a;
    background: #fff;
    font: inherit;
    text-align: left;
}

.audience-shopping-teaser-main:active {
    background: #fff7f3;
}

.audience-shopping-teaser-media {
    position: relative;
    height: 96px;
    display: block;
    overflow: hidden;
    background: #f1ece8;
}

.audience-shopping-teaser-media > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.audience-shopping-teaser-status {
    position: absolute;
    top: 6px;
    left: 6px;
    height: 20px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 35px);
    border-radius: 10px;
    color: #fff;
    background: rgba(24, 23, 30, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    font-size: 9px;
    font-weight: 600;
    line-height: 20px;
    backdrop-filter: blur(9px);
}

.audience-shopping-teaser-status > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audience-shopping-teaser-status > span:first-child {
    width: 5px;
    height: 5px;
    flex: 0 0 5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.audience-shopping-teaser-index {
    position: absolute;
    left: 6px;
    bottom: 6px;
    min-width: 19px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    color: #fff;
    background: rgba(17, 16, 22, 0.7);
    font-size: 9px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.audience-shopping-teaser-copy {
    min-width: 0;
    padding: 5px 6px 4px;
    display: block;
}

.audience-shopping-teaser-copy strong,
.audience-shopping-teaser-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audience-shopping-teaser-copy strong {
    font-size: 11px;
    font-weight: 700;
    line-height: 15px;
}

.audience-shopping-teaser-copy small {
    color: #716a70;
    font-size: 8px;
    line-height: 12px;
}

.audience-shopping-teaser-footer {
    height: 32px;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(104deg, #ff6b2b 0%, #ff315f 54%, #f20b5d 100%);
}

.audience-shopping-teaser-price {
    min-width: 0;
    flex: 1 1 auto;
    padding-left: 6px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.7px;
}

.audience-shopping-teaser-price small {
    font-size: 9px;
    font-weight: 700;
}

.audience-shopping-teaser-cta {
    width: 34px;
    height: 32px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 14px 0 0 0;
    background: rgba(255, 255, 255, 0.16);
    font-size: 14px;
    font-weight: 800;
}

.audience-video-stage.audience-paused .audience-shopping-teaser {
    z-index: 21;
}

@media (prefers-reduced-motion: reduce) {
    .audience-shopping-teaser {
        transition-duration: 0.01ms;
    }
}

.audience-shopping-sheet {
    height: 568px;
    padding: 10px 12px 20px;
    display: flex;
    flex-direction: column;
    user-select: none;
}

.audience-shopping-sr-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.audience-shopping-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.audience-shopping-host-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 50%;
    background: #ff6f4b var(--anchor-avatar) center / cover no-repeat;
    box-shadow: 0 0 18px rgba(255, 108, 73, 0.34);
}

.audience-shopping-search {
    min-width: 0;
    height: 40px;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.audience-shopping-search:focus-within {
    border-color: color-mix(in srgb, var(--brand-3) 56%, rgba(255, 255, 255, 0.12));
    background: rgba(255, 255, 255, 0.1);
}

.audience-shopping-search svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    fill: none;
    stroke: rgba(255, 255, 255, 0.48);
    stroke-width: 1.8;
    stroke-linecap: round;
}

.audience-shopping-search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
    font: inherit;
    font-size: 13px;
}

.audience-shopping-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.audience-shopping-summary {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 2px 9px;
}

.audience-shopping-summary strong {
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-weight: 600;
}

.audience-shopping-summary span {
    color: rgba(255, 255, 255, 0.42);
    font-size: 11px;
}

.audience-shopping-product-list {
    position: relative;
    z-index: 1;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    touch-action: pan-y;
}

.audience-shopping-product-list::-webkit-scrollbar {
    display: none;
}

.audience-shopping-product {
    flex: 0 0 auto;
    min-height: 126px;
    display: flex;
    gap: 10px;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.055);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.audience-shopping-product[hidden] {
    display: none;
}

.audience-shopping-product-media {
    position: relative;
    width: 108px;
    height: 108px;
    flex: 0 0 108px;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.audience-shopping-product-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.audience-shopping-product-media span {
    position: absolute;
    top: 6px;
    left: 6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    color: #fff;
    background: rgba(10, 9, 14, 0.7);
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.audience-shopping-product-body {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.audience-shopping-product-body h3 {
    display: -webkit-box;
    margin: 1px 0 4px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.94);
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.audience-shopping-product-body p {
    margin: 0 0 5px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.46);
    font-size: 10px;
    line-height: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audience-shopping-tags {
    display: flex;
    gap: 4px;
    overflow: hidden;
}

.audience-shopping-tags span {
    height: 18px;
    padding: 0 5px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 125, 72, 0.35);
    border-radius: 5px;
    color: #ff9a72;
    font-size: 9px;
    line-height: 16px;
}

.audience-shopping-product-footer {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
}

.audience-shopping-price {
    color: #ff4f7d;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.6px;
}

.audience-shopping-price small {
    font-size: 11px;
    font-weight: 600;
}

.audience-shopping-product-footer button {
    height: 30px;
    padding: 0 13px;
    border: 0;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(110deg, #ff7a2f, #ff246f 56%, #ed126c);
    box-shadow: 0 5px 14px rgba(255, 37, 105, 0.22);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
}

.audience-shopping-empty {
    padding: 70px 0;
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    text-align: center;
}
