/**
 * Free Shipping Progress Bar Styles
 */

.free-shipping-bar-wrapper {
    padding: 15px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

/* Shipping Message */
.shipping-message {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--aliza-black, #231F20);
    text-align: center;
    justify-content: center;
    direction: rtl;
}

.shipping-message.shipping-achieved {
    color: var(--aliza-green, #6B7B70);
    font-weight: 600;
}

.shipping-message .shipping-emoji {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

/* Success-state messages — a touch bigger than the "still working" state */
.shipping-state-pickup .shipping-message,
.shipping-state-door .shipping-message {
    font-size: 15px;
}

.shipping-message strong {
    color: var(--aliza-orange, #F4783D);
    font-weight: 700;
}

/* Progress Bar */
.shipping-progress-bar {
    width: 100%;
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 999px;
    position: relative;
    margin-bottom: 18px; /* room for milestone label below */
}

.shipping-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--aliza-pink, #E1B1AC) 0%, var(--aliza-orange, #F4783D) 100%);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), background 0.6s ease;
    position: relative;
    overflow: hidden;
}

/* Once pickup tier is hit, bar turns green — clear "unlocked" signal */
.shipping-state-pickup .shipping-progress-fill,
.shipping-state-door .shipping-progress-fill {
    background: linear-gradient(90deg, var(--aliza-green, #6B7B70) 0%, #8AA38F 100%);
}

/* Animated shine effect when close to goal */
.shipping-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Milestone markers on the progress bar (tier 1 + end tier 2) */
.shipping-milestone {
    position: absolute;
    top: 50%;
    transform: translate(50%, -50%); /* right-anchored in RTL bar */
    width: 24px;
    height: 24px;
    background: #fff;
    border: 2px solid var(--aliza-orange, #F4783D);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    z-index: 2;
}

/* Emoji centering — own grid cell so baseline quirks don't matter */
.shipping-milestone .milestone-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 12px;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", sans-serif;
}

/* Reached — borderless pale-sage disk. Darker than the previous #E3EDE6
   but still lighter than the bar (#6B7B70 → #8AA38F) so it pops on top. */
.shipping-milestone.is-reached {
    background: #C5D6CB;
    border-color: #C5D6CB;
    animation: milestonePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Below tier 1, tier 2 is a distant future goal — mute its border to grey
   so the eye focuses on the immediate next goal (tier 1, still orange). */
.shipping-state-none .shipping-milestone--end {
    border-color: #c9c9c9;
}

@keyframes milestonePop {
    0%   { transform: translate(50%, -50%) scale(1); }
    40%  { transform: translate(50%, -50%) scale(1.45); }
    70%  { transform: translate(50%, -50%) scale(0.92); }
    100% { transform: translate(50%, -50%) scale(1); }
}

/* Threshold Labels — RTL visual order: 0 on right, max on left */
.shipping-threshold-labels {
    position: relative;
    font-size: 11px;
    color: #999;
    direction: rtl;
    display: flex;
    justify-content: flex-start;
    min-height: 14px;
}

.shipping-threshold-labels .start-label {
    font-weight: 500;
}

/* Tier-1 middle label + tier-2 end label sit absolutely under their circles
   (translateX +50% centers them on the right-anchored position). */
.shipping-threshold-labels .milestone-label,
.shipping-threshold-labels .end-label {
    position: absolute;
    transform: translateX(50%);
    white-space: nowrap;
}

.shipping-threshold-labels .end-label {
    right: 100%;
}

/* Bold only the NEXT reachable goal. Once reached, go back to regular. */
.shipping-threshold-labels .milestone-label {
    font-weight: 700;
    color: var(--aliza-orange, #F4783D);
}

.shipping-threshold-labels .milestone-label.is-reached {
    font-weight: 700;
    color: var(--aliza-green, #6B7B70);
}

.shipping-threshold-labels .end-label {
    font-weight: 500;
    color: #999;
}

/* In pickup state, tier 2 (end) IS the next goal — bold + orange */
.shipping-state-pickup .shipping-threshold-labels .end-label {
    font-weight: 700;
    color: var(--aliza-orange, #F4783D);
}

.shipping-state-door .shipping-threshold-labels .end-label {
    font-weight: 700;
    color: var(--aliza-green, #6B7B70);
}

/* Mini-cart specific styles */
.widget_shopping_cart .free-shipping-bar-wrapper {
    padding: 15px 20px;
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: 0;
    background-color: #fafafa;
}

/* Checkout page specific styles */
.woocommerce-checkout .free-shipping-bar-wrapper {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 25px;
}

.woocommerce-checkout .shipping-message {
    font-size: 16px;
}

/* Mobile responsive */
@media (max-width: 549px) {
    .shipping-message {
        font-size: 13px;
    }

    .free-shipping-bar-wrapper {
        padding: 12px 0;
    }

    .widget_shopping_cart .free-shipping-bar-wrapper {
        padding: 12px 15px;
        margin-left: -15px;
        margin-right: -15px;
    }
}

/* Success state animation */
.shipping-achieved,
.shipping-state-pickup .shipping-won,
.shipping-state-door .shipping-message,
.shipping-state-pickup .shipping-message .shipping-emoji,
.shipping-state-door .shipping-message .shipping-emoji {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
}

/* Two-tier pickup state: "won" message above the bar, "next" row below it */
.shipping-state-pickup .shipping-won {
    color: var(--aliza-green, #6B7B70);
    font-weight: 700;
}

.shipping-next-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e5e5e5;
    font-size: 13px;
    color: #888;
    direction: rtl;
    text-align: center;
}

.shipping-next-row strong,
.shipping-next-row strong * {
    color: #555;
    font-weight: 700;
}

.shipping-next-row .shipping-emoji-end {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    margin-inline-start: 4px;
    animation: truckDrift 2.4s ease-in-out infinite;
}

.shipping-state-door .shipping-message {
    color: var(--aliza-green, #6B7B70);
    font-weight: 700;
}

.shipping-message .shipping-emoji-end {
    margin-inline-start: 2px;
}

@keyframes truckDrift {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(-4px); }
}

/* Cart buttons - two button layout */
.widget_shopping_cart .woocommerce-mini-cart__buttons {
    display: flex;
    gap: 10px;
}

.widget_shopping_cart .woocommerce-mini-cart__buttons .button {
    flex: 1;
    margin: 0;
    text-align: center;
}

/* Continue Shopping button - secondary style */
.widget_shopping_cart .woocommerce-mini-cart__buttons .button.continue-shopping {
    background-color: transparent;
    border: 2px solid currentColor;
    color: var(--aliza-black, #231F20);
}

.widget_shopping_cart .woocommerce-mini-cart__buttons .button.continue-shopping:hover {
    background-color: var(--aliza-beige, #DECCC4);
    border-color: var(--aliza-dark-beige, #CDB5AB);
}

/* Checkout button - primary */
.widget_shopping_cart .woocommerce-mini-cart__buttons .button.checkout {
    order: 2;
}

/* Continue shopping - first position */
.widget_shopping_cart .woocommerce-mini-cart__buttons .button.continue-shopping {
    order: 1;
}

/* Hide view cart button if it somehow still appears */
.widget_shopping_cart .woocommerce-mini-cart__buttons a[href*="/cart/"]:not(.checkout):not(.continue-shopping) {
    display: none !important;
}

/* Second Pair Promotion Banner */
.second-pair-promo-banner {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.promo-message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--aliza-black, #231F20);
    text-align: center;
    justify-content: center;
    direction: rtl;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--aliza-beige, #DECCC4) 0%, var(--aliza-dark-beige, #CDB5AB) 100%);
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.promo-message.promo-achieved {
    background-color: var(--aliza-green, #6B7B70);
    color: #fff;
}

.promo-emoji {
    font-size: 18px;
    line-height: 1;
}

.promo-text {
    line-height: 1.4;
}

/* Mini-cart specific styles for promo */
.widget_shopping_cart .second-pair-promo-banner {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
}

/* Promo banner when appearing after cart items */
.second-pair-after-items {
    margin-top: 0;
    margin-bottom: 15px;
    padding-top: 0;
    border-top: none;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

/* Checkout page specific styles for promo */
.woocommerce-checkout .second-pair-promo-banner {
    margin-top: 15px;
}

/* Mobile responsive for promo */
@media (max-width: 549px) {
    .promo-message {
        font-size: 12px;
        padding: 6px 10px;
    }

    .promo-emoji {
        font-size: 14px;
    }

    .widget_shopping_cart .second-pair-promo-banner {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
    }
}
