/* ============================================
   Free Shipping Progress Bar — Water Edition
   ============================================ */

:root {
    --fspb-water-color: #625892;
    --fspb-water-dark:  #4a4070;
    --fspb-water-glow:  #8b7bb8;
    --fspb-track-bg:    #ede9f6;
    --fspb-track-border:#c9bfe8;
    --fspb-text-color:  #2e2550;
    --fspb-radius:      50px;
    --fspb-height:      38px;
}

/* Wrapper */
.fspb-wrapper {
    font-family: 'Segoe UI', system-ui, sans-serif;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem 1rem;
    background: linear-gradient(135deg, #f5f3fb 0%, #ede9f6 100%);
    border: 1px solid var(--fspb-track-border);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(98,88,146,0.12);
}

/* Message row */
.fspb-message {
    display: flex;
    align-items: center;
	justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--fspb-text-color);
    margin-bottom: 0.75rem;
    min-height: 24px;
    transition: opacity 0.4s;
}

.fspb-message strong { color: #4a4070; }
.fspb-icon { font-size: 1.2rem; line-height: 1; }

/* Track (outer bar container) */
.fspb-track {
    position: relative;
    width: 100%;
    height: var(--fspb-height);
    background: var(--fspb-track-bg);
    border: 2px solid var(--fspb-track-border);
    border-radius: var(--fspb-radius);
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(98,88,146,0.12);
}

/* Fill */
.fspb-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    min-width: 0%;
    background: linear-gradient(90deg, var(--fspb-water-dark) 0%, var(--fspb-water-color) 60%, var(--fspb-water-glow) 100%);
    border-radius: var(--fspb-radius);
    overflow: hidden;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width;
}

.fspb-fill.fspb-achieved {
    background: linear-gradient(90deg, #4a4070 0%, #625892 60%, #8b7bb8 100%);
}

/* ---- Wave animations ---- */
.fspb-wave {
    position: absolute;
    bottom: -4px;
    left: -60%;
    width: 220%;
    height: 22px;
    border-radius: 40%;
    opacity: 0.35;
    animation: fspb-wave-roll 3s linear infinite;
}

.fspb-wave-1 {
    background: rgba(255,255,255,0.55);
    animation-duration: 2.8s;
    animation-delay: 0s;
}

.fspb-wave-2 {
    background: rgba(255,255,255,0.30);
    animation-duration: 3.6s;
    animation-delay: -1.2s;
    bottom: -6px;
}

@keyframes fspb-wave-roll {
    0%   { transform: translateX(0)   rotateZ(0deg); }
    50%  { transform: translateX(25%) rotateZ(2deg); }
    100% { transform: translateX(50%) rotateZ(0deg); }
}

/* ---- Bubbles ---- */
.fspb-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fspb-bubble {
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    animation: fspb-bubble-rise 3.5s ease-in infinite;
    opacity: 0;
}

.fspb-bubble:nth-child(1) { left: 12%;  animation-delay: 0.0s; width: 5px;  height: 5px;  }
.fspb-bubble:nth-child(2) { left: 30%;  animation-delay: 0.7s; width: 7px;  height: 7px;  }
.fspb-bubble:nth-child(3) { left: 52%;  animation-delay: 1.4s; width: 4px;  height: 4px;  }
.fspb-bubble:nth-child(4) { left: 70%;  animation-delay: 2.1s; width: 6px;  height: 6px;  }
.fspb-bubble:nth-child(5) { left: 85%;  animation-delay: 2.8s; width: 5px;  height: 5px;  }

@keyframes fspb-bubble-rise {
    0%   { transform: translateY(0)    scale(1);    opacity: 0.7; }
    80%  { transform: translateY(-20px) scale(1.1); opacity: 0.3; }
    100% { transform: translateY(-28px) scale(0.5); opacity: 0;   }
}

/* ---- Percentage label ---- */
.fspb-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.78rem;
    font-weight: 700;
    color: #2e2550;
    letter-spacing: 0.04em;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(255,255,255,0.8);
    z-index: 2;
}

/* Milestones row */
.fspb-milestones {
    display: flex;
    justify-content: space-between;
    margin-top: 0.45rem;
    font-size: 0.72rem;
    color: #64748b;
    letter-spacing: 0.02em;
}

