/* KBCOCO 商品展示系统样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 2px solid #e74c3c;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    color: #e74c3c;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}

.top-nav a {
    margin-left: 20px;
    color: #666;
    font-size: 14px;
    transition: color 0.2s;
}

.top-nav a:hover {
    color: #e74c3c;
}

/* Main Layout */
.site-main {
    padding: 20px 15px;
    min-height: calc(100vh - 130px);
    max-width: 1400px;
    margin: 0 auto;
}

/* ======= HOME PAGE - Masonry ======= */
.home-content {
    width: 100%;
}

.hero-banner {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 12px;
    margin-bottom: 30px;
    color: #fff;
}

.hero-banner h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.hero-banner p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}

/* Masonry Grid */
.masonry-grid {
    columns: 3;
    column-gap: 20px;
}

.category-card {
    break-inside: avoid;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s;
}

.category-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Category Header with background image */
.category-header {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.category-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(1px);
    transform: scale(1.1);
}

.category-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
}

.category-header-overlay h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.category-count {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

/* Brand Grid inside category card */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 12px;
    background: #f9f9f9;
}

.brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.brand-item:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.brand-logo-wrap {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 2px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    transition: border-color 0.2s;
}

.brand-item:hover .brand-logo-wrap {
    border-color: #e74c3c;
}

.brand-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    background: #fff5f5;
}

.brand-name {
    font-size: 11px;
    color: #555;
    font-weight: 500;
    line-height: 1.2;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-count {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

/* ======= CATEGORY PAGE ======= */
.category-page {
    width: 100%;
}

.breadcrumb {
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #999;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.breadcrumb a {
    color: #666;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #e74c3c;
}

.breadcrumb .sep {
    margin: 0 8px;
    color: #ddd;
}

.breadcrumb .current {
    color: #333;
    font-weight: 500;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.brand-header-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0f0;
}

.brand-header-info h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-header-info p {
    color: #999;
    font-size: 14px;
    margin-top: 4px;
}

/* Sibling brands nav */
.sibling-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sibling-item {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #eee;
    transition: all 0.2s;
}

.sibling-item:hover {
    color: #e74c3c;
    border-color: #e74c3c;
    background: #fff5f5;
}

.sibling-item.active {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.product-card a {
    display: block;
}

.product-card .img-wrap {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background: #f9f9f9;
    overflow: hidden;
}

.product-card .img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .img-wrap img {
    transform: scale(1.05);
}

.product-card .info {
    padding: 12px;
}

.product-card .name {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}

.product-card .price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.product-card .price {
    color: #e74c3c;
    font-size: 18px;
    font-weight: bold;
}

.product-card .price::before {
    content: "$";
    font-size: 13px;
}

.product-card .market-price {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
}

.product-card .meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 25px;
    padding: 15px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.pagination .current {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

.pagination .disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Product Detail */
.product-detail {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.product-detail .detail-top {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.product-detail .gallery {
    width: 450px;
    flex-shrink: 0;
}

.product-detail .gallery .main-img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #eee;
}

.product-detail .gallery .thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.product-detail .gallery .thumbs img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
}

.product-detail .gallery .thumbs img:hover,
.product-detail .gallery .thumbs img.active {
    border-color: #e74c3c;
}

.product-detail .detail-info {
    flex: 1;
}

.product-detail .detail-info h1 {
    font-size: 20px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.product-detail .price-block {
    background: #fff5f5;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.product-detail .price-block .current-price {
    font-size: 28px;
    color: #e74c3c;
    font-weight: bold;
}

.product-detail .price-block .current-price::before {
    content: "$";
    font-size: 16px;
}

.product-detail .price-block .original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

.product-detail .spec-block {
    margin-bottom: 20px;
}

.product-detail .spec-block h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.product-detail .spec-block .spec-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-detail .spec-block .spec-values span {
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
}

.product-detail .meta-info {
    font-size: 14px;
    color: #666;
    line-height: 2;
}

/* Back button */
.back-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #e74c3c;
    color: #fff;
    border-radius: 6px;
    margin-top: 15px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #c0392b;
    color: #fff;
}

/* Footer */
.site-footer {
    background: #333;
    color: #999;
    text-align: center;
    padding: 20px 0;
    font-size: 13px;
    margin-top: 30px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 1200px) {
    .masonry-grid {
        columns: 2;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        columns: 1;
    }
    
    .hero-banner {
        padding: 25px 15px;
    }
    
    .hero-banner h2 {
        font-size: 22px;
    }
    
    .brand-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-detail .detail-top {
        flex-direction: column;
    }
    
    .product-detail .gallery {
        width: 100%;
    }
    
    .brand-header {
        flex-direction: column;
        text-align: center;
    }
    
    .sibling-brands {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .brand-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .brand-logo-wrap {
        width: 48px;
        height: 48px;
    }
}
