/*=========================================================
    COMPARE PAGE — compare.css
    Flexbox-based layout. 1 label col + 4 product cols.
    Colors:
        Primary  : #4274D9
        Dark     : #293681
        Grey bg  : #F5F5F5 / #E4E7ED
=========================================================*/

/* ── Page section ────────────────────────────────────────── */
#compare-section {
    padding: 32px 0 60px;
    background: #f7f8fa;
    min-height: 60vh;
}

/* ── Toolbar ─────────────────────────────────────────────── */
.compare-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.compare-toolbar-info {
    font-size: 14px;
    color: #666;
}

.compare-toolbar-info strong {
    color: #293681;
    font-weight: 700;
}

.compare-clear-btn {
    background: transparent;
    border: 1.5px solid #e0e0e0;
    color: #999;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.compare-clear-btn:hover {
    border-color: #4274D9;
    color: #4274D9;
    background: rgba(66, 116, 217, 0.03);
}

.continue-shopping-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.15s;
}

.continue-shopping-link:hover {
    color: #4274D9;
    text-decoration: none;
}

/* ── Empty state ─────────────────────────────────────────── */
#compare-empty {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    text-align: center;
    padding: 80px 20px;
}

#compare-empty .compare-empty-icon {
    font-size: 56px;
    color: #ddd;
    margin-bottom: 20px;
}

#compare-empty h3 {
    font-size: 20px;
    color: #293681;
    margin-bottom: 10px;
    font-weight: 600;
}

#compare-empty p {
    color: #8D99AE;
    font-size: 14px;
    max-width: 380px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

#compare-empty .primary-btn {
    display: inline-block;
    background: #4274D9;
    color: #fff;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

#compare-empty .primary-btn:hover {
    background: #b5001e;
    color: #fff;
}

/* ── Notification toast ──────────────────────────────────── */
#compare-notification {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #293681;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

#compare-notification.show {
    display: block;
    animation: cvNotifIn 0.25s ease;
}

@keyframes cvNotifIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── "In compare" button state (on store cards) ──────────── */
.add-to-compare.comparing {
    color: #27ae60;
}

.add-to-compare.comparing i {
    color: #27ae60;
}

/*=========================================================
    COMPARE TABLE — Flexbox layout
    .cv-table-wrap
      .cv-header
        .cv-header__label
        .cv-header__col × 4
      .cv-section-header
      .cv-row
        .cv-row__label
        .cv-row__val × 4
=========================================================*/

/* ── Outer wrapper (horizontal scroll on small screens) ─── */
.cv-table-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.07);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Shared row layout ───────────────────────────────────── */
.cv-header,
.cv-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #eef0f4;
    min-width: 700px;
}

.cv-header:last-child,
.cv-row:last-child {
    border-bottom: none;
}

/* Label column — fixed width */
.cv-header__label,
.cv-row__label {
    flex: 0 0 150px;
    width: 150px;
    min-width: 150px;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    background: #f8f9fb;
    border-right: 1px solid #eef0f4;
    display: flex;
    align-items: center;
    word-break: break-word;
}

/* Product columns — equal width, take remaining space */
.cv-header__col,
.cv-row__val {
    flex: 1 1 0;
    min-width: 0;
    border-right: 1px solid #eef0f4;
    padding: 14px 16px;
    text-align: center;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    position: relative;
}

.cv-header__col:last-child,
.cv-row__val:last-child {
    border-right: none;
}

/* ── Header product card ─────────────────────────────────── */
.cv-header__col {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
}

.cv-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px 16px;
    width: 100%;
    text-align: center;
    position: relative;
}

/* Remove (×) button */
.cv-card__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #bbb;
    cursor: pointer;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    z-index: 1;
}

.cv-card__remove:hover {
    color: #4274D9;
    background: #dde5f5;
}

/* Product image */
.cv-card__img-wrap {
    display: block;
    width: 130px;
    height: 130px;
    margin: 0 auto 12px;
    flex-shrink: 0;
}

.cv-card__img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    background: #fafafa;
    display: block;
    transition: transform 0.2s;
}

.cv-card__img-wrap:hover .cv-card__img {
    transform: scale(1.04);
}

/* Product name — fixed height = 3 lines so all cards stay aligned */
.cv-card__name {
    font-size: 12px;
    font-weight: 700;
    color: #293681;
    line-height: 1.4;
    height: calc(12px * 1.4 * 3); /* 3 lines × font-size × line-height */
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    width: 100%;
}

.cv-card__name a {
    color: #293681;
    text-decoration: none;
}

.cv-card__name a:hover {
    color: #4274D9;
}

/* Price */
.cv-card__price-wrap {
    min-height: 46px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-bottom: 2px;
}

.cv-card__price {
    font-size: 17px;
    font-weight: 700;
    color: #D10024;
    margin-bottom: 2px;
}

.cv-card__price--unavailable {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    font-style: italic;
}

.cv-card__old-price {
    font-size: 12px;
    color: #aaa;
    text-decoration: line-through;
    margin-bottom: 8px;
    min-height: 16px;
}

.cv-card__old-price--hidden {
    visibility: hidden;
    text-decoration: none;
}

/* Add to cart button */
.cv-card__cart {
    margin-top: 10px;
    background: #4274D9;
    color: #fff;
    border: none;
    padding: 9px 14px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cv-card__cart:hover {
    background: #b5001e;
}

.cv-card__cart--disabled,
.cv-card__cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Empty slot */
.cv-card--empty {
    justify-content: center;
    min-height: 280px;
    color: #ccc;
    font-size: 13px;
    border: 2px dashed #e8eaed;
    border-radius: 8px;
    margin: 12px;
    width: calc(100% - 24px);
    gap: 10px;
}

.cv-card__empty-icon {
    font-size: 32px;
    color: #ddd;
}

/* ── Section header row ──────────────────────────────────── */
.cv-section-header {
    display: flex;
    align-items: center;
    min-width: 700px;
    background: #293681;
    padding: 10px 16px;
    border-bottom: none;
}

.cv-section-header span {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Value cell states ───────────────────────────────────── */
.cv-row__val--match {
    background: #f0fdf4;
    color: #27ae60;
    font-weight: 600;
}

.cv-row__val--diff {
    background: #fffbf0;
}

.cv-row__val--empty {
    background: #fafbfc;
}

/* N/A dash */
.cv-na {
    color: #d0d3da;
    font-size: 16px;
}

/* ── Inline badges ───────────────────────────────────────── */
.cv-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 6px;
    margin-bottom: 4px;
}

.cv-badge--in {
    background: #e8f8ee;
    color: #27ae60;
}

.cv-badge--out {
    background: #dde5f5;
    color: #4274D9;
}

/* ── Hover on rows ───────────────────────────────────────── */
.cv-row:hover .cv-row__label,
.cv-row:hover .cv-row__val:not(.cv-row__val--match):not(.cv-row__val--diff):not(.cv-row__val--empty) {
    background: #fafbfc;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 767px) {
    .cv-header__label,
    .cv-row__label {
        flex: 0 0 110px;
        width: 110px;
        min-width: 110px;
        font-size: 11px;
        padding: 10px 10px;
    }

    .cv-card__img-wrap,
    .cv-card__img {
        width: 90px;
        height: 90px;
    }

    .cv-card__price {
        font-size: 14px;
    }

    #compare-section {
        padding: 16px 0 40px;
    }
}
