
:root{
    --gg-drawer-green:#0f4d38;
    --gg-drawer-green-dark:#083728;
    --gg-drawer-cream:#fbf8ef;
    --gg-drawer-gold:#b58a32;
    --gg-drawer-border:rgba(24,67,46,.14);
    --gg-drawer-text:#18231c;
    --gg-drawer-muted:#6f776f;
}

html.gg-bag-open,
html.gg-bag-open body{overflow:hidden!important}

.gg-bag-overlay{
    position:fixed;
    inset:0;
    z-index:99997;
    background:rgba(11,19,14,.55);
    opacity:0;
    transition:opacity .22s ease;
}
.gg-bag-overlay.is-open{opacity:1}

.gg-bag-drawer{
    position:fixed;
    top:0;
    right:0;
    bottom:0;
    z-index:99998;
    width:min(470px,94vw);
    transform:translateX(102%);
    transition:transform .24s cubic-bezier(.22,.61,.36,1);
    pointer-events:none;
}
.gg-bag-drawer.is-open{
    transform:translateX(0);
    pointer-events:auto;
}
.gg-bag-drawer.is-updating{cursor:wait}

.gg-bag-drawer__inner{
    display:flex;
    flex-direction:column;
    width:100%;
    height:100%;
    background:#fff;
    box-shadow:-18px 0 48px rgba(0,0,0,.16);
}
.gg-bag-drawer__content{
    display:flex;
    flex-direction:column;
    min-height:100%;
    overflow:hidden;
}

.gg-bag-drawer__bar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:18px 21px 14px;
    border-bottom:1px solid var(--gg-drawer-border);
}
.gg-bag-drawer__bar>div{
    display:flex;
    align-items:baseline;
    gap:9px;
}
.gg-bag-drawer__eyebrow{
    color:var(--gg-drawer-green);
    font-size:14px;
    font-weight:950;
    letter-spacing:.035em;
}
.gg-bag-drawer__bar strong{
    color:var(--gg-drawer-muted);
    font-size:11px;
    font-weight:750;
}
.gg-bag-drawer__close{
    display:grid;
    place-items:center;
    width:38px;
    height:38px;
    padding:0;
    border:0;
    background:transparent;
    color:#111;
    font-size:29px;
    font-weight:300;
    cursor:pointer;
}

/* Real conversion threshold replaces Gymshark's shipping threshold. */
.gg-bag-progress{
    padding:13px 21px 12px;
    border-bottom:1px solid var(--gg-drawer-border);
    background:var(--gg-drawer-cream);
}
.gg-bag-progress__copy strong,
.gg-bag-progress__copy span{display:block}
.gg-bag-progress__copy strong{
    color:var(--gg-drawer-green-dark);
    font-size:12.5px;
}
.gg-bag-progress__copy span{
    margin-top:2px;
    color:var(--gg-drawer-muted);
    font-size:10.5px;
}
.gg-bag-progress__track{
    height:5px;
    margin-top:10px;
    overflow:hidden;
    border-radius:999px;
    background:#d9ddd8;
}
.gg-bag-progress__track span{
    display:block;
    height:100%;
    border-radius:inherit;
    background:var(--gg-drawer-green);
    transition:width .25s ease;
}
.gg-bag-progress__labels{
    display:flex;
    justify-content:space-between;
    margin-top:4px;
    color:#7b827c;
    font-size:9px;
    font-weight:700;
}

