/*!
 * shopxo 主题 —— 首页（对齐 design/prototype 的 PC 版式）
 * 结构：焦点图行（左侧 200px 纯白分类列 + 右侧焦点图）
 *      → 分类楼层（左 220px 分类块 + 右 4 列商品）
 *      → 品牌館（6 列）→ 底部圖文（4 项服务保障）
 */

/* ===================== 焦点图行 ===================== */
/* 焦点图行已移出 .sx-container（见 index.html）：焦点图满宽铺到视口两侧（左右不留白）。
   白色分类列**不再把焦点图挤到右边**，而是以「覆盖层」方式浮在焦点图之上，
   位置仍与内容列左缘对齐（--sx-edge = 内容列左缘偏移），与下方楼层左缘对齐。
   宽度取父级内容宽（= 视口宽 - 滚动条），不用 100vw，避免 15px 横向溢出。 */
.sx-banner-row {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 0;
    /* 内容列左缘偏移：视口宽 ≥ 1256+32 时 = (宽 - 1256)/2，否则 = gutter */
    --sx-edge: max(var(--container-gutter), calc((100% - var(--container-width)) / 2));
}

/* 焦点图紧贴导航条下方、与下方楼层无缝衔接：
   主体上内边距（.sx-main padding-top）与焦点图行下外边距会形成两条浅灰空白带 → 首页去掉 */
body.sx-page-index .sx-main {
    padding-top: 0;
}

/* 白色分类列：浮在焦点图之上（覆盖层），位置不变 = 内容列左缘 */
.sx-catcol {
    position: absolute;
    left: var(--sx-edge);
    top: 0;
    bottom: 0;
    z-index: 2;
    width: 200px;
    padding: 10px 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* 不能加 overflow:hidden —— 会把 hover 弹出的子分类面板裁掉 */
}

/* 分类条目（.sx-catcol-item）与 hover 子面板（.sx-catcol-panel / -sub / -sub2 / -sub3）
   已迁到 theme.css —— 这组规则同时服务于「首页白色分类列」与「顶部橙块下拉面板
   (common/menu.html)」两处，宿主会员中心页也复用商城头部但**不加载 home.css**，
   放 theme.css 才能两边都生效。 */


/* 右侧焦点图 */
.sx-banner-row .sx-banner {
    flex: 1;
    min-width: 0;
    height: 420px;
    margin-bottom: 0;
    border-radius: 0;
}

.sx-banner-row .sx-banner-slider {
    position: relative;
    overflow: hidden;
    height: 100%;
}

/* 焦点图 slide：绝对定位铺满，JS 切 .sx-active 做淡入淡出
   （原型 .m-banner .slide/.slide.on —— 原型用 display 切换，这里用 opacity 以保留过渡） */
.sx-slide {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    visibility: hidden;
    transition: opacity .45s ease, visibility .45s ease;
}

.sx-slide.sx-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.sx-slide > a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

/* 焦点图圆点（原型 .m-banner .dots：右下角） */
.sx-banner-dots {
    position: absolute;
    right: 30px;
    bottom: 26px;
    z-index: 3;
    display: flex;
    gap: 5px;
}

.sx-banner-dots span {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    transition: width .2s, background .2s;
}

.sx-banner-dots span.sx-active {
    width: 12px;
    border-radius: 3px;
    background: #fff;
}

/* 左右切换箭头（悬停显示） */
.sx-banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 36px;
    height: 36px;
    line-height: 34px;
    text-align: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s, background .2s;
}

.sx-banner:hover .sx-banner-arrow {
    opacity: 1;
}

.sx-banner-arrow:hover {
    background: var(--color-main);
}

/* 上一张箭头：右移让开左侧覆盖的白色分类列 */
.sx-banner-arrow.sx-prev {
    left: calc(var(--sx-edge) + 200px + 14px);
}

.sx-banner-arrow.sx-next {
    right: 14px;
}

/* 焦点图文字（原型：底部渐变遮罩 + 白字标题）
   左侧留出白色分类列（覆盖层）所占的宽度，文字不被压在分类列下面 */
