/* 默认抖音模板的商品目录与首页；不影响其他模板。 */
.dy-catalog .catalog-content {
    position: absolute;
    inset: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 0 calc(76px + env(safe-area-inset-bottom, 0px));
    background: #f5f5f5;
}

/* header.php 的历史行内样式仅在以下明确的店铺头部规则中覆盖。 */
.dy-catalog .live-room-card {
    margin: 10px 10px 0 !important;
    border-radius: 12px 12px 0 0 !important;
    background: #2b1d14 !important;
    box-shadow: none !important;
}

.dy-catalog .live-room-header {
    min-height: 38px;
    border-bottom: 1px solid rgba(245, 231, 216, .12);
    padding: 9px 12px !important;
}

.dy-catalog .live-room-header > div:first-child > span {
    color: #f5e7d8 !important;
    font-size: 11px !important;
}

.dy-catalog .live-room-header > div:last-child svg path {
    stroke: #ccb99f;
}

.dy-catalog .live-room-content {
    background: #fff8f0;
}

.dy-catalog .live-room-card + .fui-notice {
    display: block;
    margin: 0 10px 12px !important;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: #2b1d14 !important;
    box-shadow: 0 4px 12px rgba(43, 29, 20, .07) !important;
}

.dy-catalog .live-room-card + .fui-notice > div:first-child {
    display: none;
}

.dy-catalog .shop-info {
    padding: 15px 0 17px;
    background: linear-gradient(120deg, #2b1d14, #5a3a22);
}

.dy-catalog .shop-header .tx {
    width: 46px !important;
    height: 46px !important;
    margin-right: 10px !important;
    border: 1px solid rgba(245, 231, 216, .5);
}

.dy-catalog .shop-content {
    min-width: 0;
}

.dy-catalog .shop-header .item-title {
    gap: 8px;
    color: #fff3df !important;
    font-size: 16px !important;
}

.dy-catalog .shop-header .item-title > div {
    min-width: 0;
    flex: 1;
}

.dy-catalog .shop-header .item-title > div > a {
    flex-shrink: 0;
    border-color: #d6c1a5 !important;
}

.dy-catalog .shop-header .item-title > div > a path {
    fill: #d6c1a5;
}

.dy-catalog .shop-header .follow-btn {
    flex-shrink: 0;
    width: 60px !important;
    min-height: 25px;
    background: #ff2c55 !important;
    font-size: 12px !important;
}

.dy-catalog .shop-header .follow-btn.following {
    background: rgba(245, 231, 216, .14) !important;
    color: #f5e7d8 !important;
}

.dy-catalog .shop-stats {
    margin-top: 4px;
}

.dy-catalog .shop-stats > div > div:first-child {
    color: #f5e7d8 !important;
}

.dy-catalog .shop-stats > div > div:last-child {
    color: #c9b49c !important;
}

.dy-catalog .shop-stats > div:nth-child(even) {
    background: rgba(245, 231, 216, .2) !important;
}

.dy-catalog .shop-stats svg path {
    fill: #c9b49c;
    stroke: #c9b49c;
}

.dy-catalog .catalog-section {
    margin: 12px 10px 0;
}

.dy-catalog .catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 10px 0 6px;
    border-radius: 10px 10px 0 0;
    background: #fff;
}

.dy-catalog .catalog-sort {
    display: flex;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    max-width: 300px;
}

.dy-catalog .catalog-sort .filter-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 46px;
    padding: 0 5px;
    border: 0;
    background: transparent;
    color: #585858;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.dy-catalog .catalog-sort .filter-item.active {
    color: #ff2c55;
    font-weight: 600;
}

.dy-catalog .catalog-sort .filter-item.active::after {
    position: absolute;
    bottom: 5px;
    left: calc(50% - 7px);
    width: 14px;
    height: 3px;
    border-radius: 2px;
    background: #ff2c55;
    content: "";
}

.dy-catalog .catalog-sort-arrows {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-left: 5px;
}

.dy-catalog .catalog-sort-arrows i {
    width: 0;
    height: 0;
    border-right: 3px solid transparent;
    border-left: 3px solid transparent;
}

