﻿/* ============================================
   Compare page — theme-matched
   Reuses tokens from checkout.css / cart.css
   ============================================ */
.cp-section { padding-top: 30px; padding-bottom: 60px; }

/* Page head */
.cp-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.cp-page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--ck-dark);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.cp-page-title i { color: var(--ck-primary); }

.cp-page-sub {
    margin: 6px 0 0;
    color: var(--ck-grey);
    font-size: 14px;
}

.cp-page-sub strong { color: var(--ck-primary); }

.cp-page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Card body padding tweak */
.cp-card-body { padding: 0; }

/* Empty state */
.cp-empty {
    text-align: center;
    padding: 60px 20px;
}

.cp-empty-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--ck-surface);
    border: 1px solid var(--ck-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    color: var(--ck-grey);
    margin-bottom: 18px;
}

.cp-empty h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--ck-dark);
}

.cp-empty p {
    color: var(--ck-grey);
    margin: 0 0 24px;
}

/* Clear button (uses theme red but lighter than primary) */
.cp-btn-clear {
    background: #ffffff;
    color: var(--ck-primary);
    border: 1px solid var(--ck-border);
}
.cp-btn-clear:hover {
    background: var(--ck-primary);
    color: #ffffff;
    border-color: var(--ck-primary);
}

/* Table */
.cp-table-wrap {
    overflow-x: auto;
    padding: 0 0 8px;
}

.cp-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    min-width: 720px;
}

.cp-table thead .cp-attr-col,
.cp-table thead .cp-product-col {
    background: var(--ck-surface);
    vertical-align: top;
    text-align: left;
    padding: 0;
    border-bottom: 2px solid var(--ck-border);
    border-right: 1px solid var(--ck-border);
}

.cp-table thead .cp-attr-col {
    width: 200px;
    min-width: 180px;
    padding: 24px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ck-body);
}

.cp-table thead .cp-product-col {
    min-width: 220px;
}

.cp-table tbody tr {
    border-bottom: 1px solid var(--ck-border);
}

.cp-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.012);
}

.cp-table tbody th[scope="row"] {
    text-align: left;
    padding: 16px 18px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--ck-grey);
    background: var(--ck-surface);
    width: 200px;
    min-width: 180px;
    border-right: 1px solid var(--ck-border);
    white-space: nowrap;
}

.cp-table tbody th[scope="row"] i {
    color: var(--ck-primary);
    margin-right: 6px;
    font-size: 13px;
}

.cp-table tbody td {
    padding: 16px 18px;
    font-size: 14px;
    color: var(--ck-body);
    vertical-align: middle;
    border-right: 1px solid var(--ck-border);
}

.cp-table tbody td:last-child,
.cp-table thead .cp-product-col:last-child {
    border-right: 0;
}

.cp-section-row td {
    padding: 16px 18px;
    background: var(--ck-dark);
    color: #ffffff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    border-right: 0;
}

.cp-section-row td i { color: var(--ck-primary); margin-right: 6px; }

.cp-text-muted { color: var(--ck-grey); }

.cp-highlight-row th { color: var(--ck-primary); }
.cp-cell-price {
    color: var(--ck-primary);
    font-weight: 700;
    font-size: 18px;
}

.cp-cell-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Product head (top cell) */
.cp-product-head {
    position: relative;
    padding: 22px 16px 18px;
    text-align: center;
}

.cp-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--ck-border);
    background: #ffffff;
    color: var(--ck-grey);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    font-size: 11px;
}

.cp-remove:hover {
    border-color: var(--ck-primary);
    color: var(--ck-primary);
    background: rgba(209, 0, 36, 0.06);
}

.cp-remove:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cp-img-link {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 180px;
    margin: 0 auto 12px;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--ck-border);
    padding: 8px;
}

.cp-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cp-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ck-dark);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 4px;
}

.cp-name:hover { color: var(--ck-primary); }

.cp-brand {
    font-size: 11px;
    color: var(--ck-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.cp-price-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.cp-price {
    color: var(--ck-primary);
    font-weight: 700;
    font-size: 18px;
}

.cp-old-price {
    color: var(--ck-grey);
    text-decoration: line-through;
    font-size: 13px;
}

.cp-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--ck-grey);
}

.cp-rating-empty {
    color: var(--ck-grey);
    font-style: italic;
}

.cp-stars { color: var(--ck-primary); font-size: 12px; letter-spacing: 1px; }
.cp-rating-num { color: var(--ck-dark); font-weight: 700; }
.cp-reviews { color: var(--ck-grey); font-size: 11px; }

.cp-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.cp-add-cart,
.cp-quick-view {
    height: 36px;
    padding: 0 14px;
    border-radius: 4px;
    border: 1px solid var(--ck-border);
    background: #ffffff;
    color: var(--ck-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.cp-add-cart:hover {
    border-color: var(--ck-primary);
    background: var(--ck-primary);
    color: #ffffff;
}

.cp-quick-view:hover {
    border-color: var(--ck-dark);
    color: var(--ck-dark);
}

/* Stock badges */
.cp-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.cp-stock-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.cp-stock-ok  { background: rgba(13, 158, 113, 0.12); color: #065f46; }
.cp-stock-low { background: rgba(245, 158, 11, 0.12); color: #92400e; }
.cp-stock-out { background: rgba(209, 0, 36, 0.12); color: #b91c1c; }

/* Bottom actions */
.cp-actions-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--ck-border);
    background: var(--ck-surface);
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .cp-page-title { font-size: 22px; }
    .cp-table { font-size: 13px; min-width: 580px; }
    .cp-product-head { padding: 18px 12px 14px; }
    .cp-img-link { max-width: 140px; }
}

@media (max-width: 480px) {
    .cp-table { min-width: 480px; }
    .cp-table tbody th[scope="row"],
    .cp-table thead .cp-attr-col {
        width: 140px;
        min-width: 130px;
        padding: 12px 10px;
        font-size: 11px;
    }
    .cp-table tbody td { padding: 12px 10px; font-size: 12px; }
    .cp-actions-row { flex-direction: column; align-items: stretch; }
    .cp-actions-row .ck-btn { width: 100%; }
}

/* RTL */
.locale-rtl .cp-product-head { direction: rtl; }
.locale-rtl .cp-remove { right: auto; left: 8px; }
.locale-rtl .cp-table tbody th[scope="row"] { text-align: right; border-right: 0; border-left: 1px solid var(--ck-border); }
.locale-rtl .cp-table thead .cp-attr-col,
.locale-rtl .cp-table thead .cp-product-col,
.locale-rtl .cp-table tbody td { border-right: 0; border-left: 1px solid var(--ck-border); }
.locale-rtl .cp-table thead .cp-attr-col,
.locale-rtl .cp-table tbody th[scope="row"] { border-left: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cp-remove, .cp-add-cart, .cp-quick-view { transition: none !important; }
}