/* =========================================================
   COMPARE PAGE
========================================================= */

.compare-page .breadcrumb-bar {
    border-top: 1px solid #eef2f6;
    border-bottom: 1px solid #e5eaf0;
    background: #fff;
    padding: 12px 0;
}

.compare-page .breadcrumb-item a {
    text-decoration: none;
    color: var(--cs-blue);
}

.compare-page .breadcrumb-item.active {
    color: #445264;
}

.compare-main {
    padding: 1.5rem 0 3rem;
}

.compare-page-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #15417f;
    margin-bottom: 0.35rem;
}

.compare-subtitle {
    color: #5a6777;
    font-size: 1rem;
    margin-bottom: 1.75rem;
}

.compare-back-link {
    color: #15417f;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
}

/* ── Product header cards ── */
.compare-header-grid {
    display: grid;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.compare-manager {
    border: 1px solid #dbe3ee;
    background: #f8fbff;
    border-radius: 6px;
    margin: 0 0 1rem;
    padding: 0.8rem;
}

.compare-manager.has-selection {
    padding: 0.65rem 0.75rem 0.7rem;
}

.compare-category-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.8rem;
}

.compare-manager.has-selection .compare-category-picker {
    margin-bottom: 0.45rem;
}

.compare-category-btn {
    align-items: center;
    background: #fff;
    border: 1px solid #bdd0e6;
    border-radius: 4px;
    color: #15417f;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.86rem;
    font-weight: 900;
    justify-content: center;
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.compare-category-btn:hover,
.compare-category-btn:focus,
.compare-category-btn.is-active {
    background: #0f63c9;
    border-color: #0f63c9;
    color: #fff;
}

.compare-manager.has-selection .compare-category-btn {
    min-height: 34px;
    padding: 0.42rem 0.7rem;
}

.compare-manager-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.compare-manager.has-selection .compare-manager-selected {
    margin-bottom: 0.15rem;
}

.compare-selected-empty {
    color: #607086;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 0.35rem 0;
}

.compare-selected-chip {
    align-items: center;
    background: #fff;
    border: 1px solid #c9d9ed;
    border-radius: 999px;
    color: #15417f;
    display: inline-flex;
    font-weight: 900;
    gap: 0.45rem;
    padding: 0.38rem 0.75rem;
}

.compare-selected-chip:hover {
    border-color: #c0392b;
    color: #c0392b;
}

.compare-add-panel {
    border-top: 1px solid #dbe3ee;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.compare-manager.has-selection .compare-add-panel {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
}

.compare-add-summary {
    align-items: center;
    color: #061b38;
    cursor: pointer;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    list-style: none;
}

.compare-add-summary::-webkit-details-marker {
    display: none;
}

.compare-add-summary strong,
.compare-add-summary small {
    display: block;
}

.compare-add-summary strong {
    font-weight: 900;
}

.compare-add-summary small {
    color: #607086;
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

.compare-add-summary i {
    color: #15417f;
    transition: transform 0.15s ease;
}

.compare-add-panel[open] .compare-add-summary i {
    transform: rotate(180deg);
}

.compare-add-body {
    padding-top: 0.75rem;
}

.compare-manager.has-selection .compare-add-body {
    align-items: start;
    display: grid;
    gap: 0.7rem;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    padding-top: 0.6rem;
}

.compare-add-head {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    margin-bottom: 0.65rem;
}

.compare-manager.has-selection .compare-add-head {
    display: block;
    margin-bottom: 0;
}

.compare-add-head strong,
.compare-add-head span {
    display: block;
}

.compare-add-head strong {
    color: #061b38;
    font-weight: 900;
}

.compare-add-head span {
    color: #607086;
    font-size: 0.84rem;
    font-weight: 700;
}

.compare-search-wrap {
    position: relative;
}

.compare-search-wrap i {
    color: #15417f;
    left: 0.75rem;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.compare-search-wrap .form-control {
    border-color: #bfd0e6;
    font-weight: 700;
    min-height: 42px;
    padding-left: 2.25rem;
}

.compare-manager.has-selection .compare-search-wrap .form-control {
    min-height: 38px;
}

.compare-search-wrap .form-control:focus {
    border-color: #0f63c9;
    box-shadow: 0 0 0 0.18rem rgba(15, 99, 201, 0.14);
}

.compare-candidate-list {
    display: grid;
    gap: 0.4rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    max-height: 168px;
    overflow: auto;
    padding-right: 0.25rem;
}

.compare-manager.has-selection .compare-candidate-list {
    cursor: grab;
    display: flex;
    gap: 0.45rem;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 0.2rem;
    scrollbar-width: thin;
}

.compare-manager.has-selection .compare-candidate-list.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.compare-candidate-filter-empty[hidden] {
    display: none;
}

.compare-candidate {
    align-items: center;
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: 5px;
    color: #10233f;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    text-align: left;
}

.compare-manager.has-selection .compare-candidate {
    flex: 0 0 265px;
    gap: 0.55rem;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    padding: 0.35rem 0.45rem;
}

.compare-candidate:hover {
    border-color: #0f63c9;
    box-shadow: 0 2px 8px rgba(15, 99, 201, 0.12);
}

.compare-candidate img {
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    display: block;
    height: 58px;
    object-fit: contain;
    width: 76px;
}

.compare-manager.has-selection .compare-candidate img {
    height: 44px;
    width: 58px;
}

.compare-candidate span,
.compare-candidate em,
.compare-candidate small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compare-candidate strong {
    color: #15417f;
    display: block;
    font-size: 0.82rem;
}

.compare-candidate em {
    color: #10233f;
    font-style: normal;
    font-weight: 800;
}

.compare-candidate small {
    color: #52647a;
    font-weight: 800;
}

.compare-manager.has-selection .compare-candidate strong {
    font-size: 0.78rem;
}

.compare-manager.has-selection .compare-candidate em {
    font-size: 0.86rem;
    line-height: 1.15;
}

.compare-manager.has-selection .compare-candidate small {
    font-size: 0.8rem;
}

.compare-candidate i {
    color: #0f63c9;
    flex: 0 0 auto;
}

.compare-candidate[hidden] {
    display: none;
}

.compare-candidate-empty {
    color: #607086;
    font-size: 0.88rem;
    font-weight: 800;
}

.compare-header-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compare-header-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compare-product-card {
    background: #fff;
    border: 1px solid #e1e6ec;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.compare-card-remove {
    align-items: center;
    background: #fff;
    border: 1px solid #d8e3f0;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
    color: #6b7788;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    width: 34px;
    z-index: 2;
}

.compare-card-remove:hover {
    border-color: #c0392b;
    color: #c0392b;
}

.compare-product-img-wrap {
    background: #f7f9fb;
    border-bottom: 1px solid #e1e6ec;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-product-img-wrap img {
    max-height: 500px;
    width: 100%;
    object-fit: contain;
    display: block;
}

.compare-product-img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.compare-product-img-link:hover img {
    transform: scale(1.02);
}

.compare-product-body {
    padding: 1.1rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.compare-product-model {
    font-size: 0.82rem;
    color: #7a8a99;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 0.3rem;
}

.compare-product-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #15417f;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    min-height: 2.75em;
    overflow-wrap: anywhere;
}

.compare-product-name a {
    color: inherit;
    text-decoration: none;
}

.compare-product-name a:hover {
    color: var(--cs-blue);
}

.compare-product-price {
    font-size: 1.6rem;
    font-weight: 900;
    color: #15417f;
    margin-bottom: 0.4rem;
    line-height: 1;
}

.compare-product-shipping {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0d8a43;
    margin-bottom: 1rem;
}

.compare-product-shipping i {
    margin-right: 0.25rem;
}

.btn-compare-add-cart {
    background: linear-gradient(180deg, #0f63c9 0%, #0053b0 100%);
    color: #fff;
    border-radius: 2px;
    border: none;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0.7rem 1rem;
    width: 100%;
    margin-top: auto;
    text-align: center;
    text-decoration: none;
    display: block;
}

.btn-compare-add-cart:hover {
    color: #fff;
    background: var(--cs-blue-dark);
}

.btn-compare-details {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    color: #15417f;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
}

.btn-compare-details:hover {
    color: var(--cs-blue-dark);
}

.btn-compare-remove {
    align-items: center;
    background: #fff;
    border: 1px solid #d8e3f0;
    border-radius: 3px;
    color: #6b7788;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.35rem;
    justify-content: center;
    margin-top: 0.55rem;
    padding: 0.45rem 0.7rem;
    width: 100%;
}

.btn-compare-remove:hover {
    border-color: #c0392b;
    color: #c0392b;
}

/* ── Spec comparison table ── */
.compare-specs-wrap {
    border: 1px solid #e1e6ec;
    margin-top: 1.25rem;
}

.compare-specs-header {
    background: linear-gradient(180deg, #f9fafc 0%, #f1f4f8 100%);
    border-bottom: 1px solid #e1e6ec;
    padding: 0.85rem 1.25rem;
}

.compare-specs-header h2 {
    font-size: 1rem;
    font-weight: 800;
    text-transform: none;
    color: #15417f;
    margin: 0;
}

.compare-specs-table {
    display: grid;
}

.compare-specs-col-head {
    background: linear-gradient(180deg, #f9fafc 0%, #f1f4f8 100%);
    border-bottom: 2px solid #e1e6ec;
    display: contents;
}

.compare-specs-col-head > div {
    padding: 0.8rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 800;
    color: #15417f;
    text-align: center;
    border-right: 1px solid #e1e6ec;
    align-content: stretch;
}

.compare-specs-col-head > div:first-child {
    text-align: left;
    color: #445264;
    display: flex;
    align-items: center;
}

.compare-column-card {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto auto;
    justify-items: center;
    gap: 0.35rem;
    min-height: 0;
}

.compare-column-remove {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #d8e3f0;
    border-radius: 999px;
    background: #fff;
    color: #6b7788;
    font-size: 0.72rem;
}

.compare-column-remove:hover {
    border-color: #c0392b;
    color: #c0392b;
}

.compare-column-image-link {
    display: block;
    width: 100%;
    max-width: 260px;
    color: inherit;
    text-decoration: none;
}

.compare-column-image-link img {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
    object-position: center;
    border: 1px solid #dbe3ee;
    background: #fff;
}

.compare-column-model {
    color: #7a8a99;
    font-size: 0.72rem;
    font-weight: 900;
}

.compare-column-name {
    min-height: 2.45em;
    color: #15417f;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.compare-column-name a {
    color: inherit;
    text-decoration: none;
}

.compare-column-price {
    color: #061b38;
    font-size: 0.95rem;
    font-weight: 900;
}

.compare-column-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    width: 100%;
    max-width: 180px;
}

.compare-column-actions form {
    margin: 0;
}

.compare-column-actions .btn-compare-details,
.compare-column-actions .btn-compare-add-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin: 0;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
    line-height: 1.1;
}

.compare-column-actions .btn-compare-details {
    border: 1px solid #c9d9ed;
    border-radius: 2px;
    background: #fff;
}

.compare-spec-row {
    display: contents;
}

.compare-spec-row > div {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #eef2f6;
    border-right: 1px solid #e1e6ec;
    font-size: 0.97rem;
    color: #445264;
    display: flex;
    align-items: center;
}

.compare-spec-row > div:last-child {
    border-right: none;
}

.compare-spec-row:nth-child(even) > div {
    background: #fafbfc;
}

.compare-spec-label {
    font-weight: 700;
    color: #2d3a4d;
    font-size: 0.92rem;
}

.compare-spec-value {
    justify-content: center;
    font-weight: 600;
    text-align: center;
    display: block !important;
}

.compare-spec-value.is-na {
    color: #aab4bf;
    font-style: italic;
}

.compare-spec-value.is-best {
    color: #0d8a43;
    font-weight: 800;
}

/* ── No products fallback ── */
.compare-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #5a6777;
}

.compare-empty i {
    font-size: 3.5rem;
    color: #c5d0db;
    display: block;
    margin-bottom: 1rem;
}

.compare-empty p {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .compare-page-title {
        font-size: 2.2rem;
    }

    .compare-header-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compare-manager.has-selection .compare-add-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .compare-add-head {
        grid-template-columns: 1fr;
    }

    .compare-page-title {
        font-size: 1.9rem;
    }

    .compare-specs-wrap {
        overflow-x: auto;
    }

    .compare-specs-table {
        min-width: 900px;
    }
}

@media (max-width: 640px) {
    .compare-header-grid--2,
    .compare-header-grid--3 {
        grid-template-columns: 1fr;
    }

}

/* Mobile storefront polish for comparison tools */
@media (max-width: 767.98px) {
    .compare-main {
        padding: 1rem 0 2rem;
    }

    .compare-page .breadcrumb {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .compare-manager,
    .compare-product-card {
        padding: 0.85rem;
    }

    .compare-selected-chip {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .compare-search-wrap,
    .compare-search-wrap .form-control,
    .btn-compare-remove {
        width: 100%;
    }

    .compare-manager.has-selection .compare-candidate {
        flex-basis: 240px;
    }
}

@media (max-width: 575.98px) {
    .compare-page-title {
        font-size: 1.65rem;
        line-height: 1.15;
    }

    .compare-subtitle {
        font-size: 0.95rem;
    }
}