.sx-banner-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 30px 26px calc(var(--sx-edge) + 200px + 30px);
    background: linear-gradient(transparent, rgba(0, 0, 0, .6));
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
}

/* 区块通用标题（.sx-sec-head / .sx-sec-sub / .sx-sec-more）已统一迁到 theme.css，
   规范取自原型 design/prototype/assets/proto.css 的 .p-sec-head，全站共用一套。 */

/* ===================== 分类楼层 ===================== */
.sx-floor {
    background: #fff;
    margin-bottom: 14px;
    padding: 18px 16px;
}

.sx-floor-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    /* 与全站区块标题统一：2px 主橙底边（原型 .p-sec-head） */
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-main);
}

.sx-floor-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.sx-floor-head h2 a {
    color: var(--color-title);
    text-decoration: none;
}

.sx-floor-head h2 a:hover {
    color: var(--color-main);
}

.sx-floor-sub {
    font-size: 13px;
    color: var(--color-weak);
}

.sx-floor-more {
    margin-left: auto;
    font-size: 13px;
    color: var(--color-weak);
    text-decoration: none;
}

.sx-floor-more:hover {
    color: var(--color-main);
}

.sx-floor-body {
    display: flex;
    gap: 24px;
}

/* 楼层左侧分类块 */
.sx-floor-side {
    flex: 0 0 220px;
    width: 220px;
}

/* 楼层左侧图标 + 分类名整体可点（外链分类同样可点） */
.sx-floor-side-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.sx-floor-side-link:hover .sx-floor-side-title {
    color: var(--color-main);
}

/* 楼层左侧：竖长条分类大图（满侧栏宽 220px，高 560px），图下不显示分类名 */
.sx-floor-side-ico {
    display: block;
    width: 220px;
    height: 560px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-main-light);
}

.sx-floor-side-ico .sx-cat-ico {
    display: block;
    width: 100%;
    height: 100%;
}

/* 真实分类图：竖长条裁切填充 */
.sx-floor-side-ico img.sx-cat-ico {
    object-fit: cover;
    background: #f5f5f5;
}

/* 无图时的 SVG 兜底：居中 */
.sx-floor-side-ico svg.sx-cat-ico {
    padding: 30px;
    box-sizing: border-box;
}

.sx-floor-side-title {
    display: block;
    margin-top: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-title);
}

.sx-floor-side-desc {
    margin-top: 4px;
    font-size: 12px;
    line-height: 18px;
    color: var(--color-weak);
    max-height: 54px;
    overflow: hidden;
}

/* 楼层右侧商品区（4 列网格） */
.sx-floor-goods {
    flex: 1;
    min-width: 0;
}

.sx-floor-goods .sx-goods-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.sx-floor-goods .sx-goods-cell {
    width: auto;
    padding: 0;
}

.sx-floor-goods .sx-goods-img {
    padding-top: 0;
    height: 210px;
    border-radius: var(--border-radius-sm);
}

/* 楼层商品文字区：名称与价格间距收紧（标题自适应高度，最多两行） */
.sx-floor-goods .sx-goods-body {
    padding: 6px 0 0;
}

.sx-floor-goods .sx-goods-title {
    height: auto;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 20px;
}

.sx-floor-goods .sx-goods-price {
    margin-top: 0;
}

.sx-goods-meta {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-weak);
}

/* ===================== 品牌館 ===================== */
.sx-brand-hall {
    background: #fff;
    margin-bottom: 14px;
    padding: 18px 16px;
}

.sx-brand-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.sx-brand-item {
    padding: 18px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    text-align: center;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.sx-brand-item:hover {
    border-color: var(--color-main);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

.sx-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    margin-bottom: 8px;
    /* 品牌图失效时的占位底图 */
    background: var(--color-bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9c9c9' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 19.5V8.8l7.5-4.3 7.5 4.3v10.7z'/%3E%3Cpath d='M9 19.5v-6h6v6'/%3E%3C/svg%3E") no-repeat center/36px 36px;
}

.sx-brand-logo img {
    max-width: 100%;
    height: 56px;
    object-fit: contain;
}

/* 品牌图失效时用首字兜底 */
.sx-brand-logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-main);
    line-height: 56px;
}

