/**
 * Cart Drawer - slide-out panel styling.
 * Trello: "Slide out/drawer cart on website built based on new cart page".
 * Markup comes from rt_cart_drawer_contents() in functions.php.
 *
 * SPECIFICITY NOTE: style.css declares `div#cartPopupContainer` with
 * !important on position, right, background, z-index and max-width, plus
 * blanket `div#cartPopupContainer p / a { font-size: 18px !important }` sized
 * for the old two-line stub. Every selector here is therefore prefixed with
 * `body` to outrank (0,1,1) with (0,1,2), and any declaration competing with
 * one of those !important rules carries !important itself. Do not "tidy" the
 * body prefix or the !important flags away - the panel reverts to an absolute
 * dropdown with 18px text.
 */

body div#cartPopupContainer {
    position: fixed !important;
    top: 0;
    right: 0 !important;
    bottom: 0;
    width: 390px !important;
    max-width: 100vw !important;
    height: 100vh;
    z-index: 100000 !important;
    display: flex !important;
    flex-direction: column;
    padding: 18px 18px 22px !important;
    background: #171615 !important;
    color: #F6F4F2;
    text-align: left;
    box-shadow: -4px 0 26px rgba(0, 0, 0, 0.5);
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.28s ease, visibility 0.28s ease;
    overflow: hidden;
}

/* d-none is the open/closed flag the existing scripts toggle (cartPopup() and
   the outside-click handler in snippet 172114). MDB defines it as
   display:none !important, which cannot animate - so it is overridden here to
   slide the panel off-canvas instead. This keeps all existing JS untouched. */
body div#cartPopupContainer.d-none {
    display: flex !important;
    transform: translateX(100%);
    visibility: hidden;
}

/* Neutralise the theme's blanket p / a sizing inside the panel. Rules below
   that target a <p> or an <a> set their own size with !important. */
body div#cartPopupContainer p,
body div#cartPopupContainer a {
    font-size: inherit !important;
    margin: 0 !important;
}

body div#cartPopupContainer h3 {
    flex: 0 0 auto;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
    font-size: 18px;
    color: #F6F4F2;
}

/* Body splits into a scrolling item list and a pinned totals block. */
body div#cartPopupContainer .rt-drawer-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body div#cartPopupContainer .rt-drawer-items {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    margin-right: -8px;
    padding-right: 8px;
}

/* ---- Line items ---- */

body div#cartPopupContainer .rt-drawer-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
}

body div#cartPopupContainer .rt-drawer-item__thumb {
    flex: 0 0 64px;
    width: 64px;
}

body div#cartPopupContainer .rt-drawer-item__thumb img {
    width: 64px;
    height: auto;
    display: block;
    border-radius: 3px;
}

body div#cartPopupContainer .rt-drawer-item__details {
    flex: 1 1 auto;
    min-width: 0;
}

body div#cartPopupContainer .rt-drawer-item__name {
    font-size: 13px;
    line-height: 1.35;
}

body div#cartPopupContainer .rt-drawer-item__name a {
    font-size: 13px !important;
    color: #F6F4F2 !important;
    text-decoration: none !important;
}

body div#cartPopupContainer .rt-drawer-item__name a:hover {
    color: #ee2d33 !important;
}

body div#cartPopupContainer .rt-drawer-item__name .product-sku,
body div#cartPopupContainer .rt-drawer-item__meta {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.4;
    color: #9d9d9d;
}

body div#cartPopupContainer .rt-drawer-item__meta p {
    font-size: 11px !important;
    margin: 0 !important;
}

/* Backorder and made-to-order warnings. These carry the lead-time information
   that used to arrive via the add-to-cart notice, so they must stay legible -
   red, not muted grey like the SKU and colour lines above them. */
body div#cartPopupContainer .rt-drawer-item__notice {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.35;
    color: #ee6b6f;
}

body div#cartPopupContainer .rt-drawer-item__notice i {
    margin-top: 1px;
    flex: 0 0 auto;
}

body div#cartPopupContainer .rt-drawer-item__notice span {
    font-size: 11px;
}