.dy-catalog .catalog-sort-arrows i:first-child {
    border-bottom: 4px solid #c2c2c2;
}

.dy-catalog .catalog-sort-arrows i:last-child {
    border-top: 4px solid #c2c2c2;
}

.dy-catalog .catalog-price-sort[data-direction="asc"] i:first-child {
    border-bottom-color: #ff2c55;
}

.dy-catalog .catalog-price-sort[data-direction="desc"] i:last-child {
    border-top-color: #ff2c55;
}

.dy-catalog .layout-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 36px;
    margin-left: 8px;
    border: 0;
    border-left: 1px solid #eee;
    background: transparent;
    color: #5c5c5c;
    cursor: pointer;
}

.dy-catalog .layout-switch svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.dy-catalog .layout-switch .list-mode,
.dy-catalog .layout-switch.list-mode .grid-mode {
    display: none;
}

.dy-catalog .layout-switch.list-mode .list-mode {
    display: block;
}

.dy-catalog .catalog-promotion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 35px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 0 0 10px 10px;
    background: #fff4f2;
    color: #b18b77;
    font-size: 10px;
}

.dy-catalog .catalog-promotion-label {
    min-width: 0;
    overflow: hidden;
    color: #b26043;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dy-catalog .catalog-promotion > span:last-child {
    flex-shrink: 0;
}

.dy-catalog .catalog-grid.fui-goods-group.block {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
    margin: 0;
    padding: 0;
    background: transparent;
}

.dy-catalog .catalog-grid::before,
.dy-catalog .catalog-grid::after {
    display: none;
}

.dy-catalog .catalog-grid .catalog-card {
    display: block;
    float: none;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 9px;
    background: #fff;
    color: #262626;
    text-decoration: none;
}

.dy-catalog .catalog-grid .catalog-card .catalog-card-image {
    float: none;
    width: 100%;
    height: 0;
    margin: 0;
    padding-bottom: 100%;
    border-radius: 0;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
}

.dy-catalog .catalog-grid.fui-goods-group .catalog-card .catalog-card-detail {
    margin: 0;
    padding: 10px 9px 12px;
    border-radius: 0;
    background: #fff;
}

.dy-catalog .catalog-grid.fui-goods-group.block .catalog-card .detail .name {
    display: -webkit-box;
    height: 38px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: #252525;
    font-size: 13px;
    font-weight: 500;
    line-height: 19px;
    white-space: normal;
    word-break: break-word;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dy-catalog .catalog-card .brand-tag {
    display: inline-block;
    margin-right: 3px;
    padding: 0 3px;
    border-radius: 2px;
    background: #2b1d14;
    color: #f5e7d8;
    font-size: 10px;
    font-weight: 500;
    line-height: 15px;
    vertical-align: 1px;
}

.dy-catalog .catalog-grid .catalog-card .visitor-count {
    margin: 5px 0 8px;
    color: #a38a72;
    font-size: 10px;
    line-height: 14px;
}

.dy-catalog .catalog-grid .catalog-card .price {
    display: block;
    margin: 0;
    padding: 0;
    line-height: normal;
}

.dy-catalog .catalog-grid .catalog-card .price .catalog-price-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px;
    color: #ff2c55;
}

.dy-catalog .catalog-grid .catalog-card .minprice {
    display: inline;
    margin: 0;
    color: #ff2c55;
    font-size: 21px;
    font-weight: 700;
    line-height: 25px;
    letter-spacing: -.4px;
}

.dy-catalog .catalog-card .minprice::before {
    margin-right: 1px;
    font-size: 12px;
    font-weight: 600;
    content: "¥";
}

.dy-catalog .catalog-card .promotion-text {
    color: #ff2c55;
    font-size: 10px;
}

.dy-catalog .catalog-card .sold-count {
    margin-top: 4px;
    color: #999;
    font-size: 10px;
    line-height: 14px;
}

.dy-catalog .catalog-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
}

.dy-catalog .catalog-card .tag {
    padding: 1px 3px;
    border: 1px solid #eddcc8;
    border-radius: 2px;
    color: #a57745;
    font-size: 9px;
    line-height: 13px;
}

