/* Ice Card Sell Gift Card 公开页 v6.1.0 */

.icecard-sellpage {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

.isp-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* ===== 左侧列表 ===== */
.isp-sidebar {
    flex: 0 0 300px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
    padding: 16px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.isp-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 12px;
}
.isp-tab {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all .15s;
}
.isp-tab-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15,23,42,.08);
}

.isp-search {
    margin-bottom: 12px;
}
.isp-search input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
}
.isp-search input:focus {
    border-color: #10b981;
}
/* v7.5.2：Sell 动作钮一键回到列表时，搜索框轻提示（不自动聚焦，避免手机弹键盘） */
.isp-search.isp-search-pulse input {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, .15);
    transition: box-shadow .2s ease, border-color .2s ease;
}

/* ===== v7.5.2：游客本机 Recent quotes 横条（私有，仅本人设备可见） ===== */
.isp-recent-quotes {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.isp-recent-quotes[hidden] { display: none; }
.isp-rq-label {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.isp-rq-list {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
}
.isp-rq-list::-webkit-scrollbar { display: none; }
.isp-rq-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 999px;
    padding: 4px 10px 4px 5px;
    cursor: pointer;
    max-width: 190px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s, border-color .12s;
}
.isp-rq-chip:hover { background: #eef6ff; border-color: #bae6fd; }
.isp-rq-logo {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.isp-rq-logo img { width: 100%; height: 100%; object-fit: contain; }
.isp-rq-logo-fallback { font-size: 11px; font-weight: 700; color: #64748b; }
.isp-rq-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-width: 0; }
.isp-rq-name {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.isp-rq-sub { font-size: 10px; color: #94a3b8; white-space: nowrap; }
.isp-rq-clear {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 2px;
    font-family: inherit;
}
.isp-rq-clear:active { color: #64748b; }

.isp-list-wrap {
    overflow-y: auto;
    flex: 1;
}

.isp-card-list,
.isp-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.isp-card-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .12s;
}
.isp-card-item:hover {
    background: #f8fafc;
}
.isp-card-item.active {
    background: #ecfdf5;
}

.isp-card-logo {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.isp-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    box-sizing: border-box;
}
.isp-card-logo-fallback {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
}

.isp-card-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.isp-card-price {
    font-size: 13px;
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
}
.isp-price-dash {
    color: #cbd5e1;
    font-weight: 400;
}

/* Recently Sold */
.isp-recent-item {
    padding: 10px;
    border-radius: 10px;
}
.isp-recent-card {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 2px;
}
.isp-recent-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}
.isp-recent-meta strong {
    color: #059669;
}
.isp-recent-meta em {
    color: #94a3b8;
    font-style: normal;
}

/* ===== 右侧 ===== */
.isp-main {
    flex: 1;
    min-width: 0;
}

.isp-back-btn {
    display: none;
    border: 0;
    background: #f1f5f9;
    color: #0f172a;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    width: 100%;
}

/* ============================================================
   v7.4.0 手机端 App 化两屏（≤921px，断点跟随 Astra 汉堡菜单）
   视图①：卡种清单占满选卡；视图②：点卡后核价器 fixed 全屏滑入
   桌面端（>921）维持左列表 + 右计算器，不受影响
   ============================================================ */

/* 桌面端：首页嵌入本组件时隐藏左侧清单，只保留居中计算器（与旧首页一致），营销区块仍在其下 */
@media (min-width: 922px) {
    body.home.icecard-has-sellpage .isp-sidebar { display: none; }
    body.home.icecard-has-sellpage .isp-main {
        flex: 1 1 auto;
        max-width: 720px;
        margin: 0 auto;
    }
}

@media (max-width: 921px) {
    /* v7.5.1：不在 html/body 上做 overflow-x:hidden——iOS WKWebView（含 iOS Edge 无痕）
       会因此让 position:fixed 页眉/Tab 在惯性滚动时被内容盖住、漂移；
       横向裁剪统一由 mobileshell.css 放到 #page 包裹层（外壳 DOM 在 #page 之外）。 */
    body.isp-main-open { overflow: hidden; }

    .icecard-sellpage {
        padding: 0;
        max-width: 100%;
    }
    .isp-layout {
        flex-direction: column;
        gap: 0;
    }

    /* ---- 视图①：选卡清单（浅灰底、整页滚动、占满首屏、点击区加大） ---- */
    .isp-sidebar {
        flex: none;
        width: 100%;
        max-height: none;
        position: static;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        padding: 12px 14px calc(20px + env(safe-area-inset-bottom, 0px));
        min-height: 100vh;
        min-height: 100dvh;
    }
    .isp-list-wrap {
        overflow: visible;
        flex: none;
    }
    .isp-card-item { padding: 14px 10px; border-radius: 12px; }
    .isp-card-logo { width: 40px; height: 40px; flex: 0 0 40px; }
    .isp-card-name { font-size: 15px; }
    .isp-card-price { font-size: 15px; }

    /* v7.5.2：Recent quotes 横条手机端加大点按区 */
    .isp-rq-chip { padding: 5px 12px 5px 6px; max-width: 210px; }
    .isp-rq-name { font-size: 13px; max-width: 130px; }
    .isp-rq-sub { font-size: 11px; }

    /* ---- 视图②：核价器默认移出屏幕右侧，点卡后滑入全屏 ---- */
    .isp-main {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100%;
        /* v7.4.1 高于悬浮页眉(z-index:99)，核价屏整屏接管、盖住页眉；仍低于 Tidio 等客服浮层 */
        z-index: 999;
        background: #fff;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .icecard-sellpage.isp-view-main .isp-main { transform: translateX(0); }

    /* 核价屏内计算器去"卡中卡"外壳，整屏白底 */
    .isp-main .icecard-calculator { max-width: 100%; }
    .isp-main .icecard-card {
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }
    .isp-main .icecard-header { border-radius: 0; }

    /* 返回条：进入核价屏后吸顶（含刘海安全区） */
    .icecard-sellpage.isp-view-main .isp-back-btn {
        display: block;
        position: sticky;
        top: 0;
        z-index: 2;
        width: 100%;
        margin: 0;
        background: #fff;
        border: 0;
        border-bottom: 1px solid #e2e8f0;
        border-radius: 0;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
        padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
        text-align: left;
        font-size: 15px;
    }

    /* v7.5.3：核价屏常驻 Contact Support 吸底（结果区出现时按钮自动隐藏） */
    .isp-main .icecard-contact-anytime {
        position: sticky;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        z-index: 2;
        margin-top: 16px;
        background: #fff;
        box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.08);
    }
}