body div#cartPopupContainer .rt-drawer-item__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

body div#cartPopupContainer .rt-drawer-item__qty {
    display: flex;
    align-items: center;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
}

body div#cartPopupContainer .rt-qty-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #F6F4F2;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

body div#cartPopupContainer .rt-qty-btn:hover {
    color: #ee2d33;
}

body div#cartPopupContainer .rt-qty-value {
    min-width: 26px;
    text-align: center;
    font-size: 13px;
}

body div#cartPopupContainer .rt-qty-fixed {
    padding: 0 8px;
    line-height: 26px;
}

body div#cartPopupContainer .rt-drawer-item__subtotal {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

body div#cartPopupContainer .rt-drawer-item__remove {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8a8a8a;
    cursor: pointer;
}

body div#cartPopupContainer .rt-drawer-item__remove:hover {
    color: #ee2d33;
}

/* ---- Totals ---- */

body div#cartPopupContainer .rt-drawer-totals {
    flex: 0 0 auto;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #333;
}

body div#cartPopupContainer .rt-drawer-coupon {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

body div#cartPopupContainer .rt-drawer-coupon input {
    flex: 1 1 auto;
    min-width: 0;
    height: 34px;
    padding: 0 8px;
    font-size: 12px;
    color: #F6F4F2;
    background: #1f1e1d;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
}

body div#cartPopupContainer .rt-drawer-coupon button {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
    border: 0;
    border-radius: 3px;
    background: #3a3a3a;
    color: #F6F4F2;
    cursor: pointer;
}

body div#cartPopupContainer .rt-drawer-coupon button:hover {
    background: #ee2d33;
}

body div#cartPopupContainer .rt-drawer-applied-coupons {
    margin: -6px 0 10px;
}

body div#cartPopupContainer .rt-drawer-applied-coupon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 6px 6px 0;
    padding: 3px 8px;
    font-size: 11px;
    text-transform: uppercase;
    background: #2a2a2a;
    border-radius: 3px;
}

body div#cartPopupContainer .rt-drawer-applied-coupon a {
    font-size: 14px !important;
    line-height: 1 !important;
    color: #9d9d9d !important;
    text-decoration: none !important;
}

body div#cartPopupContainer .rt-drawer-applied-coupon a:hover {
    color: #ee2d33 !important;
}

body div#cartPopupContainer .rt-drawer-totals-table {
    width: 100%;
    margin: 0 0 12px;
    font-size: 13px;
    border: 0;
}

body div#cartPopupContainer .rt-drawer-totals-table tr {
    border: 0;
}

body div#cartPopupContainer .rt-drawer-totals-table th,
body div#cartPopupContainer .rt-drawer-totals-table td {
    padding: 4px 0;
    border: 0;
    background: transparent;
    font-weight: 400;
    font-size: 13px;
    color: #F6F4F2;
}

body div#cartPopupContainer .rt-drawer-totals-table td {
    text-align: right;
}

body div#cartPopupContainer .rt-drawer-totals-table tr.order-total th,
body div#cartPopupContainer .rt-drawer-totals-table tr.order-total td {
    padding-top: 10px;
    border-top: 1px solid #333;
    font-size: 15px;
    font-weight: 700;
}

body div#cartPopupContainer .rt-drawer-shipping-note {
    color: #9d9d9d;
    font-size: 12px;
}

/* ---- Actions ---- */

body div#cartPopupContainer .rt-drawer-checkout {
    display: block !important;
    width: 100%;
    margin: 0 0 8px !important;
    padding: 12px 0 !important;
    text-align: center !important;
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #ee2d33 !important;
    color: #fff !important;
    border: 0;
    border-radius: 3px;
    text-decoration: none !important;
}

body div#cartPopupContainer .rt-drawer-checkout:hover {
    background: #c9252a !important;
    color: #fff !important;
}

body div#cartPopupContainer .rt-drawer-secondary {
    display: block !important;
    text-align: center !important;
    font-size: 12px !important;
    color: #9d9d9d !important;
    text-decoration: underline !important;
}

