/* ==========================================================================
   Compare Tray (floating chip + bottom sheet) + Compare Page styles
   Tokens only. Mobile-first.
   ========================================================================== */

/* ==========================================================================
   Sticky Compare Bar (CarDekho / PolicyBazaar style) — credit-card surfaces only.
   Sits directly above the fixed bottom dock (64px tall, 16px offset → clear at 88px).
   ========================================================================== */
.fp-cc-bar {
    position: fixed;
    left: var(--fp-space-3);
    right: var(--fp-space-3);
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    z-index: 9985; /* just under the bottom dock (9990); they never overlap */
    font-family: var(--fp-font);
}
.fp-cc-bar[hidden] { display: none; }
.fp-cc-bar:not([hidden]) { animation: fp-cc-bar-rise 350ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fp-cc-bar-rise {
    from { transform: translateY(120%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.fp-cc-bar-inner {
    max-width: 880px;
    margin: 0 auto;
    background: var(--fp-surface);
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-2xl);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
    padding: var(--fp-space-3);
}

.fp-cc-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--fp-space-2);
}
.fp-cc-bar-title { font-size: var(--fp-text-sm); font-weight: 700; color: var(--fp-text-main); }
.fp-cc-bar-count { color: var(--fp-secondary); }
.fp-cc-bar-clear {
    background: transparent; border: none; color: var(--fp-text-muted);
    font-size: var(--fp-text-xs); font-weight: 600; cursor: pointer;
    padding: var(--fp-space-1) var(--fp-space-2); border-radius: var(--fp-radius-sm);
}
.fp-cc-bar-clear:hover { color: var(--fp-red); }

.fp-cc-bar-body { display: flex; flex-direction: column; gap: var(--fp-space-3); }

.fp-cc-bar-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--fp-space-2);
}

.fp-cc-slot {
    position: relative;
    height: 66px;
    border-radius: var(--fp-radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: var(--fp-space-1);
    text-decoration: none;
    overflow: hidden;
}
.fp-cc-slot--filled { background: var(--fp-background); border: 1px solid var(--fp-border); }
.fp-cc-slot--empty {
    border: 1.5px dashed var(--fp-border);
    color: var(--fp-text-muted);
    transition: var(--fp-transition);
}
.fp-cc-slot--empty:hover { border-color: var(--fp-secondary); color: var(--fp-secondary); }

.fp-cc-slot-img { width: 44px; height: 28px; object-fit: cover; border-radius: var(--fp-radius-xs); }
.fp-cc-slot-ph  { width: 44px; height: 28px; border-radius: var(--fp-radius-xs); background: var(--fp-gradient-dark); }
.fp-cc-slot-name {
    font-size: var(--fp-text-4xs); font-weight: 600; color: var(--fp-text-main);
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fp-cc-slot-remove {
    position: absolute; top: 2px; right: 2px;
    width: 18px; height: 18px; padding: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--fp-surface); border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-circle); color: var(--fp-text-muted);
    font-size: var(--fp-text-xs); cursor: pointer;
}
.fp-cc-slot-remove:hover { color: var(--fp-red); border-color: var(--fp-red); }
.fp-cc-slot-plus { font-size: var(--fp-text-lg); font-weight: 800; line-height: 1; }
.fp-cc-slot-add  { font-size: var(--fp-text-4xs); font-weight: 600; }

.fp-cc-bar-go {
    width: 100%;
    padding: var(--fp-space-3) var(--fp-space-4);
    background: var(--fp-gradient-green); color: #fff; border: none;
    border-radius: var(--fp-radius-pill); font-weight: 700; cursor: pointer;
    font-size: var(--fp-text-base); transition: var(--fp-transition);
}
.fp-cc-bar-go:disabled { opacity: 0.45; cursor: not-allowed; }
.fp-cc-bar-go:not(:disabled):hover { transform: translateY(-1px); box-shadow: var(--fp-shadow-md); }