.gg-bag-drawer__items{
    flex:0 1 auto;
    max-height:34vh;
    overflow:auto;
    padding:4px 21px 0;
}
.gg-bag-item{
    display:grid;
    grid-template-columns:84px minmax(0,1fr);
    gap:13px;
    padding:16px 0;
    border-bottom:1px solid var(--gg-drawer-border);
}
.gg-bag-item__image{
    width:84px;
    height:84px;
    overflow:hidden;
    border-radius:6px;
    background:#f2efe7;
}
.gg-bag-item__image img{
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
}
.gg-bag-item__content{min-width:0}
.gg-bag-item__head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:9px;
}
.gg-bag-item__title{min-width:0}
.gg-bag-item__name{
    display:block;
    color:var(--gg-drawer-text)!important;
    font-size:12.5px;
    font-weight:900;
    line-height:1.3;
    text-decoration:none!important;
}
.gg-bag-item__variation{
    display:flex;
    flex-wrap:wrap;
    gap:0 7px;
    margin-top:4px;
    color:var(--gg-drawer-muted);
    font-size:10.5px;
    line-height:1.35;
}
.gg-bag-item__variation span+span:before{
    content:"·";
    margin-right:7px;
}
.gg-bag-item__price{
    flex:0 0 auto;
    color:var(--gg-drawer-text);
    font-size:12px;
    white-space:nowrap;
}
.gg-bag-item__controls{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-top:10px;
}
.gg-bag-qty{
    display:grid;
    grid-template-columns:30px 30px 30px;
    align-items:center;
    border:1px solid var(--gg-drawer-border);
    border-radius:4px;
    overflow:hidden;
}
.gg-bag-qty button,
.gg-bag-qty span{
    display:grid;
    place-items:center;
    height:28px;
    border:0;
    background:#fff;
    color:var(--gg-drawer-text);
    font-size:12px;
}
.gg-bag-qty button{
    cursor:pointer;
    font-size:16px;
}
.gg-bag-qty button:hover{background:#f5f3ec}
.gg-bag-remove{
    padding:0;
    border:0;
    background:transparent;
    color:#737b74;
    font-size:10px;
    font-weight:750;
    text-decoration:underline;
    text-underline-offset:2px;
    cursor:pointer;
}

/* Upsell block fills the otherwise dead drawer space. */
.gg-bag-upsell{
    flex:0 0 auto;
    padding:14px 21px 15px;
    border-top:1px solid var(--gg-drawer-border);
    border-bottom:1px solid var(--gg-drawer-border);
    background:#f8f8f6;
}
.gg-bag-upsell__head{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
}
.gg-bag-upsell__eyebrow{
    display:block;
    margin-bottom:2px;
    color:var(--gg-drawer-gold);
    font-size:8.5px;
    font-weight:950;
    letter-spacing:.12em;
}
.gg-bag-upsell__head h3{
    margin:0!important;
    color:var(--gg-drawer-text)!important;
    font-size:16px!important;
    line-height:1.1!important;
}
.gg-bag-upsell__hint{
    color:#7a817b;
    font-size:9.5px;
    white-space:nowrap;
}
.gg-bag-upsell__rail{
    display:grid;
    grid-auto-flow:column;
    grid-auto-columns:minmax(145px,1fr);
    gap:8px;
    overflow-x:auto;
    overscroll-behavior-inline:contain;
    scrollbar-width:thin;
    padding-bottom:3px;
}
.gg-bag-upsell-card{
    min-width:0;
    overflow:hidden;
    border:1px solid var(--gg-drawer-border);
    border-radius:6px;
    background:#fff;
}
.gg-bag-upsell-card__image{
    display:block;
    aspect-ratio:1/1;
    overflow:hidden;
    background:#f2efe7;
}
.gg-bag-upsell-card__image img{
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
}
.gg-bag-upsell-card__body{padding:8px}
.gg-bag-upsell-card__name{
    display:-webkit-box;
    overflow:hidden;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    min-height:31px;
    color:var(--gg-drawer-text)!important;
    font-size:10.5px;
    font-weight:850;
    line-height:1.35;
    text-decoration:none!important;
}
.gg-bag-upsell-card__price{
    margin-top:5px;
    color:var(--gg-drawer-text);
    font-size:10.5px;
    font-weight:900;
}
.gg-bag-upsell-card__cta{
    display:flex!important;
    align-items:center;
    justify-content:center;
    min-height:30px;
    margin-top:7px;
    padding:6px 8px;
    border-radius:4px;
    background:var(--gg-drawer-green)!important;
    color:#fff!important;
    font-size:9.5px;
    font-weight:900;
    text-decoration:none!important;
}

.gg-bag-drawer__footer{
    flex:0 0 auto;
    padding:14px 21px 17px;
    background:#fff;
}
.gg-bag-drawer__saving,
.gg-bag-drawer__total{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}
.gg-bag-drawer__saving{
    margin-bottom:6px;
    color:var(--gg-drawer-green);
    font-size:11px;
    font-weight:800;
}
.gg-bag-drawer__total{
    color:var(--gg-drawer-text);
}
.gg-bag-drawer__total span{
    font-size:13px;
    font-weight:850;
}
.gg-bag-drawer__total strong{
    font-size:18px;
}
.gg-bag-drawer__shipping{
    margin:4px 0 12px;
    color:var(--gg-drawer-green);
    font-size:10.5px;
    font-weight:850;
}
.gg-bag-drawer__checkout{
    display:flex!important;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:48px;
    padding:11px 16px;
    border-radius:4px;
    background:var(--gg-drawer-green)!important;
    color:#fff!important;
    font-size:13px;
    font-weight:950;
    text-decoration:none!important;
}
.gg-bag-drawer__checkout:hover{
    background:var(--gg-drawer-green-dark)!important;
}
.gg-bag-drawer__payments{
    display:block;
    width:auto;
    max-width:290px;
    max-height:31px;
    margin:9px auto 0;
    object-fit:contain;
}
.gg-bag-drawer__view{
    display:block;
    margin-top:7px;
    color:var(--gg-drawer-text)!important;
    font-size:11px;
    font-weight:800;
    text-align:center;
    text-decoration:underline!important;
    text-underline-offset:3px;
}

.single_add_to_cart_button.is-loading{
    position:relative;
    opacity:.78;
    cursor:wait!important;
}
.single_add_to_cart_button.is-loading:after{
    content:"";
    position:absolute;
    right:14px;
    top:50%;
    width:13px;
    height:13px;
    margin-top:-7px;
    border:2px solid rgba(255,255,255,.45);
    border-top-color:#fff;
    border-radius:50%;
    animation:gg-spin .7s linear infinite;
}
@keyframes gg-spin{to{transform:rotate(360deg)}}

.gg-bag-toast{
    position:fixed;
    left:50%;
    bottom:24px;
    z-index:100000;
    max-width:min(520px,calc(100vw - 30px));
    transform:translateX(-50%);
    padding:12px 16px;
    border-radius:7px;
    box-shadow:0 10px 35px rgba(0,0,0,.18);
    background:#fff;
    color:#1f2922;
    font-size:12.5px;
    font-weight:750;
}
.gg-bag-toast--error{border-left:4px solid #9e332b}

.woocommerce-cart .gg-curated-cart-image,
.widget_shopping_cart .gg-curated-cart-image{
    display:block!important;
    width:100%!important;
    height:auto!important;
    aspect-ratio:1/1!important;
    object-fit:cover!important;
    border-radius:4px!important;
}

@media(max-width:600px){
    .gg-bag-drawer{width:100vw}
    .gg-bag-drawer__bar,
    .gg-bag-progress,
    .gg-bag-drawer__items,
    .gg-bag-upsell,
    .gg-bag-drawer__footer{
        padding-left:15px;
        padding-right:15px;
    }
    .gg-bag-upsell__rail{
        grid-auto-columns:145px;
    }
}


/* ===== v4.7 BAG PRIORITY / COMPACT UPSELL FIX ===== */

/*
 * Priority order:
 * 1. Bag contents must always be clearly visible.
 * 2. Upsells are secondary and must never crowd/cover purchased items.
 * 3. Footer/checkout remains visible.
 */
.gg-bag-drawer__content{
    min-height:0!important;
    height:100%!important;
}

.gg-bag-drawer__items{
    flex:0 1 auto!important;
    min-height:104px!important;
    max-height:30vh!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding:4px 21px 0!important;
}

/* Slightly more compact bag line, without reducing legibility. */
.gg-bag-item{
    grid-template-columns:72px minmax(0,1fr)!important;
    gap:11px!important;
    padding:13px 0!important;
}
.gg-bag-item__image{
    width:72px!important;
    height:72px!important;
}
.gg-bag-item__name{
    font-size:11.75px!important;
    line-height:1.25!important;
}
.gg-bag-item__variation{
    margin-top:3px!important;
    font-size:10px!important;
}
.gg-bag-item__controls{
    margin-top:7px!important;
}
.gg-bag-qty{
    grid-template-columns:27px 27px 27px!important;
}
.gg-bag-qty button,
.gg-bag-qty span{
    height:25px!important;
}

/*
 * Recommendations become a compact horizontal strip, similar to the
 * space-efficient pattern in high-converting apparel drawers.
 */
.gg-bag-upsell{
    flex:0 0 auto!important;
    max-height:174px!important;
    padding:11px 21px 12px!important;
    overflow:hidden!important;
}
.gg-bag-upsell__head{
    align-items:center!important;
    margin-bottom:8px!important;
}
.gg-bag-upsell__eyebrow{
    font-size:8px!important;
}
.gg-bag-upsell__head h3{
    font-size:14px!important;
}
.gg-bag-upsell__hint{
    font-size:9px!important;
}

.gg-bag-upsell__rail{
    display:flex!important;
    gap:8px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:0 0 3px!important;
    scroll-snap-type:x proximity;
}

.gg-bag-upsell-card{
    display:grid!important;
    grid-template-columns:70px minmax(0,1fr)!important;
    flex:0 0 210px!important;
    min-width:210px!important;
    height:96px!important;
    overflow:hidden!important;
    scroll-snap-align:start;
}

.gg-bag-upsell-card__image{
    width:70px!important;
    height:96px!important;
    aspect-ratio:auto!important;
}
.gg-bag-upsell-card__image img{
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
}

.gg-bag-upsell-card__body{
    display:flex!important;
    flex-direction:column!important;
    min-width:0!important;
    padding:7px!important;
}
.gg-bag-upsell-card__name{
    min-height:0!important;
    -webkit-line-clamp:2!important;
    font-size:9.5px!important;
    line-height:1.25!important;
}
.gg-bag-upsell-card__price{
    margin-top:4px!important;
    font-size:9.5px!important;
}
.gg-bag-upsell-card__cta{
    min-height:26px!important;
    margin-top:auto!important;
    padding:5px 6px!important;
    font-size:8.75px!important;
}

/* Footer remains fully visible and does not get pushed below viewport. */
.gg-bag-drawer__footer{
    flex:0 0 auto!important;
    padding:12px 21px 14px!important;
}

/* When several cart lines exist, recommendations shrink before cart items do. */
@media(max-height:760px){
    .gg-bag-drawer__items{
        max-height:27vh!important;
    }
    .gg-bag-upsell{
        max-height:150px!important;
        padding-top:9px!important;
        padding-bottom:9px!important;
    }
    .gg-bag-upsell-card{
        height:82px!important;
        flex-basis:195px!important;
        min-width:195px!important;
    }
    .gg-bag-upsell-card__image{
        width:62px!important;
        height:82px!important;
    }
    .gg-bag-upsell-card{
        grid-template-columns:62px minmax(0,1fr)!important;
    }
}

/* Mobile: preserve bag visibility before upsell. */
@media(max-width:600px){
    .gg-bag-drawer__items{
        min-height:98px!important;
        max-height:32vh!important;
        padding-left:15px!important;
        padding-right:15px!important;
    }
    .gg-bag-upsell{
        max-height:160px!important;
        padding-left:15px!important;
        padding-right:15px!important;
    }
    .gg-bag-upsell-card{
        flex-basis:200px!important;
        min-width:200px!important;
    }
}


/* ===== v5.0 DELIVERY EXPECTATION ===== */
.gg-bag-drawer__eta{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    margin:0 0 12px;
    padding:9px 10px;
    border:1px solid rgba(15,77,56,.13);
    border-radius:6px;
    background:#f7faf7;
}
.gg-bag-drawer__eta strong{
    color:#0f4d38;
    font-size:10.75px;
    font-weight:900;
    line-height:1.25;
}
.gg-bag-drawer__eta span{
    max-width:46%;
    color:#6f776f;
    font-size:9.5px;
    font-weight:700;
    line-height:1.3;
    text-align:right;
}
@media(max-width:420px){
    .gg-bag-drawer__eta{
        flex-direction:column;
        gap:3px;
    }
    .gg-bag-drawer__eta span{
        max-width:none;
        text-align:left;
    }
}

/*
 * GG Bundle & Save money formatting
 *
 * WooCommerce nests its currency symbol inside the price amount.
 * Generic drawer span styling must not force those nested spans
 * onto separate lines.
 */
.gg-bag-progress__copy .woocommerce-Price-amount,
.gg-bag-progress__copy .woocommerce-Price-currencySymbol {
    display: inline !important;
}

.gg-bag-progress__copy .woocommerce-Price-amount {
    white-space: nowrap;
}

/*
 * Same protection for all drawer monetary values.
 */
.gg-bag-drawer .woocommerce-Price-amount,
.gg-bag-drawer .woocommerce-Price-currencySymbol {
    white-space: nowrap;
}

.gg-bag-drawer .woocommerce-Price-currencySymbol {
    display: inline !important;
}

