/* Compare tray + page */
.compare-tray {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    background: #0f1f14;
    color: #fff;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
    transform: translateY(110%);
    transition: transform 0.28s ease;
    padding: 12px 16px;
}

.compare-tray.is-visible {
    transform: translateY(0);
}

.compare-tray-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.compare-tray-items {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
}

.compare-tray-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px 28px 6px 6px;
    min-width: 180px;
    max-width: 220px;
}

.compare-tray-card img,
.compare-tray-ph {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: #fff;
    flex-shrink: 0;
}

.compare-tray-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3ea12a;
    font-weight: 700;
    font-size: 12px;
}

.compare-tray-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.compare-tray-price {
    font-size: 11px;
    color: #9be07a;
}

.compare-tray-remove {
    position: absolute;
    top: 2px;
    right: 4px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}

.compare-tray-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.compare-tray-count {
    font-size: 13px;
    color: #cde8c0;
}

.compare-btn-clear {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    border-radius: 20px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
}

.compare-btn-go {
    background: #3ea12a;
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 13px;
}

.compare-btn-go.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.btn-compare {
    background: #fff;
    color: #03488e;
    border: 1.5px solid #03488e;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-compare:hover,
.btn-compare.is-active {
    background: #03488e;
    color: #fff;
}

.pd-actions .btn-compare {
    padding: 12px 18px;
}

/* Compare page */
.compare-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 16px 100px;
}

.compare-page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.compare-page-head h1 {
    margin: 0;
    color: #03488e;
    font-size: 26px;
}

.compare-table-wrap {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.compare-table th,
.compare-table td {
    border-bottom: 1px solid #e8eee6;
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.compare-table th {
    background: #f5fbf2;
    color: #03488e;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
}

.compare-table .attr-col {
    width: 180px;
    background: #f8fcf6;
    font-weight: 600;
    color: #334;
    position: sticky;
    left: 0;
    z-index: 2;
}

.compare-table thead .attr-col {
    z-index: 3;
}

.compare-prod-head {
    min-width: 180px;
}

.compare-prod-head img {
    width: 100%;
    max-width: 160px;
    height: 120px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 8px;
}

.compare-prod-head a {
    color: #03488e;
    text-decoration: none;
    font-weight: 700;
}

.compare-prod-head .price {
    color: #3ea12a;
    font-weight: 800;
    margin-top: 6px;
}

.compare-diff {
    background: #fff8e6 !important;
}

.compare-empty {
    background: #fff;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.compare-empty a {
    display: inline-block;
    margin-top: 12px;
    background: #3ea12a;
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .compare-tray-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .compare-tray-actions {
        justify-content: space-between;
    }
    .compare-tray-card {
        min-width: 150px;
    }
}