@media (min-width: 768px) {
    .fp-cc-bar-body { flex-direction: row; align-items: center; }
    .fp-cc-bar-slots { flex: 1; }
    .fp-cc-bar-go { width: auto; flex: 0 0 auto; }
}
@media (min-width: 1024px) {
    /* Bottom dock is hidden on desktop — drop the bar to the normal bottom offset. */
    .fp-cc-bar { left: var(--fp-space-6); right: var(--fp-space-6); bottom: var(--fp-space-6); }
}

/* Pad page bottom so content clears the bar (mobile also keeps the 80px dock space) */
body.fp-cc-bar-open { padding-bottom: 220px; }
@media (min-width: 1024px) { body.fp-cc-bar-open { padding-bottom: 150px; } }

/* ==========================================================================
   Add-to-compare button (single hero + "also compare" strip + future archive cards)
   ========================================================================== */
.fp-cc-add {
    display: inline-flex; align-items: center; gap: 6px;
    padding: var(--fp-space-2) var(--fp-space-3);
    background: transparent; border: 1.5px solid var(--fp-border); color: var(--fp-text-main);
    border-radius: var(--fp-radius-pill); font-weight: 600; cursor: pointer; font-size: var(--fp-text-sm);
    transition: var(--fp-transition); text-decoration: none;
}
.fp-cc-add:hover { border-color: var(--fp-secondary); color: var(--fp-secondary); }
.fp-cc-add[aria-pressed="true"] { background: var(--fp-gradient-green); border-color: transparent; color: #fff; }
.fp-cc-add-icon { font-weight: 800; font-size: 1.1em; line-height: 1; }

/* ==========================================================================
   "Also compare with" strip (single credit-card page)
   ========================================================================== */
.fp-cc-also { margin: 0 0 var(--fp-space-6); }
.fp-cc-also-title { font-size: var(--fp-text-lg); font-weight: 700; margin: 0 0 var(--fp-space-1); color: var(--fp-text-main); }
.fp-cc-also-sub { margin: 0 0 var(--fp-space-3); font-size: var(--fp-text-sm); color: var(--fp-text-muted); }
.fp-cc-also-scroll {
    display: flex; gap: var(--fp-space-3);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: var(--fp-space-2); scroll-snap-type: x mandatory;
}
.fp-cc-also-card {
    flex: 0 0 auto; width: 150px;
    background: var(--fp-surface); border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-lg); padding: var(--fp-space-3);
    display: flex; flex-direction: column; gap: var(--fp-space-2);
    scroll-snap-align: start;
}
.fp-cc-also-card-link { display: flex; flex-direction: column; align-items: center; gap: var(--fp-space-2); text-decoration: none; color: inherit; }
.fp-cc-also-card-img { width: 100%; height: auto; aspect-ratio: 1.586 / 1; object-fit: cover; border-radius: var(--fp-radius-md); }
.fp-cc-also-card-ph {
    width: 100%; aspect-ratio: 1.586 / 1; border-radius: var(--fp-radius-md);
    background: var(--fp-gradient-dark); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
}
.fp-cc-also-card-name { font-size: var(--fp-text-xs); font-weight: 700; color: var(--fp-text-main); text-align: center; line-height: 1.3; }
.fp-cc-also-card-add { justify-content: center; width: 100%; }/* ==========================================================================
   Minimal archive stub (placeholder until the premium archive ships)
   ========================================================================== */

/* ==========================================================================
   Compare Page layout
   ========================================================================== */
.fp-cc-compare-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--fp-space-4);
    font-family: var(--fp-font);
    color: var(--fp-text-main);
}

.fp-cc-cmp-empty { text-align: center; padding: var(--fp-space-10) var(--fp-space-4); }

.fp-cc-cmp-breadcrumb { display: flex; align-items: center; gap: var(--fp-space-1); font-size: var(--fp-text-sm); color: var(--fp-text-muted); margin-bottom: var(--fp-space-3); }
.fp-cc-cmp-breadcrumb a { color: var(--fp-text-muted); text-decoration: none; }
.fp-cc-cmp-breadcrumb a:hover { color: var(--fp-text-main); }