.sx-brand-name {
    font-size: 14px;
    color: var(--color-text);
}

/* ===================== 底部圖文 ===================== */
.sx-bottoms {
    background: #fff;
    padding: 30px 16px;
}

.sx-bottoms-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
}

.sx-bottom-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sx-bottom-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--color-main-light);
    color: var(--color-main);
}

.sx-bottom-ico svg {
    width: 28px;
    height: 28px;
}

.sx-bottom-text b {
    display: block;
    font-size: 16px;
    color: var(--color-title);
}

.sx-bottom-text em {
    display: block;
    margin-top: 2px;
    font-style: normal;
    font-size: 12px;
    color: var(--color-weak);
}

/* ===================== 响应式 ===================== */
/* 1025–1199：PC 版式保留，按宽度收列 */
@media only screen and (max-width: 1199px) {
    .sx-catcol,
    .sx-banner-row .sx-banner {
        height: 360px;
    }

    /* 白列内容盒高 340px：12 项 × 32px = 384 > 340 会溢出被裁 → 图标降级到 26px
       （.sx-catcol-item 的降级规则已迁到 theme.css） */

    .sx-floor-goods .sx-goods-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sx-brand-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ≤1024：回到窄屏形态（白色分类列隐藏，焦点图满宽） */
@media only screen and (max-width: 1024px) {
    /* 窄屏不做通栏：左右各留 16px 内边距（与原容器内表现一致） */
    .sx-banner-row {
        padding-left: var(--container-gutter);
        padding-right: var(--container-gutter);
    }

    .sx-catcol {
        display: none;
    }

    /* 窄屏无覆盖层 → 文字与「上一张」箭头回到原位 */
    .sx-banner-text {
        padding-left: 30px;
    }

    .sx-banner-arrow.sx-prev {
        left: 14px;
    }

    .sx-banner-row .sx-banner {
        height: 320px;
    }

    .sx-banner-row .sx-banner-slider {
        height: 320px;
    }

    .sx-floor-goods .sx-goods-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sx-floor-side {
        display: none;
    }

    .sx-brand-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ≤768：手机端（整页白底、焦点图满宽、楼层两列） */
@media only screen and (max-width: 768px) {
    body.sx-page-index {
        background: #fff;
    }

    .sx-banner-row {
        margin-bottom: 12px;
    }

    .sx-banner-row .sx-banner,
    .sx-banner-row .sx-banner-slider {
        height: 200px;
    }

    .sx-page-index .sx-banner {
        border-radius: 0;
    }

    .sx-banner-text {
        padding: 20px 14px 14px;
        font-size: 15px;
    }

    .sx-floor {
        padding: 4px 0 0;
        margin-bottom: 18px;
        background: transparent;
    }

    .sx-floor-head {
        margin-bottom: 12px;
    }

    .sx-floor-head h2 {
        font-size: 16px;
    }

    .sx-floor-sub {
        display: none;
    }

    .sx-floor-goods .sx-goods-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 12px;
    }

    .sx-floor-goods .sx-goods-cell {
        padding: 0 0 12px;
    }

    .sx-floor-goods .sx-goods-img {
        height: auto;
        padding-top: 100%;
        border-radius: 10px;
    }

    .sx-floor-goods .sx-goods-body {
        padding: 8px 2px 0;
    }

    .sx-floor-goods .sx-goods-title {
        height: 38px;
        font-size: 13px;
        line-height: 19px;
    }

    .sx-brand-hall {
        background: transparent;
        padding: 0;
        margin-bottom: 18px;
    }

    .sx-brand-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .sx-brand-item {
        padding: 10px 6px;
    }

    .sx-bottoms {
        padding: 18px 12px;
    }

    .sx-bottoms-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .sx-bottom-ico {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
    }

    .sx-bottom-ico svg {
        width: 22px;
        height: 22px;
    }

    .sx-bottom-text b {
        font-size: 14px;
    }
}
