/* GB Floating Cart — style.css */

/* ── Base ─────────────────────────────────────────────────── */
.gb-fc-wrap { font-family: inherit; }

/* ── Trigger Button ──────────────────────────────────────── */
.gb-fc-trigger {
    position: fixed;
    top: 55%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 80px;
    padding: 10px 8px;
    background: #e07523;
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 99990;
    transition: background .2s, transform .15s;
    border-radius: 8px 0 0 8px;
    text-align: center;
    line-height: 1.2;
}
.gb-fc-pos-right { right: 0; border-radius: 8px 0 0 8px; }
.gb-fc-pos-left  { left: 0; border-radius: 0 8px 8px 0; }
.gb-fc-trigger:hover { transform: translateX(-2px); }
.gb-fc-pos-left.gb-fc-trigger:hover { transform: translateX(2px); }

/* FIX: Ensure icon renders correctly at controlled size */
.gb-fc-trigger .gb-fc-icon {
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gb-fc-trigger .gb-fc-icon svg,
.gb-fc-trigger .gb-fc-icon i {
    width: 22px;
    height: 22px;
    display: block;
}
.gb-fc-trig-label { font-size: 12px; font-weight: 500; text-align: center; }
.gb-fc-trig-price { font-size: 12px; font-weight: 600; word-break: break-all; }

/* ── Overlay ─────────────────────────────────────────────── */
.gb-fc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99991;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.gb-fc-overlay.gb-fc-open {
    opacity: 1;
    pointer-events: all;
}

/* ── Panel ───────────────────────────────────────────────── */
.gb-fc-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 400px;
    max-width: 100vw;
    background: #fff;
    z-index: 99992;
    /* FIX: flex column so header + body(flex:1) + footer always fill height */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s;
    box-shadow: -4px 0 24px rgba(0,0,0,.12);
}
.gb-fc-panel-right {
    right: 0;
    transform: translateX(100%);
}
.gb-fc-panel-left {
    left: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
}
.gb-fc-panel.gb-fc-open {
    transform: translateX(0) !important;
}
/* Fade anim */
.gb-fc-wrap[data-anim="fade"] .gb-fc-panel {
    transform: none !important;
    opacity: 0;
    pointer-events: none;
}
.gb-fc-wrap[data-anim="fade"] .gb-fc-panel.gb-fc-open {
    opacity: 1;
    pointer-events: all;
}
/* Slide+Fade */
.gb-fc-wrap[data-anim="slide-fade"] .gb-fc-panel { opacity: 0; }
.gb-fc-wrap[data-anim="slide-fade"] .gb-fc-panel.gb-fc-open { opacity: 1; }

