/* 速购 Tab 页统一顶栏：首页 / 所有商品 / 购物车 */
:root {
    --shop-topbar-h: 40px;
    --shop-topbar-title-fs: 17px;
    --shop-topbar-title-color: #333;
    --shop-topbar-bg: url("/skin/images/image_title_bar_bg.png") no-repeat center center / 100% 100%;;
    --shop-topbar-safe: env(safe-area-inset-top, 0px);
    --shop-topbar-total: calc(var(--shop-topbar-h) + var(--shop-topbar-safe));
}

body.has-shop-topbar {
    padding-top: var(--shop-topbar-total) !important;
}

.shop-topbar,
header.shop-topbar,
.top-nav.shop-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    height: var(--shop-topbar-total);
    padding-top: var(--shop-topbar-safe);
    background: var(--shop-topbar-bg);
    color: var(--shop-topbar-title-color);
}

/* PC 端与页面内容区对齐，覆盖 comm.css header{left:unset} */
@media screen and (min-width: 480px) {
    .top-nav.shop-topbar {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        max-width: 640px !important;
        width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    header.shop-topbar {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        max-width: 600px !important;
        width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

.top-nav.shop-topbar {
    background: linear-gradient(to bottom, #F0616F 0%, #EA4359 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-left: 0;
    padding-right: 0;
}

.top-nav.shop-topbar .top-nav-row {
    height: var(--shop-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

header.shop-topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    line-height: var(--shop-topbar-h);
    text-align: center;
    font-size: var(--shop-topbar-title-fs);
}

.shop-topbar-title,
.top-nav.shop-topbar .title,
header.shop-topbar .shop-topbar-title,
header.shop-topbar > span {
    position: absolute;
    left: 50%;
    top: calc(var(--shop-topbar-safe) + var(--shop-topbar-h) / 2);
    transform: translate(-50%, -50%);
    margin: 0 !important;
    padding: 0;
    font-size: var(--shop-topbar-title-fs) !important;
    line-height: 1 !important;
    font-weight: normal;
    color: var(--shop-topbar-title-color) !important;
    white-space: nowrap;
}

header.shop-topbar > a.shop-topbar-back {
    position: absolute;
    left: 0;
    right: auto;
    top: var(--shop-topbar-safe);
    width: 40px;
    height: var(--shop-topbar-h);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

header.shop-topbar > a.shop-topbar-action {
    position: absolute;
    left: auto;
    right: 0;
    top: var(--shop-topbar-safe);
    width: 40px;
    height: var(--shop-topbar-h);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

header.shop-topbar a img {
    float: none !important;
    margin: 0 !important;
    width: 22px !important;
    height: 22px !important;
    position: static !important;
    top: auto !important;
}

.top-nav.shop-topbar .top-nav-row .shop-topbar-title,
.top-nav.shop-topbar .top-nav-row .title {
    top: 50%;
}

.top-nav.shop-topbar .top-nav-logo,
.top-nav.shop-topbar .top-nav-slot {
    width: 34px;
    min-width: 34px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