/* ---- Achieved glow pulse ---- */
.fspb-fill.fspb-achieved {
    animation: fspb-glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes fspb-glow-pulse {
    from { box-shadow: 0 0 6px  rgba(98,88,146,0.3); }
    to   { box-shadow: 0 0 18px rgba(98,88,146,0.7); }
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .fspb-wrapper { padding: 0.9rem 1rem; }
    :root { --fspb-height: 28px; }
    .fspb-message { font-size: 0.78rem; }
    .fspb-milestones { font-size: 0.65rem; }
}

@media (max-width: 320px) {
    .fspb-wrapper { padding: 0.75rem; }
    :root { --fspb-height: 24px; }
    .fspb-message { font-size: 0.72rem; }
}

/* ============================================
   FLOATING SITEWIDE BAR
   Vertical bar fixed to left-center of screen
   ============================================ */

.fspb-float {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: row;
    align-items: center;
    font-family: 'Segoe UI', system-ui, sans-serif;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide panel off-screen to the left, keep tab visible */
.fspb-float.fspb-collapsed .fspb-float-inner {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    width: 0;
    padding: 0;
    border: none;
    overflow: hidden;
}

/* ---- Inner panel (vertical layout) ---- */
.fspb-float-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, #f5f3fb 0%, #ede9f6 100%);
    border: 1px solid #c9bfe8;
    border-right: none;
    border-radius: 0 0 0 10px;
    border-top-left-radius: 10px;
    padding: 16px 10px 12px;
    width: 52px;
    box-shadow: inset 0 1px 4px rgba(98,88,146,0.08);
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1),
                opacity 0.3s ease,
                width 0.4s ease,
                padding 0.3s ease;
    overflow: hidden;
}

/* ---- Top label (rotated text) ---- */
.fspb-float-message {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 0.7rem;
    color: #2e2550;
    margin-bottom: 10px;
    line-height: 1.3;
    white-space: nowrap;
    text-align: center;
}

.fspb-float-message strong { color: #4a4070; }

.fspb-float-icon {
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: block;
    text-align: center;
}

/* ---- Vertical progress track ---- */
.fspb-float-track {
    position: relative;
    width: 22px;
    height: 140px;
    background: #ede9f6;
    border: 2px solid #c9bfe8;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(98,88,146,0.12);
    margin: 0 auto;
    flex-shrink: 0;
}

/* Reliable bottom-up fill: pinned to bottom with top:auto */
.fspb-float-track .fspb-fill {
    position: absolute !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: linear-gradient(to top, #4a4070 0%, #625892 60%, #8b7bb8 100%);
    border-radius: 50px;
    overflow: hidden;
    transition: height 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: height;
}

/* Wrapper that grows from bottom — height is set via JS/inline style */
.fspb-float-fill-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    transition: height 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

/* Inner fill always 100% of wrapper, with waves/bubbles */
.fspb-float-fill-wrap .fspb-fill {
    position: absolute !important;
    top: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(to top, #4a4070 0%, #625892 60%, #8b7bb8 100%);
    border-radius: 50px;
    overflow: visible;
    transition: none;
}

/* Wave sits at the TOP of the fill — the water surface */
.fspb-float-fill-wrap .fspb-wave {
    position: absolute;
    top: -6px;
    left: -60%;
    width: 220%;
    height: 14px;
    border-radius: 40%;
    opacity: 0.5;
    animation: fspb-wave-roll 3s linear infinite;
    pointer-events: none;
}

.fspb-float-fill-wrap .fspb-wave-1 {
    background: rgba(255,255,255,0.55);
    animation-duration: 2.8s;
}

.fspb-float-fill-wrap .fspb-wave-2 {
    background: rgba(255,255,255,0.30);
    animation-duration: 3.6s;
    top: -9px;
    animation-delay: -1.2s;
}

/* Bubbles inside the fill */
.fspb-float-fill-wrap .fspb-bubble {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 4px;
}

/* ---- Percentage label ---- */
.fspb-float-track .fspb-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    font-size: 0.6rem;
    font-weight: 700;
    color: #2e2550;
    text-shadow: 0 1px 3px rgba(255,255,255,0.8);
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
}

/* ---- Milestones (top/bottom of track) ---- */
.fspb-float-milestones {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.58rem;
    color: #7c6fa0;
    letter-spacing: 0.02em;
}

/* ---- Toggle tab — sits on the RIGHT of the panel ---- */
.fspb-float-toggle {
    flex-shrink: 0;
    width: 20px;
    height: 64px;
    background: #625892;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    writing-mode: vertical-rl;
    letter-spacing: 0.08em;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-weight: 600;
    box-shadow: 3px 0 10px rgba(98,88,146,0.22);
    transition: background 0.2s;
    padding: 0;
    user-select: none;
}

.fspb-float-toggle:hover { background: #4a4070; }

/* Arrow indicator on the tab */
.fspb-float-toggle::after {
    content: '◀';
    font-size: 0.55rem;
    margin-top: 4px;
    transition: transform 0.3s;
    writing-mode: horizontal-tb;
    display: block;
}

.fspb-float.fspb-collapsed .fspb-float-toggle::after {
    transform: scaleX(-1);
}

/* ---- Entrance animation ---- */
@keyframes fspb-float-enter {
    from { opacity: 0; left: -80px; }
    to   { opacity: 1; left: 0; }
}

.fspb-float {
    animation: fspb-float-enter 0.7s cubic-bezier(0.4,0,0.2,1) 0.6s both;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
    .fspb-float-inner { width: 44px; padding: 12px 8px 10px; }
    .fspb-float-track  { height: 100px; width: 18px; }
    .fspb-float-message { font-size: 0.62rem; }
}