/*
 * Discover mini-cart shipping milestone.
 * Scoped to the Discover theme; no changes to Hyvä mini-cart JS or checkout.
 */
body.ventusis-starter #cart-drawer.ventusis-cart-drawer {
    --discover-reward-accent: #a85d61;
    --discover-reward-ink: #32292c;
    --discover-reward-muted: #766f70;
    --discover-reward-green: #268b53;
}

/* The shared B2C drawer has a bottom progress block; move the visual tier
 * above cart items in Discover through its supported child-block slot. */
body.ventusis-starter #cart-drawer.ventusis-cart-drawer
.ventusis-cart-footer .ventusis-cart-shipping-progress {
    display: none;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-milestone {
    flex: 0 0 auto;
    padding: 16px 18px 13px;
    border-bottom: 1px solid #f0e8e5;
    background: #fffaf8;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-message {
    margin: 0 0 14px;
    color: var(--discover-reward-ink);
    font-size: 14px;
    font-weight: 450;
    line-height: 1.5;
    text-align: center;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-message strong {
    color: var(--discover-reward-accent);
    font-weight: 750;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-meter {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0;
    padding-left: 2px;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-track {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: #f0dedb;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-fill {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: repeating-linear-gradient(
        115deg,
        #eaa995 0 13px,
        #d47e76 13px 26px,
        #a85d61 26px 39px
    );
    background-size: 78px 100%;
    animation: discover-shipping-stripes 1.35s linear infinite;
    transition: width 340ms ease;
}

@keyframes discover-shipping-stripes {
    to { background-position: 78px 0; }
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-marker {
    position: relative;
    display: inline-flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-left: -6px;
    border: 3px solid #e0dce4;
    border-radius: 50%;
    background: #fff;
    color: #6c6467;
    z-index: 1;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-footnote {
    margin: 6px 0 0;
    color: var(--discover-reward-muted);
    font-size: 12px;
    line-height: 1.3;
    text-align: right;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-milestone--complete {
    background: #f4faf6;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-milestone--complete
.ms-discover-shipping-message strong {
    color: #20774a;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-milestone--complete
.ms-discover-shipping-track {
    background: #dcece1;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-milestone--complete
.ms-discover-shipping-fill {
    background: var(--discover-reward-green);
    animation: none;
}

body.ventusis-starter #cart-drawer .ms-discover-shipping-milestone--complete
.ms-discover-shipping-marker {
    background: var(--discover-reward-green);
    color: #fff;
    border-color: var(--discover-reward-green);
}

body.ventusis-starter #cart-drawer .ventusis-cart-checkout {
    background: var(--discover-reward-accent);
    border-color: var(--discover-reward-accent);
    color: #fff;
}

body.ventusis-starter #cart-drawer .ventusis-cart-checkout:hover {
    background: #8a434d;
    border-color: #8a434d;
}

@media (max-width: 767px) {
    body.ventusis-starter #cart-drawer .ms-discover-shipping-milestone {
        padding: 14px 16px 11px;
    }

    body.ventusis-starter #cart-drawer .ms-discover-shipping-message {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ventusis-starter #cart-drawer .ms-discover-shipping-fill {
        animation: none;
        transition: none;
    }
}

/* Two-step reward ladder. Shipping and gift remain independent milestones. */
body.ventusis-starter #cart-drawer .ms-discover-dual-rewards {
    padding: 12px 12px 2px 2px;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-track {
    position: relative;
    height: 11px;
    margin: 15px 13px 0 8px;
    border-radius: 999px;
    background: #f0dedb;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-fill {
    display: block;
    height: 100%;
    max-width: 100%;
    border-radius: inherit;
    background: repeating-linear-gradient(115deg, #eaa995 0 13px, #d47e76 13px 26px, #a85d61 26px 39px);
    background-size: 78px 100%;
    animation: discover-shipping-stripes 1.35s linear infinite;
    transition: width 380ms ease;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-marker {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 2px solid #ded4d7;
    border-radius: 50%;
    background: #fff;
    color: #887c80;
    transform: translate(-50%, -50%);
    transition: background-color 280ms ease, border-color 280ms ease, color 280ms ease, transform 280ms ease;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-marker svg {
    width: 22px;
    height: 22px;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-marker--gift {
    left: 100%;
    width: 43px;
    height: 43px;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-marker.is-unlocked {
    background: #268b53;
    border-color: #268b53;
    color: #fff;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-labels {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 25px;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-label {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 64px;
    color: #766f70;
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-label--gift {
    text-align: right;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-label strong {
    font-size: 12px;
    font-weight: 750;
    color: #a85d61;
}
body.ventusis-starter #cart-drawer .ms-discover-dual-label.is-unlocked,
body.ventusis-starter #cart-drawer .ms-discover-dual-label.is-unlocked strong {
    color: #268b53;
}
body.ventusis-starter #cart-drawer .ms-discover-gift-nudge {
    margin: 12px 0 0;
    color: #766f70;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}
body.ventusis-starter #cart-drawer .ms-discover-gift-nudge strong {
    color: #a85d61;
}
body.ventusis-starter #cart-drawer .ms-discover-gift-celebration {
    display: inline-block;
    margin: 0 3px;
    color: #268b53;
}
body.ventusis-starter #cart-drawer .ms-discover-gift--complete .ms-discover-dual-fill {
    background: #268b53;
    animation: none;
}
body.ventusis-starter #cart-drawer .ms-discover-gift--complete .ms-discover-dual-marker--gift {
    animation: discover-gift-pop 680ms ease-out 1;
}
@keyframes discover-gift-pop {
    0% { transform: translate(-50%, -50%) scale(.75); }
    45% { transform: translate(-50%, -50%) scale(1.18); }
    100% { transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    body.ventusis-starter #cart-drawer .ms-discover-dual-fill,
    body.ventusis-starter #cart-drawer .ms-discover-dual-marker--gift {
        animation: none;
        transition: none;
    }
}

/* Compact mobile reward drawer: keep products visible without shrinking tap targets. */
@media (max-width: 767px) {
    body.ventusis-starter #cart-drawer.ventusis-cart-drawer .ventusis-cart-header {
        padding: 9px 13px;
        min-height: 54px;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-title { font-size: 17px; }
    body.ventusis-starter #cart-drawer .ventusis-cart-close {
        width: 40px; height: 40px; flex-basis: 40px;
    }
    body.ventusis-starter #cart-drawer .ms-discover-shipping-milestone {
        padding: 8px 14px 7px;
    }
    body.ventusis-starter #cart-drawer .ms-discover-shipping-message {
        margin-bottom: 7px; font-size: 12px; line-height: 1.3;
    }
    body.ventusis-starter #cart-drawer .ms-discover-dual-rewards { padding: 4px 9px 0 2px; }
    body.ventusis-starter #cart-drawer .ms-discover-dual-track {
        margin: 12px 10px 0 7px; height: 7px;
    }
    body.ventusis-starter #cart-drawer .ms-discover-dual-marker,
    body.ventusis-starter #cart-drawer .ms-discover-dual-marker--gift {
        width: 30px; height: 30px; border-width: 1px;
    }
    body.ventusis-starter #cart-drawer .ms-discover-dual-marker svg { width: 18px; height: 18px; }
    body.ventusis-starter #cart-drawer .ms-discover-dual-labels { margin-top: 18px; }
    body.ventusis-starter #cart-drawer .ms-discover-dual-label {
        font-size: 10px; line-height: 1.18;
    }
    body.ventusis-starter #cart-drawer .ms-discover-dual-label strong { font-size: 11px; }
    body.ventusis-starter #cart-drawer .ms-discover-gift-nudge {
        margin-top: 6px; font-size: 11px; line-height: 1.25;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-items { padding: 0 10px; }
    body.ventusis-starter #cart-drawer .ventusis-cart-item {
        gap: 9px; padding: 8px 2px;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-item-image {
        width: 55px; height: 55px; flex-basis: 55px; padding: 3px;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-item-title {
        font-size: 12px; line-height: 1.28; font-weight: 650;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-item-price,
    body.ventusis-starter #cart-drawer .ventusis-cart-item-price .price {
        font-size: 11px; line-height: 1.25;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-item-controls {
        margin-top: 5px; gap: 6px;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-stepper,
    body.ventusis-starter #cart-drawer .ventusis-cart-stepper button {
        height: 40px;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-stepper button { width: 40px; }
    body.ventusis-starter #cart-drawer .ventusis-cart-icon-button {
        width: 40px; height: 40px;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-footer {
        padding: 9px 13px max(10px, env(safe-area-inset-bottom));
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-subtotal { font-size: 13px; }
    body.ventusis-starter #cart-drawer .ventusis-cart-subtotal dd { font-size: 15px; }
    body.ventusis-starter #cart-drawer .ventusis-cart-footer-actions {
        margin-top: 8px; gap: 6px;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-footer-actions > a {
        min-height: 44px; padding: 8px 10px; font-size: 12px;
    }
    body.ventusis-starter #cart-drawer .ventusis-cart-gift-tag {
        display: inline-block; margin-top: 5px; color: #20774a;
        font-size: 11px; line-height: 1.25; font-weight: 750;
    }
}

/* Single checkout action with the live subtotal. */
body.ventusis-starter #cart-drawer .ventusis-cart-checkout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}
body.ventusis-starter #cart-drawer .ventusis-cart-checkout-amount,
body.ventusis-starter #cart-drawer .ventusis-cart-checkout-amount .price {
    color: inherit;
    font: inherit;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Delivery cost remains visible beside the subtotal, even before checkout. */
body.ventusis-starter #cart-drawer .ventusis-cart-delivery {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 4px 0 0;
    color: #5f6674;
    font-size: 12px;
    line-height: 1.4;
}
body.ventusis-starter #cart-drawer .ventusis-cart-delivery dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
body.ventusis-starter #cart-drawer .ventusis-cart-delivery--free {
    color: #20774a;
}