/**
 * JMP Product Shortcodes v3.4 CSS
 * 三栏布局强制 + 内容均衡分配 + 5级响应式
 */

/* ============================================================
   三栏布局强制覆盖 — Elementor 列宽修正
   ============================================================ */
/* sec_main 的三列强制等宽 */
#sec_main .elementor-column:nth-child(1) {
    -webkit-box-flex: 0 !important;
    -ms-flex: 0 0 33.333% !important;
    flex: 0 0 33.333% !important;
    max-width: 33.333% !important;
}
#sec_main .elementor-column:nth-child(2) {
    -webkit-box-flex: 0 !important;
    -ms-flex: 0 0 33.333% !important;
    flex: 0 0 33.333% !important;
    max-width: 33.333% !important;
}
#sec_main .elementor-column:nth-child(3) {
    -webkit-box-flex: 0 !important;
    -ms-flex: 0 0 33.333% !important;
    flex: 0 0 33.333% !important;
    max-width: 33.333% !important;
}

/* ============================================================
   三栏布局强制覆盖 — Elementor 列宽修正 (width-based)
   ============================================================ */
.elementor-27442 .elementor-element-sec_main > .elementor-container > .elementor-column:nth-child(1),
#sec_main .elementor-column:nth-child(1) {
    width: 33.333% !important;
}
.elementor-27442 .elementor-element-sec_main > .elementor-container > .elementor-column:nth-child(2),
#sec_main .elementor-column:nth-child(2) {
    width: 33.333% !important;
}
.elementor-27442 .elementor-element-sec_main > .elementor-container > .elementor-column:nth-child(3),
#sec_main .elementor-column:nth-child(3) {
    width: 33.333% !important;
}