body div#cartPopupContainer .rt-drawer-secondary:hover {
    color: #F6F4F2 !important;
}

body div#cartPopupContainer .rt-drawer-empty {
    margin: 24px 0 16px !important;
    text-align: center !important;
    font-size: 14px !important;
    color: #9d9d9d;
}

/* Dim the panel while an update is in flight. */
body div#cartPopupContainer.rt-drawer--busy .rt-drawer-body {
    opacity: 0.5;
    pointer-events: none;
}

body div#cartPopupContainer .rt-drawer-message {
    margin: 0 0 10px !important;
    padding: 8px 10px;
    font-size: 12px;
    background: #3a1f20;
    border-left: 3px solid #ee2d33;
    color: #f3d6d7;
}

/* ---- Small screens ---- */

@media (max-width: 480px) {
    body div#cartPopupContainer {
        width: 100vw !important;
        padding: 16px 14px 18px !important;
    }

    body div#cartPopupContainer .rt-drawer-item__thumb,
    body div#cartPopupContainer .rt-drawer-item__thumb img {
        flex-basis: 56px;
        width: 56px;
    }
}

/* ---- Drawer controls: red squares, stated outright ----
 *
 * These buttons used to get their red from the theme's global rule
 *   button:not(.gpay-card-info-container, .drawer-button) { background: red !important }
 * while the rules above asked for `transparent`. The red was therefore an
 * accident of that !important, not a decision - and it is the look everyone is
 * used to, so it is now set here on purpose.
 *
 * The buttons carry the `drawer-button` class, which opts them out of that
 * global rule entirely, so nothing here depends on it any more.
 *
 * !important on the geometry because the CHECKOUT page's own styles are
 * stronger than elsewhere: they were stretching these to 32x26 with 6px
 * corners, so the same markup looked right on the cart page and wrong at
 * checkout. Stating the size here keeps both identical.
 */
body div#cartPopupContainer .rt-qty-btn,
body div#cartPopupContainer .rt-drawer-item__remove {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ee2d33 !important;
    color: #fff !important;
    font-size: 14px !important;
    line-height: 1 !important;
    cursor: pointer;
}

body div#cartPopupContainer .rt-qty-btn:hover,
body div#cartPopupContainer .rt-drawer-item__remove:hover {
    background: #d4262c !important;
    color: #fff !important;
}

/* ======================================================================
 * 2026-11-23 port (Josef, Trello Oct 23): "style it closer to the mobile cart page but slim it down a
 * little so each card is a little shorter". Each part is a rounded card like the cart page's, with
 * tighter padding; free-shipping bar and bike headings on top.
 * ====================================================================== */
body div#cartPopupContainer { background: #121212 !important; }
body div#cartPopupContainer .rt-drawer-items { padding-top: 2px; }
body div#cartPopupContainer .rt-drawer-item {
    position: relative;
    gap: 10px;
    margin: 0 0 8px;
    padding: 9px 34px 9px 9px;
    background: #1e1e1e;
    border: 1px solid #2c2c2c;
    border-radius: 9px;
}
body div#cartPopupContainer .rt-drawer-item__thumb,
body div#cartPopupContainer .rt-drawer-item__thumb img { flex-basis: 56px; width: 56px; }
body div#cartPopupContainer .rt-drawer-item__thumb img { background: #fff; border-radius: 6px; }
body div#cartPopupContainer .rt-drawer-item__name,
body div#cartPopupContainer .rt-drawer-item__name a { font-weight: 700; font-size: 12.5px !important; line-height: 1.3; }
body div#cartPopupContainer .rt-drawer-item__meta { margin-top: 2px; font-size: 11px; }
body div#cartPopupContainer .rt-drawer-item__meta dl { margin: 0; }
body div#cartPopupContainer .rt-drawer-item__meta dt,
body div#cartPopupContainer .rt-drawer-item__meta dd { display: inline; margin: 0; float: none; font-weight: 400; }
body div#cartPopupContainer .rt-drawer-item__meta dd::after { content: ""; display: block; }
body div#cartPopupContainer .rt-drawer-item__row { margin-top: 6px; }
body div#cartPopupContainer .rt-drawer-item__qty { background: #151515; border-color: #333; border-radius: 6px; overflow: hidden; }
body div#cartPopupContainer .rt-qty-btn { background: transparent !important; color: #cfcfcf !important; width: 28px !important; height: 26px !important; }
body div#cartPopupContainer .rt-qty-btn:hover { background: #ee2d33 !important; color: #fff !important; }
body div#cartPopupContainer .rt-drawer-item__subtotal { color: #ee2d33; font-size: 14px; font-weight: 700; }
body div#cartPopupContainer .rt-drawer-item__remove {
    position: absolute !important; top: 7px; right: 6px;
    width: 24px !important; height: 24px !important; min-width: 24px !important;
    background: transparent !important; color: #ee2d33 !important; font-size: 14px !important;
}
body div#cartPopupContainer .rt-drawer-item__remove:hover { background: #ee2d33 !important; color: #fff !important; border-radius: 4px !important; }
body div#cartPopupContainer .rt-drawer-item.is-new { border-color: #2f9e52; box-shadow: 0 0 0 1px #2f9e52; transition: box-shadow .6s, border-color .6s; }

