/* =============================================================
   OPM Category Landing — 前台 CSS
   ============================================================= */

/* ───────────────────────────────────────────────
   0. CSS 變數
   ─────────────────────────────────────────────── */
:root {
    --opm-primary:      #036EB8;
    --opm-primary-dark: #025a96;
    --opm-text:         #222;
    --opm-text-muted:   #666;
    --opm-border:       #ddd;
    --opm-bg-alt:       #f7f7f7;
    --opm-radius:       4px;
    --opm-transition:   0.2s ease;
    --opm-container:    1200px;
}

/* ───────────────────────────────────────────────
   1. 容器
   ─────────────────────────────────────────────── */
.opm-landing {
    color: var(--opm-text);
    font-size: 15px;
    line-height: 1.6;
}

.opm-compare-page .opm-container{
    max-width: 1600px; 
}

.opm-container {
    max-width: var(--opm-container);
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* ───────────────────────────────────────────────
   2. Hero Section
   ─────────────────────────────────────────────── */
.opm-hero {
    position: relative;
    min-height: 320px;
    background-color: #fff;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 60px 0;
}

.opm-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.opm-hero__inner {
    position: relative;
    z-index: 1;
    max-width: var(--opm-container);
    margin: 0 auto;
    padding: 0 16px;
    color: #fff;
}

.opm-hero__title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin-bottom: 12px;
    line-height: 1.2;
    color: #fff;
}

.opm-hero__subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
}

.opm-hero__overview {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.opm-hero__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.opm-link {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity var(--opm-transition);
}
.opm-link:hover { opacity: 0.85; text-decoration: none; }

.opm-link--line      { background: #06c755; color: #fff; }
.opm-link--wechat    { background: #09b83e; color: #fff; }
.opm-link--whatsapp  { background: #25d366; color: #fff; }
.opm-link--zoom      { background: #2d8cff; color: #fff; }

/* ───────────────────────────────────────────────
   3. Related Products
   ─────────────────────────────────────────────── */
.opm-related {
    padding: 32px 0;
    background: var(--opm-bg-alt);
    border-bottom: 1px solid var(--opm-border);
}

.opm-related__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.opm-related__item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--opm-text);
    font-size: 0.9rem;
    transition: color var(--opm-transition);
}
.opm-related__item a:hover { color: var(--opm-primary); }

.opm-related__img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid var(--opm-border);
    border-radius: var(--opm-radius);
    background: #fff;
}

/* ───────────────────────────────────────────────
   4. Tabs
   ─────────────────────────────────────────────── */
.opm-tabs-section {
    padding: 40px 0 0;
}

.opm-tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid var(--opm-border);
    margin-bottom: 0;
}

.opm-tabs__btn {
    padding: 10px 22px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--opm-radius) var(--opm-radius) 0 0;
    background: var(--opm-bg-alt);
    color: var(--opm-text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    transition: background var(--opm-transition), color var(--opm-transition);
}
.opm-tabs__btn:hover {
    background: var(--opm-primary);
    color: #fff;
}
.opm-tabs__btn.is-active {
    background: var(--opm-primary);
    color: #fff;
    border-color: var(--opm-primary);
    font-weight: 600;
    position: relative;
    top: 1px;
}

.opm-tabs__panel {
    padding: 24px 0;
    display: none;
}
.opm-tabs__panel.is-active {
    display: block;
}

/* ───────────────────────────────────────────────
   5. Product Section
   ─────────────────────────────────────────────── */
.opm-section {
    padding: 56px 0;
    border-bottom: 1px solid var(--opm-border);
}
.opm-section:last-of-type { border-bottom: none; }

.opm-section__header { margin-bottom: 24px; }

/* Title row: title + separator line */
.opm-section__title-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.opm-section__title {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 700;
    margin: 0;
    color: var(--opm-primary);
    white-space: nowrap;
    flex-shrink: 0;
    padding-left: 14px;
    border-left: 4px solid var(--opm-primary);
    line-height: 1.3;
}
.opm-section__title-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--opm-primary), var(--opm-border) 40%, var(--opm-border));
    display: block;
    min-width: 40px;
}

