/* Sticky product bar height. Declared at :root, not on .crozus-sticky-bar: custom properties
   inherit down the tree, and Chaty / back-to-top are body-level siblings of the bar, so a
   declaration on the bar itself was never visible to them. Overridden per breakpoint below,
   which is why this base value has to come first in source order. */
:root { --cz-h: 64px; }

/* ============================================================
   STICKY PRODUCT BAR (1.4.1)
   Replaces the floating cart button, which collided with Chaty.

   Type and colour are taken from the product summary rather than
   invented: the same Jost stack, the same #f44336 discount chip,
   the same struck-grey / solid-black price pairing. The bar should
   read as the product page following you down, not as a new UI.
   ============================================================ */

.crozus-sticky-bar {
    --cz-ink: #111111;
    --cz-muted: #8a8a8a;
    --cz-hairline: #e4e4e4;
    --cz-chip: #f44336;
    --cz-buy: #6CA300;
    --cz-buy-hover: #5a8800;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999990;                    /* below SCF confirmation (1000000) */
    background: #fff;
    border-top: 1px solid var(--cz-hairline);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .07);
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;
    transform: translate3d(0, 110%, 0);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    visibility: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.crozus-sticky-bar.is-visible {
    transform: none;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .crozus-sticky-bar { transition: none; }
}

.crozus-sticky-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ---------- left: what you are buying ---------- */

.crozus-sticky-product {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;                       /* lets the title actually truncate */
}

.crozus-sticky-thumb {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    object-fit: cover;
    border: 1px solid #f0f0f0;
    border-radius: 3px;
    background: #fafafa;
}

.crozus-sticky-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.crozus-sticky-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--cz-muted);
    letter-spacing: .01em;
    line-height: 1.3;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crozus-sticky-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 1.15;
}

.crozus-sticky-price-value {
    font-size: 19px;
    font-weight: 700;
    color: var(--cz-ink);
}

.crozus-sticky-bar .crozus-sticky-price-value del,
.crozus-sticky-bar .crozus-sticky-price-value del .amount,
.crozus-sticky-bar .crozus-sticky-price-value del .woocommerce-Price-amount {
    font-size: 14px !important;
    font-weight: 400 !important;
    color: var(--cz-muted) !important;
    margin-right: 5px;
}

.crozus-sticky-bar .crozus-sticky-price-value ins,
.crozus-sticky-bar .crozus-sticky-price-value ins .amount,
.crozus-sticky-bar .crozus-sticky-price-value ins .woocommerce-Price-amount {
    text-decoration: none !important;
    font-weight: 700 !important;
    color: var(--cz-ink) !important;
}

.crozus-sticky-chip {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 3px;
    background: var(--cz-chip);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: .02em;
}

.crozus-sticky-chip.is-hidden { display: none; }

/* ---------- right: the controls ---------- */

.crozus-sticky-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
}

