/**
 * Gift stepper – cart total + gift milestones box
 * Markup: display_custom_cart_message_updated() in functions.php
 * Figma: MEDIHUB WEB Design – desktop 2059:27346, tablet 2060:4209, mobile 2060:4256
 */

/* Container – doubled class beats legacy Customizer ".custom-cart-message-container" rule */
.custom-cart-message-container.mh-gift-stepper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: 24px 32px;
    border-radius: 32px;
    background: #dddfe0;
    overflow: hidden;
    font-family: inherit;
    color: #111;
}

.mh-gift-stepper,
.mh-gift-stepper * {
    box-sizing: border-box;
}

.mh-gift-stepper p {
    margin: 0;
}

/* Header */
.mh-gift-stepper__header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.mh-gift-stepper__featured-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 8px;
    background: #1c1b1b;
}

.mh-gift-stepper__featured-icon img {
    display: block;
    width: 24px;
    height: 24px;
    max-width: none;
}

.mh-gift-stepper__text {
    display: flex;
    flex-direction: column;
    flex: 1 0 0;
    min-width: 0;
}

.mh-gift-stepper__title {
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: -0.28px;
    color: #111;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mh-gift-stepper__subtitle {
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    letter-spacing: -0.24px;
    color: #31302f;
}

/* Badges */
.mh-gift-stepper__badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
    height: 24px;
    padding: 4px 8px;
    border-radius: 1024px;
    font-size: 10px;
    font-weight: 500;
    line-height: 12px;
    letter-spacing: -0.1px;
    color: #111;
    text-align: center;
    white-space: nowrap;
}

.mh-gift-stepper__badge--total {
    border: 1px solid #e3e2e1;
    background: #fff;
}

.mh-gift-stepper__badge--remaining {
    background: rgba(75, 98, 105, 0.2);
}

.mh-gift-stepper__badge .woocommerce-Price-amount {
    font-weight: inherit;
    color: inherit;
}

/* Stepper */
.mh-gift-stepper__steps {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.mh-gift-stepper__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 0 0;
    min-width: 0;
    gap: 8px;
    padding-bottom: 32px; /* badge height + gap, keeps every step on one axis */
}

.mh-gift-stepper__item.is-next,
.mh-gift-stepper--complete .mh-gift-stepper__item {
    padding-bottom: 0;
}

.mh-gift-stepper__item--start {
    gap: 0;
}

.mh-gift-stepper__label {
    width: 100%;
    font-size: 10px;
    font-weight: 500;
    line-height: 12px;
    letter-spacing: -0.1px;
    color: #111;
    text-align: center;
    white-space: nowrap;
}

.mh-gift-stepper__step {
    display: flex;
    align-items: center;
    width: 100%;
}

.mh-gift-stepper__line {
    flex: 1 0 0;
    height: 1px;
    background: #c8c6c4;
}

.mh-gift-stepper__item.is-reached .mh-gift-stepper__line {
    background: #4b6269;
}

.mh-gift-stepper__item:first-child .mh-gift-stepper__line:first-child,
.mh-gift-stepper__item:last-child .mh-gift-stepper__line:last-child {
    background: transparent;
}

.mh-gift-stepper__dot {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #384a4f;
}

.mh-gift-stepper__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 8px;
    border-radius: 50%;
    background: #f8f8f8;
}

.mh-gift-stepper__item.is-reached .mh-gift-stepper__icon {
    background: #384a4f;
}

.mh-gift-stepper__icon img {
    display: block;
    width: 16px;
    height: 16px;
    max-width: none;
}

/* Last milestone: keep the badge inside the box instead of clipping it */
.mh-gift-stepper__item:last-child .mh-gift-stepper__badge--remaining {
    align-self: flex-end;
}

.mh-gift-stepper .simple-timer:empty {
    display: none;
}

/* Mobile */
@media (max-width: 767px) {
    .custom-cart-message-container.mh-gift-stepper {
        gap: 16px;
        padding: 24px 16px;
    }

    .mh-gift-stepper__header {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 8px;
    }

    .mh-gift-stepper__featured-icon {
        display: none;
    }

    .mh-gift-stepper__text {
        flex: none;
        width: 100%;
    }

    .mh-gift-stepper__dot {
        width: 12px;
        height: 12px;
    }

    .mh-gift-stepper__icon {
        width: 24px;
        height: 24px;
        padding: 6px;
    }

    .mh-gift-stepper__icon img {
        width: 12px;
        height: 12px;
    }
}