.dy-catalog .catalog-grid.catalog-list {
    grid-template-columns: minmax(0, 1fr);
}

.dy-catalog .catalog-grid.catalog-list .catalog-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    align-items: start;
}

.dy-catalog .catalog-grid.fui-goods-group.catalog-list .catalog-card .catalog-card-detail {
    padding: 10px;
}

.dy-catalog .catalog-grid.catalog-list .catalog-card .visitor-count {
    margin: 4px 0;
}

.dy-catalog .catalog-grid.catalog-list .catalog-card .tags {
    margin-top: 5px;
}

.dy-catalog .catalog-slider {
    position: relative;
    overflow: hidden;
    margin: 12px 10px 0;
    border-radius: 10px;
    background: #fff;
    touch-action: pan-y;
}

.dy-catalog .catalog-slider .slider-wrapper {
    display: flex;
    width: 100%;
    transition: transform .3s ease;
    will-change: transform;
}

.dy-catalog .catalog-slider .slider-item {
    position: relative;
    flex: 0 0 100%;
    min-width: 0;
    padding-bottom: 100%;
}

.dy-catalog .catalog-slider img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dy-catalog .slider-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    display: flex;
    gap: 5px;
    transform: translateX(-50%);
}

.dy-catalog .slider-indicators .indicator {
    width: 6px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: rgba(255, 255, 255, .6);
    cursor: pointer;
    transition: width .2s ease;
}

.dy-catalog .slider-indicators .indicator.active {
    width: 18px;
    background: #fff;
}

.dy-catalog .catalog-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin: 19px 0 12px;
}

.dy-catalog .catalog-section-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #a18465;
    font-size: 10px;
    letter-spacing: 2px;
}

.dy-catalog .catalog-section-heading h2 {
    margin: 0;
    color: #2b1d14;
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
}

.dy-catalog .catalog-section-heading > a {
    padding: 5px 0;
    color: #8d7b6c;
    font-size: 11px;
    text-decoration: none;
}

.dy-catalog .catalog-empty {
    padding: 55px 15px;
    color: #999;
    font-size: 13px;
    text-align: center;
}

.dy-catalog .storefront-navbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    z-index: 50;
    display: flex;
    width: 100%;
    max-width: 420px;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding: 0 5px env(safe-area-inset-bottom, 0px);
    border-top: 1px solid #f0f0f0;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -3px 12px rgba(43, 29, 20, .03);
    transform: translateX(-50%);
}

.dy-catalog .storefront-navbar .nav-item {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 7px 0 5px;
    color: #8e8e8e;
    text-decoration: none;
}

.dy-catalog .storefront-navbar .nav-item.active {
    color: #b38554;
}

.dy-catalog .storefront-navbar .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 23px;
    margin: 0 0 4px;
}

.dy-catalog .storefront-navbar .icon svg {
    width: 21px;
    height: 21px;
    color: currentColor;
}

.dy-catalog .storefront-navbar .icon svg path {
    fill: currentColor;
}

.dy-catalog .storefront-navbar .label {
    color: inherit;
    font-size: 10px;
    line-height: 14px;
}

.dy-catalog button:focus-visible,
.dy-catalog .catalog-card:focus-visible,
.dy-catalog .storefront-navbar a:focus-visible {
    outline: 2px solid #b38554;
    outline-offset: 2px;
}

@media (max-width: 350px) {
    .dy-catalog .catalog-section,
    .dy-catalog .catalog-slider {
        margin-right: 8px;
        margin-left: 8px;
    }

    .dy-catalog .catalog-grid.fui-goods-group.block {
        gap: 8px;
    }

    .dy-catalog .catalog-promotion > span:last-child {
        display: none;
    }

    .dy-catalog .catalog-grid.catalog-list .catalog-card {
        grid-template-columns: 100px minmax(0, 1fr);
    }

    .dy-catalog .catalog-grid.fui-goods-group .catalog-card .catalog-card-detail {
        padding-right: 7px;
        padding-left: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dy-catalog .catalog-slider .slider-wrapper,
    .dy-catalog .slider-indicators .indicator {
        transition: none;
    }
}
