.compare-section {
    padding: 1.5rem 0 3rem;
    background: #f8fafc;
    min-height: 400px;
}
.compare-section .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.compare-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.compare-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.compare-header h1 span {
    font-weight: 400;
    color: #94a3b8;
    font-size: 0.85rem;
}
.compare-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.compare-sticky-row td {
    background: #f8fafc !important;
}

.compare-fixed-bar {
    position: fixed;
    z-index: 999;
    background: #fff;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.compare-fixed-bar-inner {
    display: inline-block;
    min-width: 100%;
}
.compare-fixed-bar .compare-table {
    margin: 0;
    width: auto;
}
.compare-fixed-bar .compare-spec-label {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f8fafc;
}
.compare-fixed-bar .compare-spec-value {
    font-weight: 600;
    font-size: 0.8rem;
    padding: 8px 14px !important;
    white-space: nowrap;
}

.compare-table-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.06);
}
.compare-table-wrap::-webkit-scrollbar { height: 5px; }
.compare-table-wrap::-webkit-scrollbar-track { background: transparent; }
.compare-table-wrap::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    table-layout: auto;
}
.compare-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
}
.compare-table td {
    padding: 12px 18px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}
.compare-table tbody tr:last-child td {
    border-bottom: none;
}

.compare-label-col {
    width: 140px;
    min-width: 140px;
    text-align: right;
    font-weight: 600;
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: #fafbfc !important;
    position: sticky;
    left: 0;
    z-index: 3;
    border-right: 1px solid #e2e8f0;
}
.compare-spec-label {
    text-align: right;
    font-weight: 500;
    color: #64748b;
    font-size: 0.78rem;
    background: #fafbfc;
    position: sticky;
    left: 0;
    z-index: 3;
    border-right: 1px solid #e5e7eb;
    padding: 12px 18px !important;
}

.compare-product-col {
    min-width: 190px;
    background: #fff;
}

.compare-product-card {
    position: relative;
    padding: 16px 12px 12px;
    text-align: center;
}
.compare-product-img {
    display: block;
    width: 120px;
    height: 90px;
    margin: 0 auto 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: border-color 0.2s;
}
.compare-product-img:hover {
    border-color: #0077b6;
}
.compare-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}
.compare-product-info {
    text-align: center;
}
.compare-product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    text-decoration: none;
    word-break: break-word;
}
.compare-product-title:hover {
    color: #0077b6;
    text-decoration: underline;
}
.compare-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s;
    opacity: 0;
}
.compare-product-card:hover .compare-remove-btn {
    opacity: 1;
}
.compare-remove-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.compare-table tfoot td {
    padding: 12px 14px;
    border-top: 2px solid #e2e8f0;
    background: #fafbfc;
}
.compare-col-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.compare-col-quote {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 18px;
    border: 1px solid #0077b6;
    background: transparent;
    color: #0077b6;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.3;
    white-space: nowrap;
}
.compare-col-quote:hover {
    background: #0077b6;
    color: #fff;
}

.compare-table tbody tr:nth-child(odd) td {
    background: #fff;
}
.compare-table tbody tr:nth-child(even) td.compare-spec-value {
    background: #fafbfc;
}
.compare-spec-value {
    font-size: 0.84rem;
    color: #1e293b;
    line-height: 1.5;
    padding: 12px 18px !important;
}
.compare-na {
    color: #d1d5db;
    font-style: italic;
}

.compare-match {
    background: #f0fdf4 !important;
    color: #16a34a !important;
    font-weight: 600;
}
.compare-match-row .compare-spec-label {
    background: #f0fdf4;
    color: #16a34a;
}

