/* ========================================================
   PHP Shop Mall - Home Index Stylesheet
   Matches 财小神 1:1 Layout: Slider + Floors + Hot Rankings
======================================================== */

/* ---------------- 轮播大屏容器 ---------------- */
.home-hero-section {
    position: relative;
    background-color: #2d519a;
    transition: background-color 0.4s ease;
    min-height: 440px;
    margin-bottom: 20px;
}

.hero-container {
    position: relative;
    height: 440px;
}

.hero-slider-box {
    position: relative;
    left: 0;
    width: 1200px;
    height: 440px;
    overflow: hidden;
    margin: 0 auto;
}

.slider-items {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.slider-slide.active {
    opacity: 1;
    z-index: 2;
}

.slider-slide a, .slider-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
}

.slider-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.slider-dots .dot.active {
    background: #ffffff;
    width: 24px;
    border-radius: 5px;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 60px;
    line-height: 60px;
    background: rgba(0,0,0,0.25);
    color: #ffffff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: none;
    transition: background 0.2s;
}

.hero-slider-box:hover .slider-arrow {
    display: block;
}

.slider-arrow:hover {
    background: rgba(0,0,0,0.6);
}

.arrow-prev { left: 0; }
.arrow-next { right: 0; }

/* ---------------- 楼层模块展示 ---------------- */
.home-floors-section {
    padding-top: 10px;
}

.floor-module {
    margin-bottom: 30px;
}

.floor-top-banner {
    margin-bottom: 12px;
    height: 90px;
    max-height: 90px;
    overflow: hidden;
    border-radius: 4px;
}

.floor-top-banner img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* 楼层标题栏 */
.floor-header-bar {
    height: 40px;
    line-height: 40px;
    border-bottom: 2px solid var(--primary-red);
    margin-bottom: 12px;
}

.floor-header-left {
    float: left;
    display: flex;
    align-items: center;
}

.floor-badge {
    background: var(--primary-red);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 2px;
    margin-right: 10px;
}

.floor-name {
    font-size: 20px;
    font-weight: 800;
    color: #222222;
    margin-right: 8px;
}

.floor-more-arrow {
    font-size: 18px;
    color: #888888;
    margin-left: 4px;
}

.floor-header-right {
    float: right;
    width: 230px;
}

.rank-tab-header {
    background: linear-gradient(90deg, #0099b8 0%, #00b4d8 100%);
    color: #ffffff;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
    height: 38px;
    line-height: 38px;
    border-radius: 2px 2px 0 0;
}

/* 楼层主体三栏排版 */
.floor-body-row {
    background: #ffffff;
    border: 1px solid #eeeeee;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

/* 左侧海报大图 (210px) */
.floor-col-left {
    float: left;
    width: 210px;
    height: 490px;
    background: #fafafa;
    border-right: 1px solid #eeeeee;
    position: relative;
    overflow: hidden;
}

.left-banner-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.left-banner-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.left-banner-link:hover img {
    transform: scale(1.02);
}

.banner-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    line-height: 40px;
    background: rgba(210, 30, 32, 0.85);
    color: #ffffff;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
}

/* 中间 4列 x 2行 = 8格商品 (760px) */
.floor-col-center {
    float: left;
    width: 760px;
    height: 490px;
    border-right: 1px solid #eeeeee;
    background: #ffffff;
}

.product-grid {
    width: 100%;
    height: 100%;
}

.product-card {
    float: left;
    width: 25%; /* 4列 */
    height: 245px; /* 2行 = 490px */
    border-right: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;
    padding: 12px;
    box-sizing: border-box;
    transition: all 0.2s;
    background: #ffffff;
}

.product-card:nth-child(4n) {
    border-right: none;
}

.product-card:nth-child(n+5) {
    border-bottom: none;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    position: relative;
    z-index: 5;
}

.card-inner {
    display: block;
    text-align: center;
}

.card-img-wrap {
    width: 150px;
    height: 140px;
    margin: 0 auto 8px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s;
}

.product-card:hover .card-img-wrap img {
    transform: scale(1.04);
}

.brand-tag {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.6);
    color: #ffffff;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 2px;
}

.card-price {
    color: var(--primary-red);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
    text-align: left;
    padding-left: 4px;
}

.card-title {
    font-size: 12px;
    color: #444444;
    line-height: 1.4;
    height: 34px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: left;
    padding: 0 4px;
}

.product-card:hover .card-title {
    color: var(--primary-red);
}

/* 右侧排行榜 (228px) */
.floor-col-right {
    float: left;
    width: 228px;
    height: 490px;
    background: #ffffff;
    padding: 8px 10px;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 12px 6px;
    border-bottom: 1px dashed #f0f0f0;
    height: 94px;
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-num {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    background: #bbbbbb;
    margin-right: 8px;
    flex-shrink: 0;
}

.rank-num-1 { background: #d21e20; }
.rank-num-2 { background: #ff7849; }
.rank-num-3 { background: #ffb800; }

.rank-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rank-detail {
    flex: 1;
    overflow: hidden;
}

.rank-price {
    color: var(--primary-red);
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
}

.rank-title {
    font-size: 11px;
    color: #555555;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rank-title:hover {
    color: var(--primary-red);
}
