/* Store Compare tool (products.html) — card toggle, bottom tray, compare sheet.
   Rendered by assets/js/catalog-compare.js. Stacks with the cart bar
   (rli.css: .rl-cart-bar, z 1058, --rl-cart-bar-h) and the docked cart drawer. */

:root {
    --rl-ccmp-tray-h: 11.5rem;
    --rl-ccmp-bg: #fff;
    --rl-ccmp-fg: var(--rl-dev-ink, #0B0F19);
    --rl-ccmp-muted: var(--rl-dev-muted, #4A5063);
    --rl-ccmp-line: var(--rl-dev-line, #E6E8EE);
    --rl-ccmp-soft: var(--rl-dev-bg-soft, #F7F8FB);
    --rl-ccmp-accent: var(--bs-primary, #005cf4);
}

/* ---- card toggle ------------------------------------------------------- */
.rl-product .rl-ccmp-card-btn--overlay {
    position: absolute;
    left: 50%;
    bottom: 0.5rem;
    transform: translate(-50%, 6px);
    z-index: 3;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.85rem;
    border: 1px solid rgba(11, 15, 25, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--rl-ccmp-fg);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 2px 10px rgba(11, 15, 25, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
}

.rl-product .rl-product-item-card:hover .rl-ccmp-card-btn--overlay,
.rl-product .rl-product-item-card:focus-within .rl-ccmp-card-btn--overlay,
.rl-product .rl-ccmp-card-btn--overlay.is-on,
.rl-product .rl-ccmp-card-btn--overlay:focus-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

@media (hover: none) {
    .rl-product .rl-ccmp-card-btn--overlay { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
}

.rl-product .rl-ccmp-card-btn--overlay:hover { background: #fff; border-color: var(--rl-ccmp-accent); color: var(--rl-ccmp-accent); }
.rl-product .rl-ccmp-card-btn--overlay.is-on { background: var(--rl-ccmp-accent); border-color: var(--rl-ccmp-accent); color: #fff; }
.rl-product .rl-ccmp-card-btn--overlay.is-on:hover { background: #0049c2; color: #fff; }
.rl-product .rl-ccmp-card-btn--overlay:disabled { opacity: 0.55; cursor: not-allowed; }
.rl-product .rl-ccmp-card-btn--overlay:focus-visible { outline: 2px solid var(--rl-ccmp-accent); outline-offset: 2px; }

.rl-product .rl-ccmp-card-btn--icon.is-on {
    background: var(--rl-ccmp-accent) !important;
    border-color: var(--rl-ccmp-accent) !important;
    color: #fff;
}

/* Room for the tray so the last row of cards stays reachable. */
html.rl-ccmp-tray-on body { padding-bottom: var(--rl-ccmp-tray-h); }
html.rl-ccmp-tray-on.rl-cart-bar-on body { padding-bottom: calc(var(--rl-ccmp-tray-h) + var(--rl-cart-bar-h, 64px)); }

/* The partner-pricing toast (rli.css, fixed bottom, z 1070) rides above the
   tray instead of covering it, and steps aside while the sheet is open. */
html.rl-ccmp-tray-on .rl-catalog-partner-toast-wrap { bottom: var(--rl-ccmp-tray-h); }
html.rl-ccmp-tray-on.rl-cart-bar-on .rl-catalog-partner-toast-wrap { bottom: calc(var(--rl-ccmp-tray-h) + var(--rl-cart-bar-h, 64px)); }
html.rl-ccmp-open .rl-catalog-partner-toast-wrap { display: none; }

/* Add to Cart from inside the sheet opens the cart drawer: lift it (and its
   backdrop) above the sheet so the visitor sees what they just added. */
html.rl-ccmp-open .rl-cart-drawer { z-index: 1072; }
html.rl-ccmp-open .rl-cart-drawer-backdrop { z-index: 1071; }

/* ---- tray ------------------------------------------------------------- */
.rl-ccmp-tray {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1057;
    background: var(--rl-ccmp-bg);
    color: var(--rl-ccmp-fg);
    border-top: 1px solid var(--rl-ccmp-line);
    box-shadow: 0 -10px 30px rgba(11, 15, 25, 0.1);
    animation: rl-ccmp-rise 0.22s ease-out;
}
html.rl-cart-bar-on .rl-ccmp-tray { bottom: var(--rl-cart-bar-h, 64px); }
html.rl-cart-docked .rl-ccmp-tray { right: var(--rl-cart-drawer-w, 160px); }
.rl-ccmp-tray[hidden] { display: none; }

@keyframes rl-ccmp-rise {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .rl-ccmp-tray { animation: none; }
    .rl-product .rl-ccmp-card-btn--overlay { transition: none; }
}

.rl-ccmp-tray__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.85rem 1rem 1rem;
    display: grid;
    grid-template-columns: minmax(12rem, 18rem) 1fr;
    gap: 1rem 1.5rem;
    align-items: center;
}

.rl-ccmp-tray__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.rl-ccmp-tray__count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rl-ccmp-accent);
    background: rgba(0, 92, 244, 0.1);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
}
.rl-ccmp-tray__hint { margin: 0 0 0.6rem; font-size: 0.8rem; color: var(--rl-ccmp-muted); }
.rl-ccmp-tray__btns { display: flex; align-items: center; gap: 0.5rem; }
.rl-ccmp-tray__cancel { color: var(--rl-ccmp-muted); text-decoration: none; padding-left: 0; }
.rl-ccmp-tray__cancel:hover { color: var(--rl-ccmp-fg); }

.rl-ccmp-tray__slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.rl-ccmp-slot {
    position: relative;
    min-height: 7.25rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.6rem 0.75rem;
}
.rl-ccmp-slot--filled { background: var(--rl-ccmp-soft); border: 1px solid var(--rl-ccmp-line); }
.rl-ccmp-slot--empty {
    border: 1px dashed rgba(74, 80, 99, 0.45);
    color: var(--rl-ccmp-muted);
    font-size: 0.8rem;
    gap: 0.4rem;
}
.rl-ccmp-slot__icon { font-size: 1.4rem; opacity: 0.7; }
.rl-ccmp-slot__img, .rl-ccmp-img {
    display: block;
    width: 100%;
    max-width: 7rem;
    height: 3.25rem;
    object-fit: contain;
    margin-bottom: 0.35rem;
}
.rl-ccmp-img--none { background: var(--rl-ccmp-soft); border-radius: 6px; }
.rl-ccmp-slot__name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.rl-ccmp-slot__pn { font-size: 0.72rem; color: var(--rl-ccmp-muted); margin-top: 0.1rem; }
.rl-ccmp-slot__remove, .rl-ccmp-remove {
    position: absolute;
    top: -0.45rem;
    right: -0.45rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1px solid var(--rl-ccmp-line);
    background: #fff;
    color: var(--rl-ccmp-muted);
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(11, 15, 25, 0.12);
}
.rl-ccmp-slot__remove:hover, .rl-ccmp-remove:hover { color: #fff; background: #dc3545; border-color: #dc3545; }

@media (max-width: 991.98px) {
    :root { --rl-ccmp-tray-h: 14rem; }
    .rl-ccmp-tray__inner { grid-template-columns: 1fr; gap: 0.6rem; padding: 0.7rem 0.85rem 0.85rem; }
    .rl-ccmp-tray__head { display: grid; grid-template-columns: 1fr auto; align-items: center; }
    .rl-ccmp-tray__hint { display: none; }
    .rl-ccmp-tray__title { margin: 0; }
    .rl-ccmp-tray__btns { grid-column: 2; grid-row: 1; }
    .rl-ccmp-slot { min-height: 6rem; padding: 0.4rem 0.4rem; }
    .rl-ccmp-slot__img { height: 2.25rem; }
    .rl-ccmp-slot__name { font-size: 0.72rem; }
    .rl-ccmp-slot__pn { display: none; }
    .rl-ccmp-slot--empty span { display: none; }
}
@media (max-width: 575.98px) {
    :root { --rl-ccmp-tray-h: 12rem; }
    .rl-ccmp-tray__slots { gap: 0.5rem; }
    .rl-ccmp-slot { min-height: 5rem; }
}

/* ---- sheet ------------------------------------------------------------- */
html.rl-ccmp-open { overflow: hidden; }

.rl-ccmp-sheet {
    position: fixed;
    inset: 0;
    z-index: 1061;
    background: var(--rl-ccmp-bg);
    color: var(--rl-ccmp-fg);
    display: flex;
    flex-direction: column;
    animation: rl-ccmp-drop 0.25s ease-out;
}
.rl-ccmp-sheet[hidden] { display: none; }
@keyframes rl-ccmp-drop {
    from { transform: translateY(-3%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .rl-ccmp-sheet { animation: none; } }

.rl-ccmp-sheet__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--rl-ccmp-line);
}
.rl-ccmp-sheet__title { margin: 0; font-size: 1.35rem; font-weight: 700; }
.rl-ccmp-close {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--rl-ccmp-line);
    background: var(--rl-ccmp-soft);
    color: var(--rl-ccmp-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.rl-ccmp-close:hover { background: var(--rl-ccmp-line); }

.rl-ccmp-scroll {
    flex: 1 1 auto;
    overflow: auto;
    padding: 0 1.25rem 2rem;
    -webkit-overflow-scrolling: touch;
}

.rl-ccmp-table {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.875rem;
}
.rl-ccmp-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--rl-ccmp-bg);
    border-bottom: 1px solid var(--rl-ccmp-line);
    padding: 1rem 0.75rem 0.85rem;
    vertical-align: bottom;
    font-weight: 500;
}
.rl-ccmp-table thead th.rl-ccmp-corner { vertical-align: bottom; text-align: left; }
.rl-ccmp-table .rl-ccmp-corner,
.rl-ccmp-table .rl-ccmp-rowlabel {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--rl-ccmp-bg);
    width: 14rem;
    min-width: 11rem;
}
.rl-ccmp-table thead th.rl-ccmp-corner { z-index: 4; }

.rl-ccmp-unique {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--rl-ccmp-muted);
    cursor: pointer;
    margin: 0;
    user-select: none;
}
.rl-ccmp-unique input { accent-color: var(--rl-ccmp-accent); width: 1rem; height: 1rem; }

.rl-ccmp-colhead {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    padding: 0.5rem 0.25rem 0;
}
.rl-ccmp-colhead .rl-ccmp-img { height: 4rem; max-width: 9rem; margin-bottom: 0; }
.rl-ccmp-colhead .rl-ccmp-remove { top: 0; right: 0.1rem; }

.rl-ccmp-pick-wrap { position: relative; width: 100%; max-width: 15rem; }
.rl-ccmp-pick {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}
.rl-ccmp-pick__face {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--rl-ccmp-line);
    border-radius: 999px;
    background: var(--rl-ccmp-soft);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: left;
}
.rl-ccmp-pick__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rl-ccmp-pick__face i { font-size: 0.7rem; color: var(--rl-ccmp-muted); flex: 0 0 auto; }
.rl-ccmp-pick:hover + .rl-ccmp-pick__face { border-color: var(--rl-ccmp-accent); }
.rl-ccmp-pick:focus-visible + .rl-ccmp-pick__face { outline: 2px solid var(--rl-ccmp-accent); outline-offset: 2px; }
.rl-ccmp-pn { font-size: 0.78rem; color: var(--rl-ccmp-muted); }
.rl-ccmp-price { font-size: 1rem; font-weight: 700; min-height: 1.4rem; }
.rl-ccmp-price__list { font-weight: 400; color: var(--rl-ccmp-muted); font-size: 0.85rem; margin-right: 0.25rem; }
.rl-ccmp-actions { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.rl-ccmp-cta { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.rl-ccmp-link { font-size: 0.8rem; text-decoration: none; }
.rl-ccmp-link:hover { text-decoration: underline; }

.rl-ccmp-addcol { width: 12rem; }
.rl-ccmp-add {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 9rem;
    margin: 0;
    border: 1px dashed rgba(74, 80, 99, 0.45);
    border-radius: 12px;
    color: var(--rl-ccmp-accent);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}
.rl-ccmp-add:hover { border-color: var(--rl-ccmp-accent); background: rgba(0, 92, 244, 0.04); }
.rl-ccmp-add__icon { font-size: 1.6rem; }
.rl-ccmp-add-pick { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.rl-ccmp-add-pick:focus-visible { opacity: 1; }

.rl-ccmp-table tbody tr.rl-ccmp-section td {
    padding: 1.25rem 0 0.4rem;
    border: 0;
    position: sticky;
    left: 0;
}
.rl-ccmp-sectoggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    background: transparent;
    padding: 0.25rem 0.25rem 0.25rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rl-ccmp-fg);
    cursor: pointer;
    position: sticky;
    left: 0;
}
.rl-ccmp-sectoggle i { font-size: 0.75rem; color: var(--rl-ccmp-muted); width: 0.9rem; }
.rl-ccmp-section__n {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--rl-ccmp-muted);
    background: var(--rl-ccmp-soft);
    border: 1px solid var(--rl-ccmp-line);
    border-radius: 999px;
    padding: 0 0.45rem;
}

.rl-ccmp-table tbody th.rl-ccmp-rowlabel,
.rl-ccmp-table tbody td.rl-ccmp-cell {
    border-top: 1px solid var(--rl-ccmp-line);
    padding: 0.7rem 0.75rem;
    vertical-align: middle;
}
.rl-ccmp-table tbody th.rl-ccmp-rowlabel {
    text-align: left;
    font-weight: 500;
    color: var(--rl-ccmp-fg);
}
.rl-ccmp-table tbody td.rl-ccmp-cell {
    text-align: center;
    border-left: 1px solid var(--rl-ccmp-line);
    overflow-wrap: anywhere;
}
.rl-ccmp-table tbody tr:last-child th.rl-ccmp-rowlabel,
.rl-ccmp-table tbody tr:last-child td.rl-ccmp-cell { border-bottom: 1px solid var(--rl-ccmp-line); }
.rl-ccmp-table tbody tr:not(.rl-ccmp-section):hover th.rl-ccmp-rowlabel,
.rl-ccmp-table tbody tr:not(.rl-ccmp-section):hover td.rl-ccmp-cell { background: var(--rl-ccmp-soft); }
.rl-ccmp-cell--pad { border-left: 0 !important; border-top: 0 !important; border-bottom: 0 !important; background: transparent !important; }
.rl-ccmp-line + .rl-ccmp-line { margin-top: 0.15rem; }
.rl-ccmp-dash { color: var(--rl-ccmp-muted); opacity: 0.7; }
.rl-ccmp-empty { padding: 2rem 1rem; text-align: center; color: var(--rl-ccmp-muted); }
.rl-ccmp-loading { max-width: 1320px; margin: 1rem auto 0; color: var(--rl-ccmp-muted); font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.rl-ccmp-note { max-width: 1320px; margin: 1rem auto 0; font-size: 0.82rem; color: var(--rl-ccmp-muted); }
.rl-ccmp-foot { max-width: 1320px; margin: 1rem auto 0; font-size: 0.78rem; color: var(--rl-ccmp-muted); }

@media (max-width: 991.98px) {
    .rl-ccmp-scroll { padding: 0 0.75rem 2rem; }
    .rl-ccmp-table { table-layout: auto; min-width: 100%; }
    .rl-ccmp-table .rl-ccmp-corner, .rl-ccmp-table .rl-ccmp-rowlabel { width: 9rem; min-width: 8rem; }
    .rl-ccmp-table thead th.rl-ccmp-col { min-width: 11rem; }
    .rl-ccmp-colhead .rl-ccmp-img { height: 3rem; }
    .rl-ccmp-cta span { display: none; }
    .rl-ccmp-cta { width: 2.25rem; height: 2.25rem; padding: 0; justify-content: center; border-radius: 50% !important; }
    .rl-ccmp-add { min-height: 7rem; font-size: 0.8rem; }
    .rl-ccmp-addcol { width: 8rem; }
}
@media (max-width: 575.98px) {
    .rl-ccmp-sheet__bar { padding: 0.7rem 0.85rem; }
    .rl-ccmp-sheet__title { font-size: 1.1rem; }
    .rl-ccmp-table { font-size: 0.8rem; }
    .rl-ccmp-table .rl-ccmp-corner, .rl-ccmp-table .rl-ccmp-rowlabel { width: 7.5rem; min-width: 7rem; }
    .rl-ccmp-table thead th.rl-ccmp-col { min-width: 9.5rem; }
    .rl-ccmp-table tbody th.rl-ccmp-rowlabel, .rl-ccmp-table tbody td.rl-ccmp-cell { padding: 0.55rem 0.5rem; }
    .rl-ccmp-unique span { font-size: 0.78rem; }
}

/* ---- dark theme (matches the cart drawer/bar palette in rli.css) --------- */
html[data-theme="dark"] {
    --rl-ccmp-bg: #11162A;
    --rl-ccmp-fg: #F4F5F8;
    --rl-ccmp-muted: #A3A8B8;
    --rl-ccmp-line: rgba(244, 245, 248, 0.12);
    --rl-ccmp-soft: rgba(244, 245, 248, 0.06);
}
html[data-theme="dark"] .rl-ccmp-slot__remove,
html[data-theme="dark"] .rl-ccmp-remove { background: #1a2140; border-color: rgba(244, 245, 248, 0.2); color: #F4F5F8; }
html[data-theme="dark"] .rl-ccmp-tray { box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45); }
html[data-theme="dark"] .rl-ccmp-tray__count { background: rgba(77, 168, 218, 0.18); color: var(--rl-dev-accent-bright, #4DA8DA); }
html[data-theme="dark"] .rl-ccmp-add { color: var(--rl-dev-accent-bright, #4DA8DA); }
/* theme.css colours headings and links for the light page; pin ours. */
html[data-theme="dark"] .rl-ccmp-sheet__title,
html[data-theme="dark"] .rl-ccmp-tray__title,
html[data-theme="dark"] .rl-ccmp-sectoggle,
html[data-theme="dark"] .rl-ccmp-table tbody th.rl-ccmp-rowlabel { color: var(--rl-ccmp-fg); }
html[data-theme="dark"] .rl-ccmp-link,
html[data-theme="dark"] .rl-ccmp-tray__cancel { color: var(--rl-dev-accent-bright, #4DA8DA); }
html[data-theme="dark"] .rl-ccmp-pick:hover + .rl-ccmp-pick__face,
html[data-theme="dark"] .rl-ccmp-add:hover { border-color: var(--rl-dev-accent-bright, #4DA8DA); }
