/* ============================================================
   注入到静态页的小组件样式（头部图标 / 浮标 / 加购按钮 / 提示条）
   所有选择器都带 .shop- 前缀，不会影响主题原有样式
   ============================================================ */

/* ---------- 右侧购物车抽屉（尺寸/配色对齐 903 实测） ---------- */

.shop-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 9998;
}

.shop-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.shop-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 92vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    padding: 20px 10px 20px 30px;
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, .08);
    overflow: hidden;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #666;
}

.shop-drawer.is-open { transform: translateX(0); }

.shop-drawer-in {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-right: 20px;
    min-height: 0;
}

.shop-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 67px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    flex: none;
}

.shop-drawer-title {
    font-size: 16px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.shop-drawer-close {
    background: none;
    border: 0;
    padding: 0 15px;
    font-size: 30px;
    line-height: 1;
    color: #000;
    cursor: pointer;
    font-family: inherit;
}

.shop-drawer-close:hover { color: #d6163e; }

.shop-drawer-list {
    /* 903 的清单不占满剩余高度：商品少时页脚紧跟其后，多时可滚动 */
    flex: 0 1 auto;
    overflow-y: auto;
    min-height: 0;
    padding: 25px 10px 0;
    margin: 0 -10px;
}

.shop-drawer-item {
    display: flex;
    gap: 15px;
    padding: 20px 0 18px 10px;
    border-bottom: 1px solid #f5f5f5;
}

.shop-drawer-img {
    position: relative;
    width: 80px;
    height: 80px;
    flex: none;
    background: #f9f9f9;
}

.shop-drawer-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shop-drawer-del {
    position: absolute;
    left: -8px;
    top: -8px;
    width: 30px;
    height: 30px;
    border-radius: 100%;
    background: #fff;
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    cursor: pointer;
    padding: 0;
}

.shop-drawer-del svg { width: 14px; height: 14px; }
.shop-drawer-del:hover { color: #d6163e; border-color: #f3d0d8; }

.shop-drawer-info { flex: 1; min-width: 0; }

.shop-drawer-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    line-height: 1.45;
    text-decoration: none;
}

.shop-drawer-name:hover { color: #d6163e; }

.shop-drawer-sku {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
    margin-top: 3px;
    word-break: break-word;
}

.shop-drawer-qty {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

/* 空购物车（尺寸/字重/间距均按 903 实测） */
.shop-drawer-empty {
    padding: 65px 0 0;
    text-align: center;
}

.shop-drawer-empty svg {
    width: 50px;
    height: 50px;
    display: block;
    margin: 0 auto;
    fill: #666;
}

.shop-drawer-empty p {
    font-size: 16px;
    font-weight: 300;
    color: #000;
    line-height: 1.7;
    margin: 15px 0 104px;
    padding: 0 6px;
}

.shop-drawer-walk {
    display: block;
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    color: #000 !important;
    text-transform: uppercase;
    text-decoration: none !important;
    background: #eef0f1;
    border: 1px solid #ededed;
    border-radius: 3px;
    padding: 13px 0 11px;
    text-align: center;
    letter-spacing: .4px;
}

.shop-drawer-walk:hover {
    background: #e5e8ea;
    color: #000 !important;
}

.shop-drawer-foot {
    flex: none;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.shop-drawer-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    color: #010101;
}

.shop-drawer-total b {
    color: #e55472;
    font-weight: 500;
}

.shop-drawer-btns {
    display: flex;
    justify-content: space-between;
    padding: 25px 5px 15px;
}

.shop-drawer-btn {
    display: inline-block;
    font-size: 13px;
    color: #fff !important;
    text-transform: uppercase;
    text-decoration: none !important;
    padding: 10px 20px;
    border-radius: 4px;
    border: 1px solid #ccc;
    line-height: 1.35;
    letter-spacing: .3px;
}

.shop-drawer-btn.is-cart { background: #e55472; }
.shop-drawer-btn.is-checkout { background: #d6163e; }
.shop-drawer-btn:hover { opacity: .9; }

/* 与 903 一致：打开抽屉时不动 body 的 overflow，
   这样浏览器原生滚动条一直存在，抽屉从滚动条内侧（底部）滑出，而不是盖住滚动条 */
body.shop-drawer-open { overflow: visible; }

@media (max-width: 720px) {
    .shop-drawer { padding: 16px 6px 16px 18px; }
    .shop-drawer-in { padding-right: 12px; }
    .shop-drawer-btns { padding: 20px 0 12px; gap: 10px; }
    .shop-drawer-btn { flex: 1; text-align: center; padding: 10px 8px; }
}

/* ---------- 头部右侧：账号 + 购物车（对齐 903） ---------- */

li.shop-head-tools {
    /* 主题给 li 设了 inline-block，这里顺着来，间距用 margin 控制 */
    display: inline-block;
    margin-left: 18px;
    padding: 0;
    list-style: none;
    vertical-align: middle;
    line-height: 1;
}

/* 主题对 li 的 margin 有更高优先级，这里用 transform 精确对齐 903 的位置（左移 19 / 下移 2） */
@media (min-width: 992px) {
    li.shop-head-tools { transform: translate(-19px, 2px); }
}

.shop-head-ico + .shop-head-ico { margin-left: 20px; }

li.shop-head-tools::before,
li.shop-head-tools::after { content: none; }

.shop-head-ico {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #222 !important;
    text-decoration: none !important;
    line-height: 1;
    transition: color .15s ease;
}

.shop-head-ico svg {
    /* 903 实测：图标 25×25 */
    width: 25px;
    height: 25px;
    display: block;
}

/* 903 原版图标是填充路径，用 currentColor 才能跟着悬停变色 */
.shop-head-ico svg { fill: currentColor; stroke: none; }

.shop-head-ico:hover { color: #ff9600 !important; }

.shop-head-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ff9600;
    color: #fff !important;
    font-size: 10px;
    font-weight: 400;
    text-align: center;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    letter-spacing: 0;
}

.shop-head-badge[hidden] { display: none; }

@media (max-width: 991px) {
    /* 手机端头部图标：三个图标等大、等间距，整组水平居中 */
    .ltn__header-options,
    .ltn__header-options > ul {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0;
    }

    /* 模板里两个空 li 和包着 <style> 的 li 不参与布局 */
    .ltn__header-options > ul > li:empty,
    .ltn__header-options > ul > li:has(> style) {
        display: none !important;
    }

    .ltn__header-options > ul > li {
        margin: 0 !important;
        padding: 0 !important;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        margin: 0 !important;
        position: relative;
        top: 0 !important;
    }

    .mobile-menu-toggle > a {
        width: 24px;
        height: 24px;
        margin: 0 !important;
    }

    .mobile-menu-toggle svg {
        width: 64px;
        height: 48px;
    }

    .mobile-menu-toggle svg path { stroke-width: 32px; }

    .ltn__header-options > ul > li.shop-head-tools {
        display: flex !important;
        align-items: center;
        gap: 32px !important;
        margin-left: 0 !important;
        transform: none !important;
    }

    .shop-head-ico,
    .shop-head-ico + .shop-head-ico {
        width: 24px;
        height: 24px;
        margin: 0 !important;
    }

    .shop-head-ico svg {
        width: 24px;
        height: 24px;
    }
}

.shop-float-tools {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shop-float-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(20, 22, 26, .88);
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    font-size: 11px;
    line-height: 1.1;
    letter-spacing: .5px;
    position: relative;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    transition: background .18s ease;
}

.shop-float-btn:hover { background: #14161a; }

.shop-float-btn .shop-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    margin: 0;
    background: #a8894f;
}

.shop-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #14161a;
    color: #fff !important;
    font-size: 11px;
    text-align: center;
    vertical-align: 1px;
}

.shop-badge.shop-badge-zero { display: none; }

.shop-toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 22, 26, .94);
    color: #fff;
    padding: 11px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    z-index: 9999;
    max-width: 88vw;
}

.shop-toast.shop-toast-on {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 商品页注入的「加入购物车 / 收藏」 */
.shop-inject-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 6px;
    flex-wrap: wrap;
}

/* 电脑端：数量 / BUY NOW / 加购 / 收藏全部排在一行 */
@media (min-width: 992px) {
    .buy-actions-static {
        flex-wrap: nowrap;
    }
    .buy-actions-static .shop-inject-actions {
        gap: 12px;
        margin: 0;
        flex-wrap: nowrap;
    }
    .buy-actions-static .shop-inject-btn {
        height: 46px;
        padding: 0 24px;
    }
    .buy-actions-static .cart-plus-minus {
        height: 46px;
        line-height: 39px;
    }
}

.shop-inject-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border: 1px solid #14161a;
    background: #14161a;
    color: #fff !important;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none !important;
    font-family: inherit;
    transition: opacity .18s ease;
}

.shop-inject-btn:hover { opacity: .86; }

.shop-inject-btn.is-ghost {
    background: transparent;
    color: #14161a !important;
}

.shop-inject-btn.is-ghost:hover { background: #f7f8fa; }

.shop-inject-btn[disabled] { opacity: .5; cursor: not-allowed; }

.shop-inject-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
