/* Shared product responsive overrides across all product pages */
:root {
    --product-max: 1200px;
    --product-gap: 48px;
}

.product-layout {
    max-width: var(--product-max);
    padding: 24px 20px;
    margin: 0 auto;
}

/* Layout grid for photo + text/panel */
.panel-block {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(340px, 520px);
    gap: var(--product-gap);
    align-items: center;
    padding: 32px 0;
}

.panel-diagram {
    padding: 24px;
    border-radius: 12px;
    background: #f5f7fa;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.panel-image {
    width: 100%;
    max-width: 620px;
    height: auto;
    margin: 0 auto;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
}

.panel-col-left,
.panel-col-right {
    min-height: 0;
    gap: 12px;
}

.panel-label-row,
.panel-side-row {
    gap: 12px;
}

/* Info panel positioning */
.info-panel {
    max-width: 320px;
}

/* Tab + spec table */
.tabs {
    flex-wrap: wrap;
    gap: 16px;
}

.tab {
    min-width: 180px;
    text-align: center;
}

.spec-table table {
    width: 100%;
}

.accessory-table {
    justify-content: center;
}

/* Hero/product main photo */
.product-photo.only-photo {
    justify-content: center;
}

.photo-title-tag {
    left: 20px;
}

/* Hotspot labels: keep within image bounds and visible on all products */
.image-with-hotspots {
    position: relative;
    display: inline-block;
}

.hotspot-text-label {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 20;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 4px;
    padding: 4px 8px;
    color: #111;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

    .hotspot-text-label.left,
    .hotspot-text-label.right {
        transform: translate(-50%, -50%);
    }

/* Responsive breakpoints - aligned with main.css */
@media (max-width: 960px) {
    .product-layout {
        padding: 20px 16px;
    }

    .panel-block {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px 0;
    }

    .panel-diagram {
        padding: 20px 16px;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }

    .panel-col-left,
    .panel-col-right {
        min-height: auto;
    }

    .panel-image {
        max-width: 520px;
    }

    .panel-label-row,
    .panel-side-row {
        transform: none !important;
        justify-content: flex-start;
        margin: 8px 0;
    }

        .panel-label-row .panel-line,
        .panel-side-row .panel-line-long {
            display: none !important;
        }

    .tabs {
        flex-wrap: wrap;
        gap: 12px;
    }

    .tab {
        flex: 1 1 calc(50% - 12px);
        min-width: auto;
    }
}

@media (max-width: 768px) {
    :root {
        --product-gap: 20px;
    }

    .product-layout {
        padding: 16px 12px;
    }

    .panel-block {
        gap: 16px;
        padding: 16px 0;
    }

    .panel-diagram {
        padding: 16px;
    }

    .panel-image {
        max-width: 100%;
    }

    .panel-image-wrap {
        padding: 12px;
    }

    .photo-title-tag {
        top: -12px;
        left: 16px;
        font-size: 1rem;
        padding: 6px 12px;
    }

    .info-panel {
        position: fixed;
        left: 50%;
        bottom: 12px;
        top: auto;
        transform: translateX(-50%);
        width: 90vw;
        max-width: 300px;
    }

    .tabs {
        gap: 8px;
    }

    .tab {
        flex: 1 1 calc(50% - 8px);
    }

    .spec-table table {
        font-size: 13px;
    }

    .spec-table th,
    .spec-table td {
        padding: 8px 12px;
    }

    .content-image {
        max-width: 100%;
    }

    .content-text {
        font-size: 14px;
        padding: 14px;
    }

        .content-text p {
            margin: 8px 0;
        }
}

@media (max-width: 540px) {
    .product-layout {
        padding: 12px 8px;
    }

    .panel-block {
        gap: 12px;
        padding: 12px 0;
    }

    .panel-diagram {
        padding: 12px;
    }

    .panel-image {
        max-width: 100%;
    }

    /* （還原）不顯示列表，不隱藏漂浮標籤 */

    /* 限制主圖在小螢幕等比縮小並置中 */
    .image-with-hotspots {
        width: 85vw;
        max-width: 320px;
        margin: 0 auto;
    }

        .image-with-hotspots .main-photo {
            width: 100%;
            height: auto;
        }

    /* 手機標點文字縮小並允許換行，避免超出畫面 */
    .hotspot-text-label {
        font-size: 10px;
        line-height: 1.3;
        max-width: 120px;
        white-space: normal;
        text-align: center;
        pointer-events: none;
        cursor: default;
    }

    .hotspot-label-btn,
    .hotspot-text-label {
        pointer-events: none !important;
    }

    .photo-title-tag {
        top: -10px;
        left: 12px;
        font-size: 0.9rem;
        padding: 4px 8px;
    }

    .tabs {
        gap: 6px;
    }

    .tab {
        flex: 1 1 100%;
        padding: 10px 12px;
        font-size: 13px;
    }

    .accessory-item {
        width: 140px;
    }

    .content-text {
        font-size: 13px;
        padding: 12px;
    }

    .panel-desc {
        padding: 12px;
        font-size: 12px;
    }
}

/* ===== 面板標籤（Panel Labels）===== */
.panel-abs-label {
    position: absolute;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 4px;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

.panel-abs-text {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    background: rgba(255,255,255,0.85);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    position: relative;
    z-index: 20;
    line-height: 1.3;
}

.panel-abs-line {
    display: inline-block;
    width: 24px;
    height: 1.5px;
    background: #333;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.panel-abs-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #111;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

/* 手機版條列式清單：桌機預設隱藏 */
.panel-abs-mobile-list {
    display: none;
}

/* 共用樣式（不分裝置，先定義好顏色） */
.panel-abs-mobile-list {
    margin-top: 12px;
    padding: 12px 16px;
    background: #f0f4f8;
    border-radius: 8px;
}

.panel-abs-mobile-item {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #cbd5e0;
    font-size: 13px;
    color: #1a202c;
}

    .panel-abs-mobile-item:last-child {
        border-bottom: none;
    }

.panel-abs-mobile-letter {
    font-weight: 700;
    color: #2b6cb0;
    min-width: 20px;
    font-size: 14px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    line-height: 1.4;
}

.panel-abs-mobile-text {
    color: #1a202c;
    line-height: 1.4;
}

/* 強制覆蓋三星/任何深色模式 */
@media (prefers-color-scheme: dark) {
    .panel-abs-mobile-list {
        background: #f0f4f8 !important;
    }

    .panel-abs-mobile-item {
        color: #1a202c !important;
        border-bottom-color: #cbd5e0 !important;
    }

    .panel-abs-mobile-letter {
        color: #2b6cb0 !important;
    }

    .panel-abs-mobile-text {
        color: #1a202c !important;
    }
}

/* 手機版（≤768px）：浮動標籤隱藏，條列式顯示 */
@media (max-width: 768px) {
    .panel-abs-label {
        display: none !important;
    }

    .panel-abs-mobile-list {
        display: block;
    }
}

/* 觸控裝置（三星瀏覽器等）額外保險 */
@media (hover: none) and (pointer: coarse) {
    .panel-abs-label {
        display: none !important;
    }

    .panel-abs-mobile-list {
        display: block;
    }
}

/* =========================================================
   ✅ 修正：iPhone XS 英文版相關產品區塊吃掉頁尾
   確保 related-section 有足夠 margin-bottom
========================================================= */
.related-section {
    margin-bottom: 48px !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

.related-grid {
    overflow: visible !important;
}

.site-footer {
    position: relative !important;
    z-index: 2 !important;
    clear: both !important;
}
