/* ==========================================================================
   mv-compare.css  —  PrestaShop-style product COMPARE controls (additive)
   --------------------------------------------------------------------------
   Styles the product-card "Ajouter au comparateur" toggle button (.mv-compare-btn)
   and the comparator-page per-column remove button (.cmp-remove). The header
   compare icon + RED count badge (.mv-hdr-compare / .mv-icon-link / .mv-badge)
   are styled by css/header-icons.css (shared with cart/favorites). The small
   fallback rules below only apply if header-icons.css is not present, so the
   badge still shows when this branch is exercised on its own.

   Wired via <sys:css file="css/mv-compare.css" /> in templates/parts/full-header.html.
   ========================================================================== */

/* --- Card toggle button ---------------------------------------------------- */
.mv-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 4px 10px;
    font: 600 12px/1.2 Arial, Helvetica, sans-serif;
    color: #555;
    background: #fff;
    border: 1px solid #cdcdcd;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.mv-compare-btn:hover,
.mv-compare-btn:focus {
    color: #222;
    border-color: #999;
    background: #f6f6f6;
}
/* Active (in the compare set): filled state set by mv-compare.js (.is-added). */
.mv-compare-btn.is-added {
    color: #fff;
    background: #d0021b;
    border-color: #d0021b;
}
.mv-compare-btn::before {
    content: "";
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3v2H8v14H6V5H4V3h6zm10 0v2h-2v14h-2V5h-2V3h6zM3 9h6l-3 5-3-5zm12 0h6l-3 5-3-5z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3v2H8v14H6V5H4V3h6zm10 0v2h-2v14h-2V5h-2V3h6zM3 9h6l-3 5-3-5zm12 0h6l-3 5-3-5z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* --- Comparator page: per-column remove button ----------------------------- */
.comparator-table .cmp-head {
    position: relative;
}
.cmp-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    line-height: 20px;
    padding: 0;
    font-size: 18px;
    color: #fff;
    background: #d0021b;
    border: 2px solid #fff;
    border-radius: 999px;
    cursor: pointer;
    z-index: 5;
}
.cmp-remove:hover,
.cmp-remove:focus {
    background: #a80115;
}

/* --- Bottom compare BAR (tray) --------------------------------------------
   Full-width tray pinned to the bottom of the viewport. Shows a thumbnail of
   each selected product side by side (with a remove "x"), a "Comparer (n/MAX)"
   button that is GRAYED OUT until 2+ products are picked, and a "Masquer"
   button that slides the whole tray below the screen. A small re-open tab
   (.mv-cbar-reopen) brings it back. Markup is injected by mv-compare.js.       */
.mv-cbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9500;
    background: #fff;
    border-top: 1px solid #d7dbe0;
    box-shadow: 0 -6px 22px rgba(0, 0, 0, .12);
    transform: translateY(110%);
    transition: transform .32s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
}
.mv-cbar.is-open { transform: translateY(0); }

.mv-cbar__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 10px 16px;
    box-sizing: border-box;
}

.mv-cbar__items {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    padding: 6px 2px;
}
.mv-cbar__item {
    position: relative;
    flex: 0 0 auto;
}
.mv-cbar__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 54px;
    background: #fff;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    overflow: hidden;
}
.mv-cbar__thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.mv-cbar__ph { width: 100%; height: 100%; background: #eef0f2; }

.mv-cbar__rm {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    padding: 0;
    line-height: 16px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: #8a929b;
    border: 2px solid #fff;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: background-color .15s ease;
}
.mv-cbar__rm:hover, .mv-cbar__rm:focus { background: #d0021b; }

.mv-cbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
}
.mv-cbar__go {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    font: 700 14px/1 Arial, Helvetica, sans-serif;
    color: #fff;
    background: var(--site-button-bg, #2f80ed);
    border: 0;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: filter .15s ease, background-color .15s ease;
}
.mv-cbar__go:hover { filter: brightness(.94); color: #fff; text-decoration: none; }
.mv-cbar__go.is-disabled {
    background: #c9ccd1;
    color: #fff;
    cursor: not-allowed;
    pointer-events: none;   /* grayed out: cannot navigate until 2+ are picked */
    filter: none;
}
.mv-cbar__hide {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 9px 12px;
    font: 600 12px/1 Arial, Helvetica, sans-serif;
    color: #555;
    background: #fff;
    border: 1px solid #cdcdcd;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.mv-cbar__hide:hover, .mv-cbar__hide:focus { color: #222; border-color: #999; background: #f6f6f6; }

/* Re-open bar — a full-width line pinned to the bottom while the tray is hidden. */
.mv-cbar-reopen {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 9499;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 16px;
    font: 700 13px/1 Arial, Helvetica, sans-serif;
    color: #fff;
    background: var(--site-button-bg, #2f80ed);
    border: 0;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, .18);
}
.mv-cbar-reopen.is-on { display: flex; }
.mv-cbar-reopen:hover { filter: brightness(.94); }

@media (max-width: 767px) {
    .mv-cbar__inner { gap: 8px; padding: 8px 10px; }
    .mv-cbar__thumb { width: 52px; height: 44px; }
    .mv-cbar__go { padding: 9px 14px; font-size: 13px; }
    .mv-cbar__hide { padding: 8px 9px; }
    .mv-cbar__hide span, .mv-cbar__hide { font-size: 11px; }
}

/* --- Fallback header badge (only matters if header-icons.css is absent) ----- */
.mv-hdr-compare {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.mv-hdr-compare .mv-icon-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
}
.mv-hdr-compare .mv-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    box-sizing: border-box;
    display: none;
    align-items: center;
    justify-content: center;
    background: #d0021b;
    color: #fff;
    font: 700 11px/1 Arial, Helvetica, sans-serif;
    border-radius: 999px;
    border: 2px solid #fff;
    z-index: 2;
    pointer-events: none;
}
.mv-hdr-compare .mv-badge.is-on {
    display: inline-flex;
}

/* ==========================================================================
   Compare cap TOOLTIP — anchored to the clicked compare control when the user
   tries to add a 7th product. Replaces the old blocking alert() popup.
   ========================================================================== */
.mv-cmp-tip {
    position: fixed;
    z-index: 100000;
    max-width: 240px;
    background: #c0392b;
    color: #fff;
    font: 600 12px/1.35 Arial, Helvetica, sans-serif;
    padding: 8px 11px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    pointer-events: none;
}
.mv-cmp-tip.is-on {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