/* ── Panel Header ────────────────────────────────────────── */
.gb-fc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    /* FIX: flex-shrink:0 keeps header fixed at top */
    flex-shrink: 0;
    background: #fff;
}
.gb-fc-panel-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #1a1a1a;
}
.gb-fc-close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: color .2s;
    padding: 4px 0;
}
.gb-fc-close:hover { color: #e07523; }
.gb-fc-close svg,
.gb-fc-close i { width: 14px; height: 14px; font-size: 14px; }

/* ── Body ─────────────────────────────────────────────────── */
/* FIX: flex:1 + overflow-y:auto makes body scrollable while header/footer are fixed */
.gb-fc-body {
    flex: 1;
    min-height: 0; /* required for flex overflow to work correctly */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}
.gb-fc-body::-webkit-scrollbar { width: 4px; }
.gb-fc-body::-webkit-scrollbar-track { background: transparent; }
.gb-fc-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Items list takes available space; upsell stays at bottom of scrollable area */
.gb-fc-items-list { flex: 1; }

/* ── Cart Item ───────────────────────────────────────────── */
.gb-fc-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid transparent;
    transition: background .15s;
}
.gb-fc-item + .gb-fc-item { border-top-color: #f0f0f0; }
.gb-fc-item:hover { background: #fafafa; }

.gb-fc-item-img { flex-shrink: 0; width: 64px; height: 64px; }
.gb-fc-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.gb-fc-item-details { flex: 1; min-width: 0; }
.gb-fc-item-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    margin-bottom: 8px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gb-fc-item-name:hover { color: #e07523; }

.gb-fc-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.gb-fc-item-sep { color: #bbb; font-size: 12px; }
.gb-fc-item-price,
.gb-fc-item-total { font-size: 13px; color: #444; }
.gb-fc-item-total { font-weight: 600; color: #1a1a1a; }

/* ── Qty Buttons ─────────────────────────────────────────── */
.gb-fc-qty-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}
.gb-fc-qty-btn {
    width: 28px;
    height: 28px;
    background: #f5f5f5;
    color: #1a1a1a;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.gb-fc-qty-btn:hover { background: #e07523; color: #fff; }
.gb-fc-qty-number {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    padding: 0 6px;
}
/* Round style */
.gb-fc-wrap[data-qty-style="round"] .gb-fc-qty-wrap { border: none; gap: 4px; }
.gb-fc-wrap[data-qty-style="round"] .gb-fc-qty-btn  { border-radius: 50%; border: 1px solid #e5e5e5; }
/* Minimal style */
.gb-fc-wrap[data-qty-style="minimal"] .gb-fc-qty-wrap { border: none; gap: 2px; }
.gb-fc-wrap[data-qty-style="minimal"] .gb-fc-qty-btn  { background: none; border: none; color: #888; font-size: 18px; }
.gb-fc-wrap[data-qty-style="minimal"] .gb-fc-qty-btn:hover { background: none; color: #e07523; }

/* FIX: Remove button — supports both Elementor icon (svg/i) and inline SVG */
.gb-fc-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 14px;
    padding: 4px;
    transition: color .15s;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gb-fc-remove:hover { color: #e03e3e; }
.gb-fc-remove svg,
.gb-fc-remove i {
    width: 14px;
    height: 14px;
    font-size: 14px;
    display: block;
    pointer-events: none;
}
/* Inherit color for SVG stroke */
.gb-fc-remove svg { stroke: currentColor; }

/* ── Empty Cart ──────────────────────────────────────────── */
.gb-fc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 12px;
}
.gb-fc-empty-icon { color: #ddd; }
.gb-fc-empty-text { font-size: 14px; color: #888; }
.gb-fc-continue-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #444;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s;
    margin-top: 4px;
}
.gb-fc-continue-btn:hover { background: #e07523; color: #fff; }

/* ── Upsell ──────────────────────────────────────────────── */
/* FIX: Upsell is inside .gb-fc-body, so it scrolls naturally.
   It always appears below cart items. The footer is outside body so it is always at bottom. */
.gb-fc-upsell {
    padding: 14px 0 0;
    background: #f8f8f8;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
.gb-fc-upsell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 10px;
}
.gb-fc-upsell-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    position: relative;
    padding-bottom: 6px;
    display: inline-block;
}
.gb-fc-upsell-title::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 3px;
    background: #e07523;
    border-radius: 2px;
}

/* FIX: Arrow buttons — ensure icons are visible and properly sized */
.gb-fc-upsell-arrows { display: flex; gap: 6px; align-items: center; }
.gb-fc-upsell-arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e07523;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
    padding: 0;
}
.gb-fc-upsell-arrow:hover { background: #c9631a; }

/* FIX: Arrow icon rendering — works for both FA icons and SVG */
.gb-fc-upsell-arrow svg {
    width: 14px;
    height: 14px;
    display: block;
    stroke: currentColor;
    fill: none;
    pointer-events: none;
}
.gb-fc-upsell-arrow i {
    font-size: 14px;
    display: block;
    line-height: 1;
    pointer-events: none;
}

.gb-fc-upsell-track {
    display: flex;
    gap: 10px;
    padding: 4px 16px 16px;
    overflow-x: hidden;
    scroll-behavior: smooth;
}
.gb-fc-up-card {
    flex: 0 0 160px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow .15s;
}
.gb-fc-up-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.gb-fc-up-img { width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 6px; }
.gb-fc-up-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gb-fc-up-info { display: flex; flex-direction: column; gap: 4px; }
.gb-fc-up-name { font-size: 12px; font-weight: 500; color: #1a1a1a; line-height: 1.4; }
.gb-fc-up-price { font-size: 12px; color: #666; }
.gb-fc-up-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    background: #e07523;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    margin-top: 2px;
    width: 100%;
}
.gb-fc-up-add:hover { background: #c9631a; }
.gb-fc-up-add.gb-fc-added { background: #2e7d32; }

/* ── Footer ──────────────────────────────────────────────── */
/* FIX: flex-shrink:0 ensures footer is always pinned at the bottom of the panel */
.gb-fc-footer {
    flex-shrink: 0;
    padding: 14px 20px;
    border-top: 1px solid #eee;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gb-fc-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gb-fc-total-label { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.gb-fc-total-amount { font-size: 17px; font-weight: 700; color: #e07523; }
.gb-fc-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px;
    background: #e07523;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: center;
    transition: background .2s;
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}
.gb-fc-checkout-btn:hover { background: #c9631a; color: #fff; }
.gb-fc-checkout-btn svg,
.gb-fc-checkout-btn i { width: 16px; height: 16px; font-size: 16px; }

/* ── Loading State ───────────────────────────────────────── */
.gb-fc-loading {
    opacity: .5;
    pointer-events: none;
}
.gb-fc-item.gb-fc-removing {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .2s, transform .2s;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .gb-fc-panel { width: 100vw; }
    .gb-fc-up-card { flex: 0 0 140px; }
}


/* ============================================================
   GB FC Icon Trigger Widget
   ============================================================ */

.gb-fc-icon-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: all 300ms ease;
}

/* Left layout: icon on the left, text on the right */
.gb-fc-icon-box.gb-fc-ib-layout-left {
    flex-direction: row;
    align-items: center;
}

/* Icon wrapper — relative so badge can be positioned */
.gb-fc-ib-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    transition: background-color 300ms ease;
}

/* Icon itself */
.gb-fc-ib-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 300ms ease;
}
.gb-fc-ib-icon svg {
    display: block;
    transition: fill 300ms ease, color 300ms ease;
}

/* Cart count badge */
.gb-fc-ib-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 11px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    background-color: #e07523;
    color: #ffffff;
    pointer-events: none;
    z-index: 1;
}

/* Text area */
.gb-fc-ib-text {
    flex: 1;
}

/* Title */
.gb-fc-ib-title {
    margin: 0 0 8px;
    padding: 0;
    line-height: 1.3;
    transition: color 300ms ease;
}

/* Description */
.gb-fc-ib-desc {
    margin: 0;
    padding: 0;
    line-height: 1.5;
    transition: color 300ms ease;
}

/* Keyboard focus ring */
.gb-fc-icon-box:focus-visible {
    outline: 2px solid #e07523;
    outline-offset: 3px;
    border-radius: 4px;
}


/* ============================================================
   GB Cart Bar — Persistent Bottom Bar
   Desktop এ hidden, mobile এ visible (JS controls via .gb-cart-bar-mobile-only)
   ============================================================ */
.gb-cart-bar {
    position: fixed;
    bottom: -80px;
    left: 0;
    right: 0;
    z-index: 99996;
    background: #3a7d0a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: bottom 0.38s cubic-bezier(0.34,1.2,0.64,1);
    font-family: inherit;
    border: none;
    width: 100%;
    box-sizing: border-box;
    /* Desktop এ default hidden — JS mobile check করবে */
}
.gb-cart-bar.gb-cart-bar-visible {
    bottom: 0;
}
/* Floating cart panel open থাকলে cart bar hide */
.gb-cart-bar.gb-cart-bar-panel-open {
    bottom: -80px !important;
    transition: bottom 0.25s ease-in;
}
/* Mobile-only mode: desktop এ force hide */
.gb-cart-bar.gb-cart-bar-mobile-only {
    display: none;
}
@media (max-width: 768px) {
    .gb-cart-bar.gb-cart-bar-mobile-only {
        display: flex;
    }
}
.gb-cart-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.gb-cart-bar-count {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}
.gb-cart-bar-label {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.gb-cart-bar-price {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
}

/* ============================================================
   GB ATC Toast — Add to Cart Notification
   ============================================================ */
.gb-atc-toast {
    position: fixed;
    bottom: -90px;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #2e7d32;
    color: #fff;
    padding: 10px 16px 10px 12px;
    box-shadow: 0 -3px 20px rgba(0,0,0,0.22);
    transition: bottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
    min-height: 68px;
    box-sizing: border-box;
}
/* Mobile-only mode */
.gb-atc-toast.gb-atc-toast-mobile-only {
    display: none;
}
@media (max-width: 768px) {
    .gb-atc-toast.gb-atc-toast-mobile-only {
        display: flex;
    }
}
/* bottom: JS দিয়ে inline style এ set হয় show করার সময় */
.gb-atc-toast-img-wrap {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.gb-atc-toast-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    display: block;
}
.gb-atc-toast-info {
    flex: 1;
    min-width: 0;
}
.gb-atc-toast-label {
    font-size: 11px;
    opacity: 0.85;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}
.gb-atc-toast-label svg { flex-shrink: 0; }
.gb-atc-toast-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.gb-atc-toast-btn {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.55);
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.02em;
}
.gb-atc-toast-btn:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.8);
}
.gb-atc-toast-btn svg { flex-shrink: 0; }

/* ── Elementor Editor Preview Styles ────────────────────────────────────── */
.gb-cb-preview {
    background-color: #3a7d0a;
    color: #fff;
    padding: 0 20px;
    height: 56px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    transition: background-color 0.2s;
}
.gb-cb-preview .gb-cart-bar-count {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}
.gb-cb-preview .gb-cart-bar-label {
    font-size: 15px;
    font-weight: 700;
}
.gb-cb-preview .gb-cart-bar-price {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}
.gb-toast-preview {
    background-color: #2e7d32;
    color: #fff;
    padding: 10px 16px 10px 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.gb-toast-preview .gb-atc-toast-btn {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.55);
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}