.fp-cc-cmp-title { font-size: var(--fp-text-2xl); font-weight: 800; margin: 0 0 var(--fp-space-2); line-height: 1.2; }
.fp-cc-cmp-sub   { color: var(--fp-text-muted); margin: 0 0 var(--fp-space-5); }

.fp-cc-cmp-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--fp-space-3);
    margin-bottom: var(--fp-space-6);
}
@media (min-width: 768px) { .fp-cc-cmp-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px){ .fp-cc-cmp-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.fp-cc-cmp-card {
    background: var(--fp-surface);
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius-lg);
    padding: var(--fp-space-3);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--fp-space-2);
}
.fp-cc-cmp-card-link { color: inherit; text-decoration: none; display: contents; }
.fp-cc-cmp-card-img { width: 100%; height: auto; border-radius: var(--fp-radius-md); aspect-ratio: 1.586/1; object-fit: cover; }
.fp-cc-cmp-card-name { font-size: var(--fp-text-base); font-weight: 700; margin: 0; }

.fp-cc-cmp-verdict {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    border-radius: var(--fp-radius-xl);
    padding: var(--fp-space-5);
    margin-bottom: var(--fp-space-6);
}
.fp-cc-cmp-verdict-eyebrow { font-size: var(--fp-text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: #1b6e43; font-weight: 700; margin: 0 0 var(--fp-space-2); }
.fp-cc-cmp-verdict-title   { font-size: var(--fp-text-xl); font-weight: 800; margin: 0 0 var(--fp-space-3); color: var(--fp-text-main); }
.fp-cc-cmp-verdict-body    { margin: 0 0 var(--fp-space-2); color: var(--fp-text-main); font-size: var(--fp-text-base); line-height: 1.6; }
.fp-cc-cmp-verdict-note    { margin: 0; font-size: var(--fp-text-xs); color: var(--fp-text-muted); }

.fp-cc-cmp-h2 { font-size: var(--fp-text-lg); font-weight: 700; margin: 0 0 var(--fp-space-3); }

.fp-cc-cmp-matrix-wrap { margin-bottom: var(--fp-space-6); }
.fp-cc-cmp-matrix-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--fp-border); border-radius: var(--fp-radius-lg); }
.fp-cc-cmp-matrix { width: 100%; border-collapse: collapse; min-width: 600px; background: var(--fp-surface); }
.fp-cc-cmp-matrix th, .fp-cc-cmp-matrix td {
    padding: var(--fp-space-3);
    border-bottom: 1px solid var(--fp-border);
    text-align: left;
    font-size: var(--fp-text-sm);
}
.fp-cc-cmp-matrix thead th { background: var(--fp-background); font-weight: 700; }
.fp-cc-cmp-matrix tbody th { font-weight: 600; color: var(--fp-text-muted); }
.fp-cc-cmp-matrix td.is-winner { background: rgba(46,204,113,0.10); color: #1b6e43; font-weight: 700; }
.fp-cc-cmp-winner-mark { margin-left: 4px; color: var(--fp-green); }
.fp-cc-cmp-apply { display: inline-block; padding: var(--fp-space-2) var(--fp-space-3); background: var(--fp-gradient-green); color: #fff; border-radius: var(--fp-radius-pill); font-weight: 700; text-decoration: none; font-size: var(--fp-text-sm); }
.fp-cc-cmp-apply:hover { transform: translateY(-1px); box-shadow: var(--fp-shadow-md); }

/* Mobile-first sticky first column for row labels while horizontally scrolling.
   Default = sticky on small viewports; disabled on tablet+ via min-width override. */
.fp-cc-cmp-matrix th[scope="row"] { position: sticky; left: 0; background: var(--fp-surface); z-index: 1; }
@media (min-width: 768px) {
    .fp-cc-cmp-matrix th[scope="row"] { position: static; background: transparent; z-index: auto; }
}
