.compare-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 12px 32px;
}

.compare-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 18px;
    flex-wrap: wrap;
}
.compare-head--sticky {
    position: sticky;
    top: 58px;
    z-index: 15;
    background: #131c29f0;
    backdrop-filter: blur(10px);
    padding: 8px 0 10px;
    border-bottom: 1px solid #ffffff12;
}

.compare-head h1 {
    font-size: 1.6rem;
    font-weight: 400;
}

.compare-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.compare-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.compare-tools--sticky {
    position: sticky;
    top: 130px;
    z-index: 14;
    background: #131c29e6;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #ffffff0e;
    padding-bottom: 10px;
}

.compare-stat {
    background: #1a2533;
    border: 1px solid #ffffff10;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #bcd0ea;
}

.compare-tools-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.compare-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    color: #c6d6ea;
    background: #1a2533;
    border: 1px solid #ffffff0f;
    border-radius: 999px;
    padding: 8px 12px;
}

.compare-switch input {
    accent-color: #4884ff;
}

.compare-sort {
    background: #1a2533;
    color: #eef2f6;
    border: 1px solid #ffffff14;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.8rem;
}

.cmp-btn {
    border: 1px solid #ffffff14;
    border-radius: 30px;
    background: #1a2533;
    color: #eef2f6;
    padding: 10px 14px;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cmp-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cmp-btn--primary {
    background: linear-gradient(135deg, #4884ff, #5b95ff);
    border-color: #4884ff;
}

.cmp-btn--ghost {
    background: transparent;
    border-color: #4884ff60;
    color: #a9c4ff;
}

.cmp-btn--danger {
    background: #2b1820;
    border-color: #ff6b7c55;
    color: #ff9dab;
}

.compare-empty {
    background: #1a2533;
    border: 1px solid #ffffff0e;
    border-radius: 22px;
    padding: 36px 22px;
    text-align: center;
}

.compare-empty i {
    font-size: 2rem;
    color: #4884ff;
    margin-bottom: 10px;
}

.compare-empty h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.compare-empty p {
    opacity: 0.72;
    max-width: 620px;
    margin: 0 auto 16px;
    font-size: 0.9rem;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.compare-card {
    position: relative;
    background: #1a2533;
    border: 1px solid #ffffff0e;
    border-radius: 18px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
    transition: border-color .2s ease, transform .2s ease;
}

.compare-card:hover {
    border-color: #4884ff45;
    transform: translateY(-1px);
}

.compare-card--best-price {
    border-color: #3acf6b66;
    box-shadow: inset 0 0 0 1px #3acf6b33;
}
.compare-card--worst-price {
    border-color: #ff7b8a55;
}
.compare-card--best-sales .compare-meta--sales b {
    color: #7fe59d;
}
.compare-card--worst-sales .compare-meta--sales b {
    color: #ff9dab;
}

.compare-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: #0f1722;
    color: #ff8fa0;
    width: 28px;
    height: 28px;
    border-radius: 14px;
    cursor: pointer;
}

.compare-image {
    aspect-ratio: 1;
    border-radius: 12px;
    background: #0f1722;
    border: 1px solid #ffffff12;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6a9cff;
    font-size: 1.8rem;
    text-decoration: none;
    overflow: hidden;
}

.compare-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare-name {
    color: #eef2f6;
    text-decoration: none;
    font-weight: 500;
    min-height: 42px;
}

.compare-price {
    font-size: 1.2rem;
    color: #6ea5ff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.compare-card--best-price .compare-price {
    color: #55d47f;
}

.compare-meta {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px;
    align-items: start;
    border-bottom: 1px solid #ffffff0a;
    padding-bottom: 6px;
}

.compare-meta span {
    opacity: 0.64;
    font-size: 0.76rem;
}

.compare-meta b {
    font-size: 0.8rem;
    font-weight: 500;
}
.compare-badge {
    display: none;
    font-size: 0.62rem;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid transparent;
}
.compare-badge--best {
    color: #7fe59d;
    border-color: #3acf6b66;
    background: #3acf6b14;
}
.compare-badge--worst {
    color: #ff9dab;
    border-color: #ff6b7c66;
    background: #ff6b7c14;
}
.compare-card--best-price [data-price-badge="best"],
.compare-card--worst-price [data-price-badge="worst"],
.compare-card--best-sales [data-sales-badge="best"],
.compare-card--worst-sales [data-sales-badge="worst"] {
    display: inline-flex;
}
.compare-meta.is-same b {
    opacity: 0.72;
}
.compare-meta.is-hidden-diff {
    display: none;
}

.compare-open {
    justify-content: center;
    margin-top: auto;
}

@media (max-width: 1100px) {
    .compare-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .compare-page {
        padding: 0 8px 22px;
    }
    .compare-head h1 {
        font-size: 1.3rem;
    }
    .compare-grid {
        grid-template-columns: 1fr;
    }
    .compare-tools {
        align-items: stretch;
    }
    .compare-head--sticky,
    .compare-tools--sticky {
        position: static;
        border-bottom: none;
        backdrop-filter: none;
        background: transparent;
        padding: 0;
    }
    .compare-tools-right {
        width: 100%;
    }
    .compare-sort {
        width: 100%;
    }
}
