/* ============================================================
   Floating Cart Bar  –  v1.1.4
   ============================================================ */

.fcb-floating-bar {
    position: fixed;
    z-index: 998;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% + 40px));
    opacity: 0;
    width: calc(100% - 32px);
    max-width: 480px;
    background: #435428;
    color: #ffffff;
    border-radius: 50px;
    box-shadow: 0 4px 24px rgba(0,0,0,.22);
    cursor: pointer;
    direction: rtl;
    font-family: 'yekanbakhfa', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    transition: transform .45s cubic-bezier(.34,1.56,.64,1), opacity .35s ease;
    will-change: transform, opacity;
}
.fcb-floating-bar.fcb-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.fcb-floating-bar.fcb-hidden {
    transform: translateX(-50%) translateY(calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
}

/* ── Inner padding ── */
.fcb-floating-bar-inner {
    padding: 10px 14px 10px;
}

/* ── Bar body: icon + middle side by side ── */
.fcb-bar-body {
    display: flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
}

/* ── Cart icon ── */
.fcb-cart-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: transform .2s ease;
}
.fcb-cart-icon:hover { transform: scale(1.15); }
.fcb-cart-icon svg   { width: 24px; height: 24px; fill: currentColor; display: block; }
.fcb-custom-icon     { width: 24px; height: 24px; object-fit: contain; display: block; }

/* ── Middle: column layout (top-row + progress) ── */
.fcb-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* ── Top row: info (grows) + action (shrinks) ── */
.fcb-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    direction: rtl;
}

/* ── Info ── */
.fcb-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: hidden;
    min-width: 0;
}
.fcb-count {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.fcb-separator {
    opacity: .35;
    font-weight: 300;
    flex-shrink: 0;
}
.fcb-message {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Slide wrapper ── */
.fcb-slide-wrapper {
    position: relative;
    overflow: hidden;
    height: 1.35em;
    display: inline-block;
    flex: 1;
    min-width: 0;
}
.fcb-slide-item {
    display: block;
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.35em;
    transition: transform .45s cubic-bezier(.4,0,.2,1), opacity .45s ease;
}
/* Panel A: free-shipping label */
.fcb-slide-a { transform: translateY(0);    opacity: 1; color: #b8e05a; }
/* Panel B: subtotal amount – hidden below */
.fcb-slide-b { transform: translateY(100%); opacity: 0; color: #fff; font-weight: 700; font-size: 14px; }

.fcb-slide-wrapper.show-b .fcb-slide-a { transform: translateY(-100%); opacity: 0; }
.fcb-slide-wrapper.show-b .fcb-slide-b { transform: translateY(0);     opacity: 1; }

/* ── Action slot ── */
.fcb-action-slot {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ── Payment button ── */
.fcb-payment-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #c8a96e;
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    font-family: inherit;
    direction: rtl;
    transition: background .2s ease, transform .15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.fcb-payment-btn:hover { background: #d4b87a; transform: scale(1.04); }
.fcb-payment-btn svg   { flex-shrink: 0; }

@keyframes fcbPaymentIn {
    0%   { opacity:0; transform: scale(.6) translateX(-12px); }
    65%  { transform: scale(1.07) translateX(2px); }
    100% { opacity:1; transform: scale(1) translateX(0); }
}
.fcb-payment-animate { animation: fcbPaymentIn .5s cubic-bezier(.34,1.56,.64,1) both; }

/* ── Progress bar ── */
.fcb-progress-bar-container {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,.2);
    border-radius: 3px;
    overflow: hidden;
}
.fcb-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #7ab830, #b8e05a);
    border-radius: 3px;
    /* NO default width:0 here - set via inline style from PHP */
    transition: width .9s cubic-bezier(.25,.46,.45,.94);
    position: relative;
    overflow: hidden;
}
.fcb-progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
    animation: fcbShimmer 2.2s infinite;
}
@keyframes fcbShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.fcb-progress-bar.fcb-complete { background: linear-gradient(90deg, #b8e05a, #d4ff80); }

/* ── Count pulse ── */
@keyframes fcbPulse {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.2); }
}
.fcb-count.fcb-pulse { animation: fcbPulse .3s ease; }

/* ── Mobile ── */
@media (max-width: 480px) {
    .fcb-floating-bar { width: calc(100% - 20px); bottom: 10px; }
    .fcb-payment-btn  { padding: 7px 14px; font-size: 13px; }
    .fcb-message, .fcb-slide-item { font-size: 12px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .fcb-floating-bar, .fcb-progress-bar,
    .fcb-payment-animate, .fcb-slide-item { animation: none !important; transition: none !important; }
    .fcb-progress-bar::after { animation: none; }
}