.compare-empty {
    text-align: center;
    padding: 64px 20px 48px;
}
.compare-empty-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 16px;
}
.compare-empty h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}
.compare-empty > p {
    color: #64748b;
    font-size: 0.95rem;
    max-width: 480px;
    margin: 0 auto 24px;
    line-height: 1.6;
}
.compare-empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.compare-empty-steps {
    max-width: 520px;
    margin: 0 auto 28px;
    text-align: left;
}
.compare-step {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}
.compare-step:last-child { border-bottom: none; }
.compare-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0077b6;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.compare-step-text strong {
    display: block;
    font-size: 0.9rem;
    color: #0f172a;
    margin-bottom: 2px;
}
.compare-step-text p {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}
.compare-step-text em { font-style: normal; color: #0077b6; font-weight: 500; }

.compare-loading {
    text-align: center;
    padding: 48px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.ky-sc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 8px 15px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #1e293b;
    transition: all 0.2s;
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
    line-height: 1.4;
}
.ky-sc-btn:hover { background: #f1f5f9; border-color: #94a3b8; text-decoration: none; }
.ky-sc-btn.ky-sc-btn-primary { background: #f4971a; color: #fff; border-color: #f4971a; }
.ky-sc-btn.ky-sc-btn-primary:hover { background: #e0860e; border-color: #e0860e; }
.ky-sc-btn.ky-sc-btn-outline { border-color: #0077b6; color: #0077b6; background: transparent; }
.ky-sc-btn.ky-sc-btn-outline:hover { background: rgba(0,119,182,0.06); }
.ky-sc-btn i { font-size: 0.85em; }

.compare-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10001;
}
.compare-search-overlay.ky-open { display: block; }
.compare-search-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    max-width: 90vw;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.compare-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
}
.compare-search-header h3 { margin: 0; font-size: 1rem; color: #0f172a; }
.compare-search-close {
    background: none; border: none; font-size: 1.4rem;
    cursor: pointer; color: #94a3b8; padding: 0 4px; line-height: 1;
}
.compare-search-close:hover { color: #0f172a; }
.compare-search-body { padding: 14px 18px; overflow-y: auto; flex: 1; }
.compare-search-input {
    width: 100%; padding: 10px 14px; border: 1px solid #cbd5e1;
    border-radius: 8px; font-size: 0.9rem; outline: none; box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.compare-search-input:focus {
    border-color: #0077b6;
    box-shadow: 0 0 0 3px rgba(0,119,182,0.1);
}
.compare-search-results { margin-top: 12px; }
.compare-search-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: 8px; cursor: pointer; transition: background 0.15s;
    border: 1px solid transparent;
}
.compare-search-item:hover { background: #f0f9ff; border-color: #bae6fd; }
.compare-search-item img {
    width: 48px; height: 36px; object-fit: contain; border-radius: 4px;
    flex-shrink: 0; background: #f8fafc;
}
.compare-search-item-info { flex: 1; font-size: 0.83rem; line-height: 1.4; color: #475569; }
.compare-search-item-info strong { color: #0f172a; font-size: 0.85rem; }
.compare-search-item-info small { color: #94a3b8; }
.compare-search-item.already-added { opacity: 0.5; cursor: default; background: #f8fafc; }
.compare-search-added { font-size: 0.75rem; color: #16a34a; font-weight: 600; }
.compare-search-loading,
.compare-search-empty { text-align: center; padding: 24px; color: #94a3b8; font-size: 0.85rem; }

.compare-quick-add {
    max-width: 480px;
    margin: 0 auto 20px;
}
.compare-quick-add-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    text-align: center;
    box-sizing: border-box;
    transition: border-color 0.2s, border-style 0.2s;
}
.compare-quick-add-input:focus {
    border-color: #0077b6;
    border-style: solid;
}

@media (max-width: 767px) {
    .compare-section .container { padding: 0 0.25rem; }
    .compare-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .compare-header h1 { font-size: 1.05rem; }
    .compare-header-actions { width: 100%; }
    .compare-header-actions .ky-sc-btn { flex: 1; justify-content: center; font-size: 0.78rem; }
    .compare-label-col,
    .compare-spec-label { width: 80px; min-width: 80px; font-size: 0.66rem; padding: 9px 8px !important; }
    .compare-product-col { min-width: 140px; }
    .compare-product-card { padding: 12px 8px 10px; }
    .compare-product-img { width: 80px; height: 60px; margin-bottom: 6px; }
    .compare-product-title { font-size: 0.72rem; }
    .compare-spec-value { padding: 9px 10px !important; font-size: 0.76rem; }
    .compare-table td { padding: 9px 10px; }
    .compare-col-actions { flex-direction: column; }
    .compare-col-quote { width: 100%; justify-content: center; padding: 6px 10px; font-size: 0.7rem; }
    .compare-remove-btn { opacity: 1; width: 20px; height: 20px; font-size: 0.75rem; top: 4px; right: 4px; }
    .compare-sticky-row td { font-size: 0.72rem !important; }
    .compare-sticky-row .compare-spec-label { padding: 9px 8px !important; }
    .compare-sticky-row .compare-spec-value { padding: 9px 10px !important; }
    .compare-fixed-bar .compare-spec-value { font-size: 0.7rem; padding: 6px 8px !important; }
    .compare-fixed-bar .compare-spec-label { font-size: 0.62rem; padding: 6px 8px !important; width: 80px; min-width: 80px; }
    .compare-fixed-bar .compare-table td { padding: 6px 8px; }
    .compare-quick-add { max-width: 100%; }
}
