/* Bid history ribbon (catalogue-group.aspx)
   Lots bid on while the page is open, newest first.
   >= 1500px: right of the lots, starting level with the first row and following the user down as they scroll
              (top/left and how many lots fit set by positionBidRibbon()/fitBidRibbon() in catalogue-group.aspx).
   <  1500px: bar along the bottom, as many lots as fit across the width (fitBidRibbon).
   Colours come from the site's .btn-primary (setBidRibbonColours() sets --bid-ribbon-rgb / --bid-ribbon-text):
   title 0.8 opacity, bids 0.5 opacity. Defaults below are used until then.
   z-index sits below .sidepanel (200) and .openbtn (201). */
:root {
    --bid-ribbon-rgb: 50, 50, 76;
    --bid-ribbon-text: #fff;
}

.bid-ribbon {
    display: none;
    position: fixed;
    z-index: 199;
    background: transparent;
    color: var(--bid-ribbon-text);
    border: 1px solid rgb(var(--bid-ribbon-rgb));
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    line-height: 1.3;
}
.bid-ribbon.bid-ribbon-show { display: block; }

.bid-ribbon-title {
    font-weight: bold;
    background: rgba(var(--bid-ribbon-rgb), 0.8);
    color: var(--bid-ribbon-text);
    white-space: nowrap;
}
.bid-ribbon-close,
.bid-ribbon-close:visited {
    font-size: 20px;
    line-height: 1;
    color: var(--bid-ribbon-text);
    text-decoration: none;
}
.bid-ribbon-close:hover, .bid-ribbon-close:focus { color: var(--bid-ribbon-text); opacity: 0.7; text-decoration: none; }

.bid-ribbon-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(var(--bid-ribbon-rgb), 0.5);
}
.bid-ribbon-list li a,
.bid-ribbon-list li a:visited {
    display: block;
    padding: 6px 8px;
    color: var(--bid-ribbon-text);
    text-decoration: none;
    white-space: nowrap;
}
.bid-ribbon-list li a:hover, .bid-ribbon-list li a:focus { background: rgba(var(--bid-ribbon-rgb), 0.3); color: var(--bid-ribbon-text); text-decoration: none; }
/* two rows per lot: lot + amount, then time since the bid */
.bid-ribbon-row { display: flex; justify-content: space-between; }
.bid-ribbon-lot { font-weight: bold; margin-right: 8px; }
.bid-ribbon-ago { display: block; font-size: 11px; opacity: 0.85; }
.bid-ribbon-new { animation: bidRibbonFlash 1.5s ease-out; }
@keyframes bidRibbonFlash { from { background: rgba(var(--bid-ribbon-rgb), 0.9); } to { background: transparent; } }

/* Lot highlight after clicking a ribbon entry: held for 3s (long scrolls on mobile) then fades over 2s */
.bid-ribbon-focus { animation: bidRibbonFocus 5s ease-out; }
@keyframes bidRibbonFocus { 0%, 60% { box-shadow: 0 0 0 4px rgb(var(--bid-ribbon-rgb)); } 100% { box-shadow: 0 0 0 4px transparent; } }

/* >= 1500px: column to the right of the 1170px container */
@media (min-width: 1500px) {
    .bid-ribbon {
        top: 10px;
        right: 4px;
        width: 145px;
        border-radius: 4px;
        overflow: hidden;
    }
    .bid-ribbon-title {
        display: block;
        padding: 6px 28px 6px 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    }
    .bid-ribbon-close { position: absolute; top: 4px; right: 8px; }
    .bid-ribbon-list li + li { border-top: 1px solid rgba(255, 255, 255, 0.3); }
}

/* < 1500px: single row along the bottom */
@media (max-width: 1499px) {
    .bid-ribbon {
        left: 0;
        right: 0;
        bottom: 0;
        border-width: 1px 0 0 0;
    }
    .bid-ribbon.bid-ribbon-show { display: flex; align-items: stretch; }
    .bid-ribbon-title {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        padding: 0 10px;
        border-right: 1px solid rgba(255, 255, 255, 0.3);
    }
    .bid-ribbon-list {
        flex: 1 1 auto;
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .bid-ribbon-list li { flex: 1 0 auto; }   /* the lots shown share the full width of the bar */
    .bid-ribbon-list li + li { border-left: 1px solid rgba(255, 255, 255, 0.3); }
    .bid-ribbon-list li a { padding: 5px 10px; }
    .bid-ribbon-close {
        order: 3;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        padding: 0 12px;
        background: rgba(var(--bid-ribbon-rgb), 0.8);
        border-left: 1px solid rgba(255, 255, 255, 0.3);
    }
    body.bid-ribbon-on { padding-bottom: 50px; }
}

@media (max-width: 767px) {
    .bid-ribbon-title { display: none !important; }
}

/* Message shown for 5 seconds (e.g. filtered lot opened in a new tab) */
.bid-ribbon-msg {
    display: none;
    position: fixed;
    z-index: 1060;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    padding: 10px 16px;
    border-radius: 4px;
    background: #333;
    color: #fff;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.bid-ribbon-msg.bid-ribbon-msg-show { display: block; }
