/**
 * 1688Buyer - Factory Detail CSS Module (找工厂 · 工厂档案 / 主页)
 * Modeled from 1688 sale.1688.com/factory/card.html
 */

.factory-detail-page {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-body, #f5f5f7);
    color: var(--text-primary, #333333);
    font-family: var(--font-body);
    padding-bottom: 60px;
}

.factory-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px 0;
    box-sizing: border-box;
}

/* Breadcrumbs */
.factory-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.factory-breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.factory-breadcrumb a:hover {
    color: var(--primary-color, #ff5000);
}

.factory-breadcrumb .bc-sep {
    color: #ccc;
}

.factory-breadcrumb .current {
    color: #333;
    font-weight: 500;
}

/* 1. Authenticity Assurance Bar */
.factory-auth-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #1b7340 0%, #2ba25d 100%);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
}

.auth-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-shield-icon {
    font-size: 18px;
}

.auth-title {
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.auth-desc {
    opacity: 0.9;
    font-size: 12px;
}

.auth-banner-right .auth-link {
    color: #fff;
    text-decoration: underline;
    font-size: 12px;
    cursor: pointer;
}

/* 2. Hero Header Card */
.factory-hero-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e5e5);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.factory-hero-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.factory-profile-main {
    display: flex;
    gap: 18px;
    flex: 1;
    min-width: 320px;
}

.factory-avatar-box {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    border: 2px solid #ffd591;
    overflow: hidden;
    background: #fff7e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
}

.factory-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.factory-profile-text {
    flex: 1;
}

.factory-hero-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.factory-hero-name {
    font-size: 22px;
    font-weight: 700;
    color: #1f1f1f;
    margin: 0;
}

.factory-years-badge {
    background: #fff7e6;
    color: #d46b08;
    border: 1px solid #ffd591;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.factory-badges-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.factory-pill-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid;
}

.factory-address-row {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.factory-address-pin {
    color: var(--primary-color, #ff5000);
}

.btn-map-link {
    color: #1890ff;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
}

.btn-map-link:hover {
    text-decoration: underline;
}

.factory-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-factory-chat {
    background: linear-gradient(135deg, #ff6000 0%, #ff4000 100%);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(255,80,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-factory-chat:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255,80,0,0.35);
}

.btn-factory-follow {
    background: #ffffff;
    color: #333;
    border: 1px solid #d9d9d9;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-factory-follow:hover {
    border-color: #ff5000;
    color: #ff5000;
}

.btn-factory-report {
    background: #f0f7ff;
    color: #096dd9;
    border: 1px solid #91d5ff;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-factory-report:hover {
    background: #e6f7ff;
}

/* 3. Main 2-Column Content Layout */
.factory-content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
    align-items: start;
}

/* Left Sections */
.factory-section-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.section-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-bar-indicator {
    width: 4px;
    height: 18px;
    background: var(--primary-color, #ff5000);
    border-radius: 2px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f1f1f;
    margin: 0;
}

/* Metric 4-Boxes */
.factory-metric-boxes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.metric-box-item {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    padding: 14px 12px;
    text-align: center;
}

.metric-box-label {
    font-size: 12px;
    color: #8c8c8c;
    margin-bottom: 6px;
}

.metric-box-val {
    font-size: 18px;
    font-weight: 700;
    color: #ff5000;
}

/* Capabilities list */
.factory-caps-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #434343;
    margin: 14px 0 8px;
}

.factory-caps-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.cap-chip-item {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Special Crafts */
.crafts-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.craft-pill {
    background: #fafafa;
    color: #595959;
    border: 1px solid #e8e8e8;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
}

/* Workshop Albums */
.workshop-albums-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.workshop-album-card {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    text-align: center;
}

.workshop-album-thumb-wrap {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #eaeaea;
}

.workshop-album-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.workshop-album-card:hover img {
    transform: scale(1.05);
}

.workshop-album-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    padding: 8px 6px;
}

/* Factory Products Grid */
.factory-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.factory-prod-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.factory-prod-card:hover {
    border-color: #ff5000;
    box-shadow: 0 4px 12px rgba(255,80,0,0.15);
    transform: translateY(-2px);
}

.factory-prod-thumb-wrap {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.factory-prod-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.factory-prod-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.factory-prod-title {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
}

.factory-prod-meta {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.factory-prod-price {
    color: #ff5000;
    font-weight: 700;
    font-size: 16px;
}

.factory-prod-price .currency {
    font-size: 12px;
    font-weight: 400;
}

.factory-prod-sold {
    font-size: 11px;
    color: #8c8c8c;
}

/* Reviews List */
.factory-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-item-box {
    background: #fafafa;
    border-radius: 6px;
    padding: 12px 16px;
    border: 1px solid #f0f0f0;
}

.review-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.review-user-name {
    font-weight: 600;
    font-size: 13px;
    color: #262626;
}

.review-date {
    font-size: 12px;
    color: #8c8c8c;
}

.review-content-text {
    font-size: 13px;
    color: #595959;
    line-height: 1.5;
    margin-bottom: 8px;
}

.review-tags-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.review-tag-pill {
    background: #fff;
    color: #fa8c16;
    border: 1px solid #ffd591;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
}

/* Right Sidebar / Aside */
.factory-sidebar-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-info-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.sidebar-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #262626;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fulfill-score-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
    text-align: center;
}

.fulfill-score-cell {
    background: #f9f9f9;
    border-radius: 4px;
    padding: 8px 4px;
}

.score-num {
    font-size: 16px;
    font-weight: 700;
    color: #ff5000;
}

.score-label {
    font-size: 11px;
    color: #8c8c8c;
    margin-top: 2px;
}

.sidebar-detail-rows {
    font-size: 12px;
    color: #595959;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-row-item {
    display: flex;
    justify-content: space-between;
}

.sidebar-row-item .label {
    color: #8c8c8c;
}

/* Similar Factory Items */
.similar-factory-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.similar-factory-item {
    padding: 10px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.similar-factory-item:hover {
    border-color: #ff5000;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.similar-name {
    font-size: 13px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 4px;
}

.similar-cats {
    font-size: 11px;
    color: #8c8c8c;
    margin-bottom: 4px;
}

.similar-meta-row {
    font-size: 11px;
    color: #ff5000;
    display: flex;
    justify-content: space-between;
}

/* Responsive */
@media (max-width: 992px) {
    .factory-content-grid {
        grid-template-columns: 1fr;
    }
    .factory-metric-boxes-grid,
    .workshop-albums-grid,
    .factory-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .factory-hero-row {
        flex-direction: column;
    }
    .factory-hero-actions {
        width: 100%;
        justify-content: space-between;
    }
    .factory-metric-boxes-grid,
    .workshop-albums-grid,
    .factory-products-grid {
        grid-template-columns: 1fr;
    }
}