/* Three-column body: left img | text | right img */
.opm-section__body {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    margin-bottom: 24px;
}
.opm-section__body-col--text {
    flex: 1;
    min-width: 0;
}
.opm-section__body-col--img {
    flex: 0 0 auto;
    max-width: 240px;
}
.opm-section__body-col--img .opm-section__img {
    max-width: 100%;
    height: auto;
}

.opm-section__subtitle {
    font-size: 1rem;
    color: var(--opm-text-muted);
    margin-bottom: 8px;
}

.opm-section__bullets {
    padding-left: 20px;
    margin-bottom: 20px;
}
.opm-section__bullets li {
    margin-bottom: 4px;
}

.opm-section__desc {
    max-width: 760px;
    margin-bottom: 24px;
    color: var(--opm-text-muted);
}

/* Images */
.opm-section__images {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.opm-section__img {
    max-width: 100%;
    height: auto;
    border-radius: var(--opm-radius);
    cursor: zoom-in;
    transition: opacity var(--opm-transition);
}
.opm-section__img:hover { opacity: 0.88; }

/* Video */
.opm-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--opm-radius);
    margin-bottom: 24px;
    background: #000;
}
.opm-video-wrap iframe,
.opm-video-wrap video,
.opm-video-wrap object,
.opm-video-wrap embed {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Chart HTML */
.opm-section__chart {
    margin-bottom: 24px;
    overflow-x: auto;
}

/* ───────────────────────────────────────────────
   6. Product Table
   ─────────────────────────────────────────────── */



/* Sort header */
.opm-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.opm-sortable:hover {
    background: var(--opm-primary-dark);
}
.opm-sort-icon {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    margin-left: 4px;
    gap: 1px;
    opacity: 0.5;
}
.opm-sort-icon::before,
.opm-sort-icon::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
}
.opm-sort-icon::before {
    border-bottom: 4px solid #fff;
}
.opm-sort-icon::after {
    border-top: 4px solid #fff;
}
.opm-sort-icon.sort-asc { opacity: 0.9; }
.opm-sort-icon.sort-asc::after { opacity: 0.3; }
.opm-sort-icon.sort-desc { opacity: 0.9; }
.opm-sort-icon.sort-desc::before { opacity: 0.3; }

/* Video section */
.opm-video-section {
    padding: 32px 0;
}

.opm-table-wrap {
    overflow-x: auto;
    margin-top: 24px;
}

.opm-col-compare          { width: 32px; text-align: center; }
.opm-unavailable          { color: #999; font-size: .85em; }

.opm-table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
}

.opm-table thead tr {
    background: var(--opm-primary);
    color: #fff;
}

