﻿/* ============================================================================
   « Racheter » — bouton d'en-tête + tiroir des produits déjà commandés.
   Le bouton reprend la grammaire des autres éléments d'en-tête (icône mdi
   noire + pastille ronde #0091b5), pour ne pas ressembler à une pièce rapportée.
   ========================================================================== */

/* --- déclencheur dans l'en-tête ------------------------------------------ */
.racheter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 0 0 15px;
    color: #000;
    text-decoration: none;
    line-height: 1;
}
.racheter-trigger:hover,
.racheter-trigger:focus { color: #0091b5; text-decoration: none; }

.racheter-trigger-icon { position: relative; display: inline-flex; }
.racheter-trigger-icon .mdi { color: inherit; font-size: 34px; line-height: 1; }

.racheter-trigger-count {
    position: absolute;
    top: -2px;
    right: -6px;
    border-radius: 100%;
    background: #0091b5;
    color: #fff;
    font-size: 9px;
    font-weight: 300;
    width: 18px;
    height: 18px;
    line-height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.racheter-trigger-label { font-size: 13px; font-weight: 600; }

@media (max-width: 991.98px) {
    .racheter-trigger { padding-left: 8px; }
    .racheter-trigger-icon .mdi { font-size: 30px; }
}

/* --- tiroir --------------------------------------------------------------- */
.racheter-panel {
    width: 420px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: #fff;
}
@media (max-width: 575.98px) { .racheter-panel { width: 100vw; } }

.racheter-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid #e3e9ea;
    flex: none;
}
.racheter-title { font-size: 20px; font-weight: 700; line-height: 1.15; color: #1d1f20; }
.racheter-sub { font-size: 12.8px; line-height: 1.45; color: #61727a; margin-top: 3px; max-width: 30ch; }

.racheter-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.racheter-zone { padding: 13px 16px 2px; }
.racheter-zone-title {
    font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
    color: #6c7c82; padding-bottom: 7px;
}

.racheter-row {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 11px 0; border-bottom: 1px solid #eef2f3;
}
.racheter-row:last-child { border-bottom: none; }
.racheter-row.is-off { opacity: .55; }
.racheter-row.is-off .racheter-thumb img { filter: grayscale(1); }

.racheter-thumb {
    width: 52px; height: 52px; flex: none;
    border: 1px solid #eef2f3; border-radius: 4px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.racheter-thumb img { max-width: 100%; max-height: 100%; }

.racheter-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.racheter-name {
    font-size: 13.2px; font-weight: 600; line-height: 1.3; color: #1d1f20;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    text-decoration: none;
}
.racheter-name:hover { color: #0091b5; text-decoration: none; }
.racheter-meta { font-size: 11.4px; color: #6c7c82; font-variant-numeric: tabular-nums; }
.racheter-off-label { font-size: 11.6px; color: #a63a2c; font-weight: 600; }

/* --- prix, quantité, ajout ------------------------------------------------ */
.racheter-actions {
    display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap;
}
.racheter-price {
    font-size: 14px; font-weight: 700; color: #1d1f20;
    font-variant-numeric: tabular-nums; margin-right: auto; white-space: nowrap;
}
.racheter-stepper {
    display: inline-flex; align-items: center; flex: none;
    border: 1px solid #dde5e8; border-radius: 16px; height: 30px; background: #fff;
}
.racheter-step {
    width: 27px; height: 28px; border: 0; background: none; color: #61727a;
    font-size: 16px; line-height: 1; padding: 0; cursor: pointer;
}
.racheter-step:hover { color: #0091b5; }
.racheter-qty {
    width: 26px; border: 0; background: none; text-align: center;
    font-size: 13px; font-weight: 600; color: #1d1f20;
    font-variant-numeric: tabular-nums; padding: 0;
}
.racheter-qty:focus { outline: none; }

.racheter-add {
    flex: none; border: 0; border-radius: 16px; height: 30px; padding: 0 15px;
    background: #0091b5; color: #fff; font-size: 12.8px; font-weight: 700; cursor: pointer;
}
.racheter-add:hover { background: #007b99; }
.racheter-add.is-done { background: #e6f4f8; color: #00647d; }
.racheter-add[disabled] { opacity: .6; cursor: default; }

/* --- pied ----------------------------------------------------------------- */
.racheter-foot {
    flex: none; border-top: 1px solid #e3e9ea; padding: 13px 16px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    font-size: 12.5px; color: #6c7c82;
}
.racheter-foot-link { color: #0091b5; font-weight: 700; }
.racheter-foot-link:hover { color: #007b99; }

/* ============================================================================
   Bulle d'amorçage — attire l'attention pendant la navigation, une seule fois
   par page, trois fois au maximum dans la vie du compte.
   ========================================================================== */
.racheter-bulle {
    position: fixed;
    /* Au-dessus des widgets flottants tiers : ShareThis passait par-dessus le tiroir
       (« 354 Partages » sur la capture du 28/08). Il est eteint, mais un chat en direct
       ou un bandeau de consentement reposerait le probleme. */
    z-index: 100000;
    width: 306px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #dde5e8;
    border-radius: 10px;
    box-shadow: 0 18px 44px -18px rgba(21, 27, 29, .45);
    padding: 15px 16px 14px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .28s ease, transform .28s ease;
}
.racheter-bulle.is-visible { opacity: 1; transform: translateY(0); }

.racheter-bulle-fleche {
    position: absolute;
    top: -7px;
    width: 13px; height: 13px;
    background: #fff;
    border-left: 1px solid #dde5e8;
    border-top: 1px solid #dde5e8;
    transform: rotate(45deg);
    border-radius: 2px 0 0 0;
}
.racheter-bulle-x {
    position: absolute; top: 6px; right: 8px;
    border: 0; background: none; color: #9aa8ad;
    font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 5px;
}
.racheter-bulle-x:hover { color: #1d1f20; }

.racheter-bulle-titre {
    font-size: 15px; font-weight: 700; color: #1d1f20;
    line-height: 1.25; padding-right: 18px;
}
.racheter-bulle-texte {
    font-size: 12.6px; line-height: 1.45; color: #61727a; margin-top: 5px;
}

.racheter-bulle-produits {
    display: flex; align-items: center; gap: 6px; margin-top: 11px;
}
.racheter-bulle-vignette {
    width: 42px; height: 42px; flex: none;
    border: 1px solid #eef2f3; border-radius: 6px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; background: #fff;
}
.racheter-bulle-vignette img { max-width: 100%; max-height: 100%; }
.racheter-bulle-reste {
    font-size: 12px; font-weight: 700; color: #0091b5;
    font-variant-numeric: tabular-nums;
}

.racheter-bulle-actions { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.racheter-bulle-ok {
    flex: 1 1 auto; border: 0; border-radius: 18px; height: 34px;
    background: #0091b5; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
}
.racheter-bulle-ok:hover { background: #007b99; }
.racheter-bulle-plus-tard {
    flex: none; border: 0; background: none; color: #6c7c82;
    font-size: 12.5px; cursor: pointer; padding: 0 4px;
}
.racheter-bulle-plus-tard:hover { color: #1d1f20; text-decoration: underline; }

/* Halo discret sur le bouton tant que la bulle est en cours de vie */
.racheter-trigger.is-signale .racheter-trigger-count {
    box-shadow: 0 0 0 0 rgba(0, 145, 181, .6);
    animation: racheter-pulse 2.2s ease-out 3;
}
@keyframes racheter-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0, 145, 181, .55); }
    70%  { box-shadow: 0 0 0 11px rgba(0, 145, 181, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 145, 181, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .racheter-bulle { transition: none; }
    .racheter-trigger.is-signale .racheter-trigger-count { animation: none; }
}