.crozus-sticky-qty {
    display: flex;
    align-items: stretch;
    flex: 0 0 auto;
    height: 44px;
    border: 1px solid var(--cz-hairline);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.crozus-sticky-bar .crozus-sticky-step {
    width: 36px;
    flex: 0 0 36px;
    border: 0 !important;
    background: transparent !important;
    color: var(--cz-ink) !important;
    font-size: 17px;
    line-height: 1;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color .18s ease;
}

.crozus-sticky-bar .crozus-sticky-step:hover { background: #f5f5f5 !important; }

/* Flatsome's base form styles set input width to 100%, which is why an
   unqualified width here was ignored and the field ballooned. */
.crozus-sticky-bar .crozus-sticky-qty-input {
    width: 44px !important;
    flex: 0 0 44px !important;
    height: 42px !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: center !important;
    font-family: inherit !important;
    font-size: 16px !important;         /* below 16px iOS zooms the page on focus */
    font-weight: 500 !important;
    color: var(--cz-ink) !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.crozus-sticky-bar .crozus-buy-now-btn {
    flex: 0 0 auto !important;
    min-width: 190px !important;
    height: 44px !important;
    line-height: 44px !important;
    margin: 0 !important;
    padding: 0 26px !important;
    border-radius: 4px !important;
    background-color: var(--cz-buy) !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    letter-spacing: .07em !important;
    text-transform: uppercase !important;
}

.crozus-sticky-bar .crozus-buy-now-btn:hover {
    background-color: var(--cz-buy-hover) !important;
}

.crozus-sticky-bar .crozus-sticky-cart {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 44px;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--cz-hairline) !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: var(--cz-ink) !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease;
}

.crozus-sticky-bar .crozus-sticky-cart:hover {
    border-color: #bdbdbd !important;
    background: #fafafa !important;
}

.crozus-sticky-bar .crozus-sticky-cart svg {
    width: 21px !important;
    height: 21px !important;
}

.crozus-sticky-bar .crozus-sticky-cart .scf-count {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 19px;
    background: var(--cz-ink);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 19px;
    text-align: center;
}

/* A badge reading "0" is noise; the class is kept in sync from JS. */
.crozus-sticky-bar .crozus-sticky-cart.is-zero .scf-count { display: none; }

.crozus-sticky-bar :focus-visible {
    outline: 2px solid var(--cz-ink);
    outline-offset: 2px;
}

.crozus-sticky-error {
    margin: 0 0 8px !important;
    font-size: 13px;
}

/* ---------- phones ----------
   Two rows, never three. The title is dropped and the thumbnail
   kept instead: on a product page the shopper already knows what
   they are looking at, and a 46px image says it in a fraction of
   the width. Struck price, selling price and discount chip are
   locked onto one line with nowrap so they cannot ladder. */

@media (max-width: 699px) {
    :root { --cz-h: 96px; }

    .crozus-sticky-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 7px 12px;
    }

    .crozus-sticky-product {
        gap: 10px;
        align-items: center;
    }

    .crozus-sticky-thumb {
        display: block;
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    .crozus-sticky-title { display: none; }

    .crozus-sticky-meta {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        min-width: 0;
        flex: 1 1 auto;
    }

    /* Thumbnail anchors the left edge, everything else is set flush right so the
       line reads as one block against the margin instead of drifting mid-row. */
    .crozus-sticky-price {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        white-space: nowrap;
        min-width: 0;
        text-align: right;
    }

    .crozus-sticky-price-value {
        font-size: 17px;
        white-space: nowrap;
    }

    /* WooCommerce wraps each amount in its own element; keep them inline
       or the struck price and the selling price fall onto separate lines. */
    .crozus-sticky-bar .crozus-sticky-price-value del,
    .crozus-sticky-bar .crozus-sticky-price-value ins,
    .crozus-sticky-bar .crozus-sticky-price-value .woocommerce-Price-amount {
        display: inline !important;
        white-space: nowrap !important;
    }

    .crozus-sticky-bar .crozus-sticky-price-value del,
    .crozus-sticky-bar .crozus-sticky-price-value del .amount,
    .crozus-sticky-bar .crozus-sticky-price-value del .woocommerce-Price-amount {
        font-size: 12.5px !important;
        margin-right: 4px;
    }

    .crozus-sticky-chip {
        font-size: 10px;
        padding: 2px 6px;
    }

    .crozus-sticky-actions { gap: 6px; }

    /* Controls trimmed to 38px: still above the 36px comfortable-tap floor,
       but four pixels shorter each buys back a visible slice of the page. */
    .crozus-sticky-qty { height: 38px; }
    .crozus-sticky-bar .crozus-sticky-step { width: 32px; flex-basis: 32px; font-size: 16px; }
    .crozus-sticky-bar .crozus-sticky-qty-input { height: 36px !important; flex-basis: 40px !important; width: 40px !important; }

    .crozus-sticky-bar .crozus-buy-now-btn {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: 38px !important;
        line-height: 38px !important;
        padding: 0 16px !important;
        font-size: 12.5px !important;
    }

    .crozus-sticky-bar .crozus-sticky-cart {
        width: 44px;
        height: 38px;
    }

    .crozus-sticky-bar .crozus-sticky-cart svg { width: 19px !important; height: 19px !important; }
}

/* Very narrow handsets: shed the last few pixels rather than wrap. */
@media (max-width: 359px) {
    .crozus-sticky-thumb { display: none; }
    :root { --cz-h: 88px; }
    .crozus-sticky-price-value { font-size: 16px; }
}

/* ---------- coexisting with floating widgets ---------- */

/* Smart Cart Fusion's floating cart is z-index 99990; this bar is 999990. On a product page
   the FAB was both buried underneath the bar and redundant with .crozus-sticky-cart. */
body.crozus-sticky-active #scf-floating-wrap .scf-floating,
body.crozus-sticky-active .scf-floating {
    display: none !important;
}


/* Chaty positions itself with `#chaty-widget-0 .chaty-widget { bottom: 25px }`.
   That is an ID selector, so the earlier class-only rule here never applied and
   the bubble sat on top of the bar. Matching the ID is what makes this stick;
   the [id^=] variant covers a second Chaty instance with a different number. */
body.crozus-sticky-active [id^="chaty-widget-"] .chaty-widget,
body.crozus-sticky-active #chaty-widget-0 .chaty-widget,
body.crozus-sticky-active .chaty-widget,
body.crozus-sticky-active .chaty-btn-wrapper,
body.crozus-sticky-active #back-to-top {
    bottom: calc(var(--cz-h, 64px) + 18px) !important;
    transition: bottom .28s ease;
}

/* The expanded chat panel and its channel list ride the same offset. */
body.crozus-sticky-active [id^="chaty-widget-"] .chaty-chat-view {
    bottom: calc(var(--cz-h, 64px) + 76px) !important;
}

/* SCF confirmation sits above the sticky bar by z-index; no drawer/scroll-lock coupling. */