body div#cartPopupContainer .rt-drawer-group {
    margin: 4px 0 6px; padding: 5px 9px;
    background: #143d22; border: 1px solid #2f9e52; border-radius: 6px;
    color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .3px;
}

body div#cartPopupContainer .rt-drawer-ship {
    flex: 0 0 auto; margin: 0 0 10px; padding: 9px 10px 10px;
    background: #1e1e1e; border: 1px solid #2c2c2c; border-radius: 9px;
}
body div#cartPopupContainer .rt-drawer-ship__text { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.3; color: #F6F4F2; }
body div#cartPopupContainer .rt-drawer-ship__text i { color: #ee2d33; font-size: 14px; }
body div#cartPopupContainer .rt-drawer-ship__text strong { color: #ee2d33; }
body div#cartPopupContainer .rt-drawer-ship__bar { height: 6px; margin-top: 7px; background: #333; border-radius: 3px; overflow: hidden; }
body div#cartPopupContainer .rt-drawer-ship__bar span { display: block; height: 100%; background: linear-gradient(90deg, #b81d22, #ee2d33); border-radius: 3px; }

/* Phones: the drawer now lives at the page body level (moved there by the script), full width. */
@media (max-width: 991px) {
    body div#cartPopupContainer { width: 100vw !important; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)) !important; }
}
body div#cartPopupContainer .rt-drawer-close {
    position: absolute; top: 10px; right: 10px;
    width: 34px !important; height: 34px !important; min-width: 0 !important; padding: 0 !important;
    background: transparent !important; color: #F6F4F2 !important; border: 0 !important; box-shadow: none !important;
    font-size: 26px !important; line-height: 1 !important; cursor: pointer;
}
body div#cartPopupContainer .rt-drawer-close:hover { color: #ee2d33 !important; }
body div#cartPopupContainer h3 { padding-right: 40px; }
/* a dimmed page behind the open drawer */
.rt-drawer-scrim { position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, .55); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.rt-drawer-scrim.is-on { opacity: 1; visibility: visible; }

/* "View Wishlist" (snippet 155939 appends it to the popup): a quiet link under View Cart, not a big
   red button hanging off the bottom of the drawer. */
body div#cartPopupContainer > div:last-child > br { display: none; }
body div#cartPopupContainer a.wishlist-button { display: block !important; margin-top: 6px !important; text-align: center; text-decoration: none !important; }
body div#cartPopupContainer a.wishlist-button button {
    display: inline-flex !important; align-items: center; gap: 6px;
    width: auto !important; height: auto !important; padding: 4px 8px !important; margin: 0 !important;
    background: transparent !important; color: #9d9d9d !important; border: 0 !important; box-shadow: none !important;
    font-family: inherit !important; font-size: 12px !important; letter-spacing: 0 !important; text-transform: none !important;
}
body div#cartPopupContainer a.wishlist-button button:hover { color: #ee2d33 !important; }