.opm-table th,
.opm-table td {
    padding: 9px 12px;
    border: 1px solid var(--opm-border);
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.opm-table th {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Zebra rows */
.opm-table tbody tr.opm-table__row:nth-child(odd) { background: #fafafa; }
.opm-table tbody tr.opm-table__row:nth-child(even){ background: #fff; }
.opm-table tbody tr.opm-table__row:hover td { background: #f0f4ff; }

/* Expand row */
.opm-table__expand-row.is-hidden { display: none; }
.opm-table__expand-row td {
    padding: 0;
    background: #fff !important;
}
.opm-expand-inner {
    padding: 20px 24px;
    border-top: 2px solid var(--opm-primary);
}

/* Expand top: image left, info right */
.opm-expand-top {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    align-items: flex-start;
}
.opm-expand-top__img {
    flex: 0 0 120px;
}
.opm-expand-top__img img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 1px solid var(--opm-border);
    border-radius: var(--opm-radius);
    cursor: zoom-in;
}
.opm-expand-top__info {
    flex: 1;
    min-width: 0;
}
.opm-expand-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--opm-primary);
}
.opm-expand-intro {
    color: var(--opm-text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}
@media (max-width: 640px) {
    .opm-expand-top { flex-direction: column; }
    .opm-expand-top__img { flex: none; }
}
/* Parameter table (expand row — dual-column key-val) */
.opm-param-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #dde3ea;
    font-size: 0.85rem;
    margin: 12px 0;
}
.opm-param-table th,
.opm-param-table td {
    padding: 10px 16px;
    border: 1px solid #dde3ea;
    word-break: break-word;
    text-align: left;
    vertical-align: top;
}
.opm-param-table--dual th {
    background: #f5f7fa;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    width: 15%;
}
.opm-param-table--dual td {
    color: #444;
    width: 35%;
}
@media (max-width: 640px) {
    .opm-param-table--dual th,
    .opm-param-table--dual td {
        display: block;
        width: 100%;
    }
    .opm-param-table--dual tr {
        display: block;
        border-bottom: 2px solid #dde3ea;
    }
}

/* Download buttons */
.opm-expand-downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.opm-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: var(--opm-radius);
    border: 2px solid var(--opm-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--opm-transition);
    background: #fff;
    color: var(--opm-text);
}
.opm-dl-btn:hover { background: var(--opm-primary); color: #fff; text-decoration: none; }
.opm-dl-btn .opm-dl-label { font-weight: 700; }
.opm-dl-btn .opm-dl-links { margin-left: 4px; }
.opm-dl-btn .opm-dl-links a {
    color: var(--opm-primary);
    text-decoration: none;
    font-weight: 600;
}
.opm-dl-btn .opm-dl-links a:hover { text-decoration: underline; }
.opm-dl-btn:hover .opm-dl-links a { color: #fff; }
.opm-dl-btn--pdf-preview  { background: #036EB8; }
.opm-dl-btn--pdf-download { background: #025a96; }
.opm-dl-btn--step-preview { background: #2980b9; }
.opm-dl-btn--step-download{ background: #1f618d; }

/* Combo-buy block (expand row — horizontal cards) */
.opm-combo-buy {
    margin: 16px 0;
}
.opm-combo-buy__title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--opm-primary);
}
.opm-combo-buy__body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.opm-combo-buy__cards {
    display: flex;
    align-items: flex-start;
    gap: 0;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 4px;
}
.opm-combo-buy__plus {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 300;
    color: #999;
    padding: 0 8px;
    flex-shrink: 0;
    align-self: center;
}
.opm-combo-buy__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 160px;
    min-width: 160px;
    padding: 10px 8px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color var(--opm-transition), box-shadow var(--opm-transition);
    text-align: center;
}
.opm-combo-buy__card:hover {
    border-color: #ddd;
}
.opm-combo-buy__card.is-selected {
    border-color: var(--opm-primary);
    box-shadow: 0 0 0 1px var(--opm-primary);
}
.opm-combo-buy__chk {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.opm-combo-buy__check-icon {
    display: none;
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background: var(--opm-primary);
    color: #fff;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 700;
    z-index: 1;
}
.opm-combo-buy__card.is-selected .opm-combo-buy__check-icon {
    display: block;
}
.opm-combo-buy__card-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 8px;
    background: #fff;
}
.opm-combo-buy__card-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.opm-combo-buy__card-sku {
    font-size: 0.75rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 2px;
}
.opm-combo-buy__card-price {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--opm-primary);
}
.opm-combo-buy__summary-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 140px;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fafafa;
    flex-shrink: 0;
    text-align: center;
}
.opm-combo-buy__summary-count {
    font-size: 0.82rem;
    color: #555;
}
.opm-combo-buy__summary-label {
    font-size: 0.82rem;
    color: #555;
}
.opm-combo-buy__summary-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--opm-primary);
}
.opm-combo-buy__add-cart {
    display: inline-block;
    background: var(--opm-primary)!important;
    border: 1px solid var(--opm-primary)!important;
    color: #fff!important;
    border: 0!important;
    padding: 8px 18px!important;
    border-radius: var(--opm-radius)!important;
    font-size: 0.85rem!important;
    font-weight: 600!important;
    cursor: pointer!important;
    transition: opacity var(--opm-transition)!important;
    margin-top: 4px!important;
    white-space: nowrap!important;
}
.opm-combo-buy__add-cart:hover { opacity: 0.85!important; }
.opm-combo-buy__add-cart:disabled { opacity: 0.4!important; cursor: default!important; }
@media (max-width: 640px) {
    .opm-combo-buy__body { flex-direction: column; }
    .opm-combo-buy__summary-box { flex-direction: row; flex-wrap: wrap; width: 100%; justify-content: center; }
}

