/* Marker Label */
.cart-progress-bar .progress-marker .marker-label {
    font-size: 14px; /* Font size for readability */
    color: #333;
    white-space: nowrap;
    font-weight: bold; /* Make the label stand out */
}

.shoptimizer-mini-cart-wrap .cart-progress-bar .progress-marker .marker-label {
    font-size: 12px;
}

.shoptimizer-mini-cart-wrap .cart-progress-bar .progress-marker .marker-label,
.shoptimizer-mini-cart-wrap .cart-progress-bar-wrapper .progress-message {
    font-size: 12px;
}

/* Marker Label */
.cart-progress-bar .progress-marker .marker-label {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    font-weight: bold;
    padding-bottom: 20px;
}



/* Fade only; each marker sets its own transform below. */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* WooCommerce Message Spacing */
.woocommerce-message + .cart-progress-bar-wrapper {
    margin-top: 20px;
}

/* Progress Messages */
.progress-messages {
    margin-top: 30px;
    text-align: center;
}

.progress-message {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

.progress-message.success {
    color: #009245;
    font-weight: 500;
}

.progress-message strong {
    color: #009245;
    font-weight: 600;
}

/* Progress Bar Styles */
.cart-progress-bar-wrapper {
    position: relative;
    margin: 20px 0;
    padding: 40px 20px;
    /*border: 1px solid #ddd;*/
    border-radius: 5px;
}

/* Progress Bar */
.cart-progress-bar {
    position: relative;
    top: 0; /* Align to top of container */
    left: 0;
    right: 0;
    height: 15px;
    background: #f0f0f0;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    overflow: visible;
    z-index: 2; /* Place above other elements */
}

.cart-progress-bar .progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #009245;
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Threshold Markers: each flagpole stands on its goal; the last goal is the end of the bar. */
.cart-progress-bar .progress-marker {
    align-items: center;
    display: flex;
    gap: 0px;
    position: absolute;
    text-align: center;
    top: -34px;
    transform: translateX(calc(-100% + 22.5px));
    z-index: 3;
    flex-direction: row-reverse;
    animation: fadeIn 0.3s ease;
}

.widget_shopping_cart .cart-progress-bar .progress-marker {
    gap: 3px;
}

/* Last goal: nudge the flag 3px left of the bar end. */
.cart-progress-bar .progress-marker:last-child {
    transform: translateX(calc(-100% + 19.5px));
}

/* Regular cart progress bar */
.cart-progress-bar-wrapper.regular-cart {
    margin: 20px 0;
    padding: 70px 70px 30px 70px;
    background: #f9f9f9;
    /*border: 1px solid #ddd;*/
    border-radius: 5px;
}

.cart-progress-bar-wrapper.regular-cart .progress-marker .marker-label {
    font-size: 14px;
    color: #333;
}

/* Mini cart progress bar */
.cart-progress-bar-wrapper.mini-cart {
    margin: 10px 0;
    padding: 5px 25px 5px 5px;
    background: #fff;
    /*border: 1px solid #ccc;*/
    border-radius: 3px;
}

.cart-progress-bar-wrapper.mini-cart .progress-marker .marker-label {
    font-size: 12px;
    color: #666;
    padding-bottom: 15px;
}

.cart-progress-bar .progress-marker.marker-reached .marker-label {
    color: #009245;
}

/* Inline free gift picker */
.pw-gift-card {
    display: flex;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
    max-width: 440px;
    margin: 15px auto 0;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--category-color, #009245);
    border-radius: 10px;
    text-align: left;
}

.pw-gift-card img {
    flex: 0 0 130px;
    width: 130px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
}

/* Mini cart is narrow: stack the image above the form. */
.mini-cart .pw-gift-card {
    flex-direction: column;
    gap: 10px;
}

.mini-cart .pw-gift-card img {
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
}

.mini-cart .pw-gift-card__body {
    width: 100%;
}

.pw-gift-card__body {
    flex: 1;
    min-width: 0;
    max-width: 260px;
}

.pw-gift-card__title {
    display: block;
    margin-bottom: 6px;
    color: var(--category-color, #009245);
}

.pw-gift-card label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
}

.pw-gift-card select {
    display: block;
    width: 100%;
    margin-top: 3px;
}

.pw-gift-card .pw-gift-card__add {
    width: 100%;
    background-color: var(--category-color, #009245);
    color: #fff;
    border-radius: 8px;
}

.pw-gift-card .pw-gift-card__add:disabled {
    background-color: #e6e6e6;
    color: #777;
    cursor: not-allowed;
}

.pw-gift-card__status {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #c92323;
}

.pw-gift-card .pw-gift-card__dismiss,
.pw-gift-undo {
    display: block;
    margin: 8px auto 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    color: #666;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.pw-gift-undo {
    display: inline;
    margin: 0;
}

.pw-gift-skipped {
    margin: 15px 0 0;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* Replace the marker circle with the golf flag image */
.cart-progress-bar .progress-marker .marker-circle {
    height: 42px;
    width: 25px;
    background: url('../images/checkered-flag.webp') no-repeat left center;
    background-size: contain;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: inline-block;
}