/* ============ 面包屑 ============ */
.jmp-breadcrumb {
    font-size: 13px;
    padding: 10px 0;
    color: #666;
}
.jmp-breadcrumb a { color: #36648A !important; text-decoration: none; }
.jmp-breadcrumb a:hover { text-decoration: underline; }

/* ============ 产品标题 ============ */
.product_title.entry-title {
    font-size: 28px !important;
    font-weight: bold !important;
    color: #333 !important;
    margin: 0 0 5px 0 !important;
    line-height: 1.3 !important;
}

/* ============ SKU + Category ============ */
.jmp-sku-category {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.jmp-badges { color: #888; font-size: 13px; }

/* ============ CTA 卡片 ============ */
.jmp-cta-card {
    margin-top: 10px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    background: #fff;
    border: 1px solid #f0f0f0;
}
.jmp-cta-card h3 {
    font-size: 14px !important;
    margin: 0 0 6px 0 !important;
    color: #333 !important;
    font-weight: 600 !important;
}
.jmp-cta-card p {
    margin: 0 0 10px 0 !important;
    font-size: 12px !important;
    color: #666 !important;
    line-height: 1.5 !important;
}
.jmp-cta-btn {
    display: inline-block;
    padding: 7px 20px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s;
    cursor: pointer;
}
.jmp-cta-primary {
    background-color: #f7c542;
    color: #000 !important;
    border: none;
}
.jmp-cta-primary:hover { background-color: #e6b535; color: #000 !important; }
.jmp-cta-outline {
    background-color: transparent;
    color: #000 !important;
    border: 2px solid #f7c542;
}
.jmp-cta-outline:hover { background-color: #fef9e7; border-color: #e6b535; }

/* ============ 物流信息 ============ */
.jmp-shipping-info {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #f9f9f9;
    border: 1px solid #f0f0f0;
    font-size: 12px;
    color: #555;
}
.jmp-shipping-info p {
    margin: 0 !important;
    padding: 2px 0 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}
.jmp-shipping-icon { font-size: 14px; }

/* ============ 规格表（三栏紧凑版） ============ */
.jmp-spec-table-wrapper {
    margin-top: 12px;
    width: 100%;
}
.jmp-spec-section { margin-bottom: 1px; }
.jmp-spec-section-title {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    margin: 0;
    padding: 6px 10px;
    background: #f5f5f5;
    border-left: 3px solid #36648A;
}
.jmp-spec-table {
    width: 100%;
    border-collapse: collapse;
}
.jmp-spec-table td {
    padding: 5px 10px;
    font-size: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
.jmp-spec-label { color: #666; width: 45%; white-space: nowrap; }
.jmp-spec-value { color: #333; font-weight: 500; }

/* ============ 互换品牌表格 ============ */
.jmp-interchange-table-wrapper { margin-top: 20px; }
.jmp-interchange-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}
.jmp-interchange-table thead { background: #36648A; }
.jmp-interchange-table thead th {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-align: left;
    border: none;
}
.jmp-interchange-table tbody td {
    padding: 8px 16px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.jmp-interchange-table tbody tr:last-child td { border-bottom: none; }
.jmp-interchange-table tbody tr:hover { background: #f5f8fb; }
.jmp-interchange-brand-cell { color: #36648A; font-weight: 600; width: 40%; }
.jmp-interchange-model-cell { color: #333; font-weight: 500; }

/* 旧文本兼容 */
.jmp-interchange { padding: 8px 0; font-size: 13px; }
.jmp-interchange-label { color: #666; }
.jmp-interchange-brand { color: #36648A; font-weight: 500; }

/* ============ 下载按钮 ============ */
.jmp-downloads {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    padding: 10px 0;
}
.jmp-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
    border: none;
}
.jmp-download-pdf { background: #36648A; color: #fff !important; }
.jmp-download-pdf:hover { background: #2a5070; color: #fff !important; }
.jmp-download-cad { background: #f5f5f5; color: #333 !important; border: 1px solid #ddd; }
.jmp-download-cad:hover { background: #e8e8e8; }

/* ============ 工程图 ============ */
.jmp-drawing-wrapper { text-align: center; }
.jmp-drawing-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #D2D2D2;
    border-radius: 5px;
}

/* ============ 区块标题 ============ */
.jmp-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #36648A;
}

/* ============ 产品描述 ============ */
.jmp-description-wrapper {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}
.jmp-description-wrapper p { margin-bottom: 12px; }
.jmp-placeholder-section {
    padding: 20px;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 6px;
    text-align: center;
}
.jmp-placeholder-text { color: #999; font-style: italic; margin: 0 !important; }

/* ============ FAQ ============ */
.jmp-faq-wrapper { margin-top: 20px; }
.jmp-faq-item {
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.2s;
}
.jmp-faq-item.open { border-color: #36648A; }
.jmp-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #fafafa;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
    user-select: none;
}
.jmp-faq-question:hover { background: #f0f4f7; }
.jmp-faq-toggle {
    font-size: 20px;
    font-weight: 300;
    color: #36648A;
    transition: transform 0.3s;
    min-width: 20px;
    text-align: center;
}
.jmp-faq-item.open .jmp-faq-toggle { transform: rotate(45deg); }
.jmp-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 16px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}
.jmp-faq-item.open .jmp-faq-answer { max-height: 500px; padding: 14px 16px; }

/* ============ 相关产品 ============ */
.jmp-related-products { margin-top: 30px; }
.jmp-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.jmp-related-item {
    text-align: center;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.jmp-related-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-2px); }
.jmp-related-link { text-decoration: none !important; display: block; }
.jmp-related-thumb { padding: 15px; background: #fff; }
.jmp-related-thumb img { width: 100%; height: auto; object-fit: contain; }
.jmp-related-name {
    padding: 10px 12px;
    font-size: 13px;
    color: #333 !important;
    font-weight: 500;
    border-top: 1px solid #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============ 产品图片 ============ */
.woocommerce-product-gallery { text-align: center; }
.woocommerce-product-gallery img { max-width: 100%; height: auto; }

/* ============================================================
   响应式 — 5 级断点
   ============================================================ */

@media (max-width: 1440px) {
    .jmp-related-grid { gap: 16px; }
    .jmp-spec-label { width: 40%; }
}

@media (max-width: 1024px) {
    .product_title.entry-title { font-size: 24px !important; }
    .jmp-related-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .jmp-spec-label { width: 38%; font-size: 12px; }
    .jmp-spec-value { font-size: 12px; }
    .jmp-spec-table td { padding: 5px 8px; }
    .jmp-interchange-table thead th,
    .jmp-interchange-table tbody td { padding: 8px 12px; font-size: 13px; }
    /* 三栏→两栏: 左列和右列堆叠到底部 */
    .elementor-27442 .elementor-element-sec_main > .elementor-container > .elementor-column:nth-child(1),
    #sec_main .elementor-column:nth-child(1) { width: 50% !important; }
    .elementor-27442 .elementor-element-sec_main > .elementor-container > .elementor-column:nth-child(2),
    #sec_main .elementor-column:nth-child(2) { width: 50% !important; }
    .elementor-27442 .elementor-element-sec_main > .elementor-container > .elementor-column:nth-child(3),
    #sec_main .elementor-column:nth-child(3) { width: 100% !important; }
}

@media (max-width: 768px) {
    .product_title.entry-title { font-size: 22px !important; }
    .jmp-related-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .jmp-cta-card { padding: 14px; }
    .jmp-cta-btn { padding: 7px 20px; font-size: 13px; }
    .jmp-section-title { font-size: 18px; }
    .jmp-interchange-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .jmp-downloads { flex-direction: row; flex-wrap: wrap; }
    /* 全部单列 */
    .elementor-27442 .elementor-element-sec_main > .elementor-container > .elementor-column:nth-child(1),
    #sec_main .elementor-column:nth-child(1),
    .elementor-27442 .elementor-element-sec_main > .elementor-container > .elementor-column:nth-child(2),
    #sec_main .elementor-column:nth-child(2),
    .elementor-27442 .elementor-element-sec_main > .elementor-container > .elementor-column:nth-child(3),
    #sec_main .elementor-column:nth-child(3) { width: 100% !important; }
}

@media (max-width: 480px) {
    .product_title.entry-title { font-size: 20px !important; }
    .jmp-breadcrumb { font-size: 11px; padding: 8px 0; }
    .jmp-related-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .jmp-cta-card { padding: 12px; margin-top: 10px; }
    .jmp-cta-card h3 { font-size: 14px !important; }
    .jmp-cta-card p { font-size: 12px !important; }
    .jmp-cta-btn { padding: 6px 16px; font-size: 12px; width: 100%; text-align: center; box-sizing: border-box; }
    .jmp-section-title { font-size: 16px; margin-bottom: 10px; padding-bottom: 8px; }
    .jmp-shipping-info { font-size: 12px; padding: 8px 10px; }
    .jmp-spec-table td { padding: 4px 8px; font-size: 12px; }
    .jmp-spec-section-title { font-size: 12px; padding: 6px 10px; }
    .jmp-download-btn { padding: 7px 14px; font-size: 12px; }
}

@media (max-width: 375px) {
    .product_title.entry-title { font-size: 18px !important; }
    .jmp-related-grid { gap: 8px; }
    .jmp-related-thumb { padding: 10px; }
    .jmp-related-name { font-size: 11px; padding: 8px; }
    .jmp-interchange-brand-cell, .jmp-interchange-model-cell { font-size: 11px; }
}