/* Expand button */
.opm-expand-btn {
    background: none !important;
    border: 1px solid var(--opm-primary) !important;
    border-radius: var(--opm-radius) !important;
    padding: 2px 6px !important;
    cursor: pointer;
    color: var(--opm-primary) !important;
    font-size: 0.65rem !important;
    transition: background var(--opm-transition), color var(--opm-transition);
    line-height: 1;
}
.opm-expand-btn:hover { background: var(--opm-primary) !important; color: #fff !important; }

/* Add-to-cart button */
button.opm-atc-btn,
a.opm-atc-btn {
    white-space: nowrap !important;
    font-size: 0.82rem !important;
    padding: 5px 12px !important;
    background: var(--opm-primary) !important;
    background-color: var(--opm-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--opm-radius) !important;
    cursor: pointer !important;
    transition: background var(--opm-transition) !important;
}
button.opm-atc-btn:hover,
a.opm-atc-btn:hover       { background: var(--opm-primary-dark) !important; background-color: var(--opm-primary-dark) !important; color: #fff !important; }
button.opm-atc-btn:focus,
a.opm-atc-btn:focus        { background: var(--opm-primary-dark) !important; background-color: var(--opm-primary-dark) !important; color: #fff !important; }
button.opm-atc-btn.is-added,
a.opm-atc-btn.is-added    { background: #27ae60 !important; background-color: #27ae60 !important; }
button.opm-atc-btn:disabled,
a.opm-atc-btn:disabled     { opacity: 0.65; cursor: not-allowed; }

/* CF7 submit button inside OPM tabs */
.opm-section input.wpcf7-submit,
.opm-tabs__panel input.wpcf7-submit {
    background: var(--opm-primary) !important;
    background-color: var(--opm-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--opm-radius) !important;
    padding: 8px 24px !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    transition: background var(--opm-transition) !important;
}
.opm-section input.wpcf7-submit:hover,
.opm-section input.wpcf7-submit:focus,
.opm-tabs__panel input.wpcf7-submit:hover,
.opm-tabs__panel input.wpcf7-submit:focus {
    background: var(--opm-primary-dark) !important;
    background-color: var(--opm-primary-dark) !important;
    color: #fff !important;
}

/* Qty input */
.opm-col-qty { 
    width: 100px !important;
}
.opm-qty-input {
    width: 42px;
    text-align: center;
    padding: 2px 1px;
    border: 1px solid var(--opm-border);
    border-radius: var(--opm-radius);
    font-size: 0.82rem;
    -moz-appearance: textfield;
}
.opm-qty-input::-webkit-inner-spin-button,
.opm-qty-input::-webkit-outer-spin-button {
    opacity: 1;
    height: 20px;
}

/* Compare checkbox */
.opm-compare-chk {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--opm-primary);
}

/* Column filter dropdown */
.opm-col-filter-wrap {
    position: relative;
    display: inline-block;
    margin-left: 4px;
    vertical-align: middle;
}
button.opm-col-filter-btn {
    background: rgba(255,255,255,0.15) !important;
    background-color: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    border-radius: 3px !important;
    color: #fff !important;
    cursor: pointer !important;
    font-size: 0.5rem !important;
    padding: 1px 4px !important;
    vertical-align: middle;
    line-height: 1;
}
button.opm-col-filter-btn:hover,
button.opm-col-filter-btn:focus { background: rgba(255,255,255,0.3) !important; background-color: rgba(255,255,255,0.3) !important; color: #fff !important; }
.opm-col-filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--opm-border);
    border-radius: var(--opm-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 100;
    padding: 6px 0;
    font-size: 0.82rem;
    color: var(--opm-text);
}
.opm-col-filter-dropdown.is-open { display: block; }
.opm-col-filter-dropdown label {
    display: block;
    padding: 4px 12px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 400;
}
.opm-col-filter-dropdown label:hover { background: #f0f4ff; }
.opm-col-filter-dropdown input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--opm-primary);
}
.opm-col-filter-clear {
    display: block;
    width: calc(100% - 16px);
    margin: 4px 8px 2px;
    padding: 4px 0;
    border: none;
    background: none;
    color: var(--opm-primary);
    font-size: 0.8rem;
    cursor: pointer;
    text-align: center;
}
.opm-col-filter-clear:hover { text-decoration: underline; }

/* ───────────────────────────────────────────────
   7. Compare Floating Sidebar
   ─────────────────────────────────────────────── */
.opm-compare-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    max-height: 70vh;
    background: #fff;
    border: 1px solid var(--opm-border);
    border-right: none;
    border-radius: var(--opm-radius) 0 0 var(--opm-radius);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 9990;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.opm-compare-sidebar.is-hidden { display: none; }

.opm-compare-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--opm-primary);
    color: #fff;
}
.opm-compare-sidebar__title { font-weight: 600; font-size: 0.95rem; }
.opm-compare-sidebar__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.opm-compare-sidebar__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.opm-compare-sidebar__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid #f0f0f0;
}
.opm-compare-sidebar__item:last-child { border-bottom: none; }

.opm-compare-sidebar__thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border: 1px solid var(--opm-border);
    border-radius: var(--opm-radius);
    flex-shrink: 0;
}

.opm-compare-sidebar__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.opm-compare-sidebar__name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.opm-compare-sidebar__sku {
    font-size: 0.72rem;
    color: var(--opm-text-muted);
}

.opm-compare-sidebar__remove {
    background: none;
    border: none;
    color: #999;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}
.opm-compare-sidebar__remove:hover { color: var(--opm-primary); }

.opm-compare-sidebar__actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--opm-border);
    background: #fafafa;
}

.opm-compare-sidebar__btn {
    flex: 1;
    padding: 7px 0;
    border: none;
    border-radius: var(--opm-radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity var(--opm-transition);
}
.opm-compare-sidebar__btn:hover { opacity: 0.85; }
.opm-compare-sidebar__btn--clear {
    background: #eee;
    color: var(--opm-text);
}
.opm-compare-sidebar__btn--go {
    background: var(--opm-primary);
    color: #fff;
}
.opm-compare-sidebar__btn--go:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ───────────────────────────────────────────────
   7b. Compare Page (/compare/)
   ─────────────────────────────────────────────── */
.opm-compare-page {
    padding: 40px 0 60px;
}
.opm-compare-page__title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    margin-bottom: 24px;
}
.opm-compare-page__empty {
    color: var(--opm-text-muted);
    font-size: 1rem;
    margin-bottom: 16px;
}
/* Search bar (inside label-col) */
.opm-compare-page__search-bar {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 10px;
}
.opm-compare-page__search-input {
    padding: 4px 8px !important;
    border: 1px solid var(--opm-border) !important;
    border-radius: var(--opm-radius) !important;
    font-size: 0.82rem !important;
    width: 120px !important;
    background: #fff !important;
    color: var(--opm-text) !important;
}
.opm-compare-page__search-btn {
    padding: 4px 12px !important;
    background: var(--opm-radius) !important;
    background-color: var(--opm-radius) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--opm-radius) !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: background var(--opm-transition) !important;
}
.opm-compare-page__search-btn:hover { background: var(--opm-radius) !important; }
.opm-compare-page__search-btn:disabled { opacity: 0.6 !important; cursor: not-allowed !important; }
/* Filter toggle (show all / show checked) */
.opm-compare-page__filter-toggle {
    font-size: 0.85rem;
}
.opm-compare-page__toggle-link {
    color: var(--opm-primary);
    text-decoration: none;
    cursor: pointer;
    font-weight: 400;
}
.opm-compare-page__toggle-link.is-active {
    font-weight: 700;
    text-decoration: underline;
}
.opm-compare-page__toggle-link:hover {
    text-decoration: underline;
}
.opm-compare-page__toggle-sep {
    color: var(--opm-text-muted);
    margin: 0 2px;
}
/* Category label */
.opm-compare-page__cat {
    display: block;
    font-size: 0.78rem;
    color: var(--opm-text-muted);
    margin-bottom: 15px;
}
/* Spec row checkbox label */
.opm-compare-page__label-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}
.opm-compare-page__spec-chk {
    width: 15px;
    height: 15px;
    accent-color: var(--opm-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.opm-compare-page__wrap {
    overflow-x: auto;
}
.opm-compare-page__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
}
.opm-compare-page__table th,
.opm-compare-page__table td {
    padding: 10px 16px;
    border: 1px solid var(--opm-border);
    text-align: center;
    vertical-align: middle;
    min-width: 140px;
}
.opm-compare-page__label-col {
    width: 160px;
    min-width: 140px;
    text-align: left !important;
    background: #f5f7fa;
    vertical-align: bottom !important;
}
.opm-compare-page__label {
    text-align: left !important;
    font-weight: 600;
    background: #f5f7fa;
    color: #333;
}
.opm-compare-page__product-col {
    background: var(--opm-bg-alt);
    padding: 16px 12px !important;
}
.opm-compare-page__img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 1px solid var(--opm-border);
    border-radius: var(--opm-radius);
    display: block;
    margin: 0 auto 10px;
}
.opm-compare-page__actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}
/* .opm-compare-page__atc-btn {
    padding: 5px 14px !important;
    background: var(--opm-primary) !important;
    background-color: var(--opm-primary) !important;
    color: #fff !important;
    border: 1px solid var(--opm-primary) !important;
    border-radius: var(--opm-radius) !important;
    font-size: 0.82rem !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: background var(--opm-transition) !important;
    display: inline-block !important;
} */
.opm-compare-page__atc-btn:hover { background: var(--opm-primary-dark); border-color: var(--opm-primary-dark); }
.opm-compare-page__atc-btn.is-added { background: #27ae60; border-color: #27ae60; }
.opm-compare-page__atc-btn:disabled { opacity: 0.65; cursor: not-allowed; }
.opm-compare-page__remove {
    padding: 5px 14px;
    background: #eee;
    border: 1px solid var(--opm-border);
    border-radius: var(--opm-radius);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background var(--opm-transition);
}
.opm-compare-page__remove:hover { background: #ddd; }
.opm-compare-page__back {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.opm-compare-page__excel {
    padding: 7px 18px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: var(--opm-radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--opm-transition);
}
.opm-compare-page__excel:hover { background: #219a52; }
.opm-compare-page__table tbody tr:nth-child(even) td:not(.opm-compare-page__label) {
    background: var(--opm-bg-alt);
}

/* ───────────────────────────────────────────────
   8. Lightbox
   ─────────────────────────────────────────────── */
.opm-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
}
.opm-lightbox-overlay.is-hidden { display: none; }

.opm-lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.opm-lightbox-modal.is-hidden { display: none; }

#opm-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--opm-radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    position: relative;
    z-index: 10000;
}

.opm-lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 10001;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ───────────────────────────────────────────────
   9. RWD
   ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .opm-hero__title      { font-size: 1.7rem; }
    .opm-section__title   { font-size: 1.3rem; white-space: normal; }
    .opm-section__body    { flex-direction: column; }
    .opm-section__body-col--img { max-width: 100%; }
    .opm-table th,
    .opm-table td         { font-size: 0.8rem; padding: 7px 8px; }
    .opm-tabs__btn        { padding: 8px 14px; font-size: 0.85rem; }
    .opm-compare-sidebar  { width: 240px; }
    .opm-compare-page__table th,
    .opm-compare-page__table td { padding: 8px 10px; min-width: 110px; }

    /* ── 防止表格撐寬整頁 ── */
    .opm-landing,
    .opm-landing .opm-container,
    .opm-landing .opm-tabs__panel,
    .opm-landing .opm-section {
        max-width: 100%;
        overflow-x: hidden;
    }
    /* 讓 table-wrap 作為橫向捲動容器，表格本體保持不變形 */
    .opm-table-wrap {
        overflow-x: auto;
        max-width: 100%;
    }
    /* param-table 在 expand row 內也需要可左右滑動 */
    .opm-param-table-wrap,
    .opm-expand-inner > .opm-param-table {
        overflow-x: auto;
        max-width: 100%;
        display: block;
    }
    /* expand-inner 本身寬度鎖定，避免比 td 更寬 */
    .opm-expand-inner {
        max-width: 100%;
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .opm-hero { min-height: 240px; padding: 40px 0; }
    .opm-expand-inner { padding: 14px 12px; }
    .opm-expand-top__img img { width: 80px; height: 80px; }
    .opm-expand-top__img { flex: 0 0 80px; }
}

/* =====================================================
   關聯產品區塊 & 反饋表單區塊
   ===================================================== */
.opm-section__related {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}
.opm-section__related a {
    display: inline-block;
    margin: 0 12px 12px 0;
    text-align: center;
    color: inherit;
    text-decoration: none;
    vertical-align: top;
}
.opm-section__related a:hover { opacity: 0.8; }
.opm-section__related img {
    display: block;
    max-width: 120px;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* =====================================================
   Yoast SEO 麵包屑
   ===================================================== */
.opm-breadcrumb {
    background: rgba(0, 0, 0, 0.35);
    padding: 10px 0;
    font-size: 13px;
    margin-top: -4px;
}
.opm-breadcrumb .opm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.opm-breadcrumb span,
.opm-breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}
.opm-breadcrumb a:hover {
    color: #fff;
    text-decoration: underline;
}
.opm-breadcrumb .breadcrumb_last {
    color: rgba(255, 255, 255, 0.6);
}

/* ───────────────────────────────────────────────
   Tabs + Related sidebar layout (inside tabs section)
   ─────────────────────────────────────────────── */
.opm-tabs-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.opm-tabs-layout__main {
    flex: 1;
    min-width: 0;
}
.opm-tabs-layout__sidebar {
    flex: 0 0 220px;
    position: sticky;
    top: 160px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

/* Related categories sidebar */
.opm-related-cats {
    border: 1px solid var(--opm-border);
    border-radius: var(--opm-radius);
    background: #fff;
    padding: 16px;
}
.opm-related-cats__title {
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--opm-primary);
    color: var(--opm-text);
}
.opm-related-cats__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.opm-related-cats__item {
    margin-bottom: 14px;
}
.opm-related-cats__item:last-child {
    margin-bottom: 0;
}
.opm-related-cats__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--opm-text);
    transition: color var(--opm-transition);
}
.opm-related-cats__link:hover {
    color: var(--opm-primary);
}
.opm-related-cats__img {
    width: 120px;
    height: 90px;
    object-fit: contain;
    border: 1px solid var(--opm-border);
    border-radius: var(--opm-radius);
    margin-bottom: 6px;
    background: #fafafa;
}
.opm-related-cats__name {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.opm-section__body-col.opm-section__body-col--img {
    width: 25%;
}

.opm-section__body-col.opm-section__body-col--text {
    width: 50%;
}

/* Responsive: collapse tabs layout on small screens */
@media (max-width: 960px) {
    .opm-tabs-layout {
        flex-direction: column;
    }
    .opm-tabs-layout__sidebar {
        flex: none;
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    .opm-related-cats__list {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }
    .opm-related-cats__item {
        margin-bottom: 0;
        flex: 0 0 calc(33.33% - 8px);
    }
}
