/* Gift offer UI — spec from Figma Fresubin-WWW 2467:13781 (banner) / 2447:22128 (modal)
   blue #006AB4 | cyan #00ADE9 | chip bg rgba(0,173,233,.1) | borders #E4E9F5, #E7E7E7
   font: Poppins (inherited from theme body) */

/* ---------- shared ---------- */

.fs-gift-offer-banner .fs-offer-accept,
#fs-gift-offer-modal .fs-offer-accept {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border: 0;
    background: #00ADE9;
    color: #fff;
    font-family: inherit;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: filter 0.3s;
}

.fs-gift-offer-banner .fs-offer-accept::before,
#fs-gift-offer-modal .fs-offer-accept::before {
    content: '';
    flex: 0 0 auto;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1.5'/%3E%3Ccircle cx='19' cy='21' r='1.5'/%3E%3Cpath d='M1 2h3l3.4 13.4a1 1 0 0 0 1 .6h9.8a1 1 0 0 0 1-.7L22 7H6'/%3E%3C/svg%3E") no-repeat center / contain;
}

.fs-gift-offer-banner .fs-offer-accept:hover,
#fs-gift-offer-modal .fs-offer-accept:hover {
    filter: brightness(1.2);
}

/* loading state: cart icon becomes a spinner, clicks ignored */
.fs-offer-accept.is-loading {
    pointer-events: none;
    opacity: 0.75;
}

.fs-offer-accept.is-loading::before {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fs-offer-spin 0.6s linear infinite;
}

@keyframes fs-offer-spin {
    to { transform: rotate(360deg); }
}

.fs-offer-eyebrow {
    display: block;
    color: #00ADE9;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
}

.fs-offer-title {
    display: block;
    color: #006AB4;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

/* two-scale headline from the mockup: wrap the big word in the template,
   e.g. <span class="fs-offer-large">Fresubin</span> */
.fs-offer-large {
    display: block;
    font-weight: 600;
    line-height: 1.15;
}

.fs-gift-offer-banner .fs-offer-large {
    font-size: 17px;
}

#fs-gift-offer-modal .fs-offer-large {
    font-size: 64px;
}

.fs-offer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3em;
    background: rgba(0, 173, 233, 0.1);
    border: 1px solid #E4E9F5;
    color: #006AB4;
    font-weight: 600;
    white-space: nowrap;
}

/* strip wc_price markup styling inside badge */
.fs-offer-badge .woocommerce-Price-amount {
    color: inherit;
    font-weight: inherit;
}

/* ---------- mini cart banner (Frame 236) ---------- */

.fs-gift-offer-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #E4E9F5;
    border-radius: 5px;
}

.fs-gift-offer-banner .fs-offer-box-img {
    flex: 0 0 62px;
}

.fs-gift-offer-banner .fs-offer-box-img img {
    width: 62px;
    height: auto;
    display: block;
}

.fs-gift-offer-banner .fs-offer-box-text {
    flex: 1 1 auto;
    min-width: 0;
}

.fs-gift-offer-banner .fs-offer-eyebrow {
    font-size: 8px;
}

.fs-gift-offer-banner .fs-offer-title {
    font-size: 8px;
    margin: 2px 0;
}


.fs-gift-offer-banner .fs-offer-box-actions {
    flex: 0 0 106px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fs-gift-offer-banner .fs-offer-badge {
    height: 26px;
    border-radius: 4px;
    font-size: 8px;
}

.fs-gift-offer-banner .fs-offer-accept {
    height: 26px;
    gap: 5px;
    border-radius: 3px;
    font-size: 8px;
}

.fs-gift-offer-banner .fs-offer-accept::before {
    width: 10px;
    height: 9px;
    margin-top: -2px;
}

/* decline: circled × on the top-right corner, shown on box hover */
.fs-gift-offer-banner .fs-offer-decline {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #E4E9F5;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    color: #006AB4;
    font-size: 0;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.fs-gift-offer-banner .fs-offer-decline::after {
    content: '\00d7';
    font-size: 14px;
}

.fs-gift-offer-banner:hover .fs-offer-decline,
.fs-gift-offer-banner .fs-offer-decline:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.fs-gift-offer-banner .fs-offer-decline:hover {
    color: #E40041;
    border-color: #E40041;
}

/* no hover on touch layouts: keep decline visible */
@media (max-width: 767px) {
    .fs-gift-offer-banner .fs-offer-decline {
        opacity: 1;
        pointer-events: auto;
    }

    .fs-gift-offer-banner {
        padding: 6px;
        gap: 7px;
    }

    .fs-gift-offer-banner .fs-offer-box-img {
        flex: 0 0 54px;
    }

    .fs-gift-offer-banner .fs-offer-box-img img {
        width: 54px;
    }

    .fs-gift-offer-banner .fs-offer-box-actions {
        flex: 0 0 100px;
    }

    .fs-gift-offer-banner .fs-offer-accept {
        font-size: 8px;
    }
}

/* scaled-up banner on large screens (theme mini cart is 500px wide there) */
@media (min-width: 1401px) {
    .fs-gift-offer-banner {
        padding: 12px;
        gap: 14px;
    }

    .fs-gift-offer-banner .fs-offer-box-img {
        flex-basis: 80px;
    }

    .fs-gift-offer-banner .fs-offer-box-img img {
        width: 80px;
    }

    .fs-gift-offer-banner .fs-offer-eyebrow {
        font-size: 12px;
    }

    .fs-gift-offer-banner .fs-offer-title {
        font-size: 12px;
    }

    .fs-gift-offer-banner .fs-offer-large {
        font-size: 26px;
    }

    .fs-gift-offer-banner .fs-offer-box-actions {
        flex-basis: 140px;
    }

    .fs-gift-offer-banner .fs-offer-badge {
        height: 32px;
        font-size: 12px;
    }

    .fs-gift-offer-banner .fs-offer-accept {
        height: 32px;
        gap: 8px;
        font-size: 12px;
    }

    .fs-gift-offer-banner .fs-offer-accept::before {
        width: 13px;
        height: 12px;
    }
}

/* ---------- modal (Frame 105, 1000x593) ---------- */

#fs-gift-offer-modal {
    padding: 15px;
}

#fs-gift-offer-modal .fs-gift-modal-inner {
    background: #fff;
    border-radius: 8px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
}

#fs-gift-offer-modal .fs-offer-modal {
    position: relative;
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 56px;
}

#fs-gift-offer-modal .fs-offer-modal-img {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

#fs-gift-offer-modal .fs-offer-modal-img img {
    max-width: 100%;
    height: auto;
}

#fs-gift-offer-modal .fs-offer-modal-content {
    flex: 1 1 0;
    min-width: 0;
    text-align: left;
}

#fs-gift-offer-modal .fs-offer-eyebrow {
    font-size: 30px;
}

#fs-gift-offer-modal .fs-offer-title {
    font-size: 30px;
    line-height: 1.2;
    margin: 4px 0;
}

#fs-gift-offer-modal .fs-offer-badge {
    height: 85px;
    padding: 20px;
    border-radius: 10px;
    font-size: 30px;
    margin: 32px 0 0;
}

#fs-gift-offer-modal .fs-offer-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 40px;
}

#fs-gift-offer-modal .fs-offer-actions .fs-offer-accept {
    width: 100%;
    height: 45px;
    gap: 20px;
    border-radius: 5px;
    font-size: 16px;
}

#fs-gift-offer-modal .fs-offer-actions .fs-offer-accept::before {
    width: 19px;
    height: 17px;
}

#fs-gift-offer-modal .fs-offer-actions .fs-offer-decline {
    width: 100%;
    height: 45px;
    background: #fff;
    border: 1px solid #E7E7E7;
    border-radius: 5px;
    color: #00ADE9;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

#fs-gift-offer-modal .fs-offer-actions .fs-offer-decline:hover {
    background: rgba(0, 173, 233, 0.08);
}

#fs-gift-offer-modal .fs-offer-modal .fs-offer-close {
    position: absolute;
    top: 32px;
    right: 48px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #006AB4;
    font-size: 44px;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.3s;
}

#fs-gift-offer-modal .fs-offer-modal .fs-offer-close:hover {
    opacity: 0.5;
}

/* mobile modal per Figma 2467:13804 — stacked, centered, must never overflow viewport */
@media (max-width: 900px) {
    #fs-gift-offer-modal .fs-gift-modal-inner {
        max-height: calc(100dvh - 30px);
        overflow: auto;
    }

    #fs-gift-offer-modal .fs-offer-modal {
        flex-direction: column;
        gap: 16px;
        padding: 40px 24px 24px;
    }

    #fs-gift-offer-modal .fs-offer-modal-img img {
        max-width: min(287px, 65vw);
        max-height: 32dvh;
        width: auto;
    }

    #fs-gift-offer-modal .fs-offer-modal-content {
        max-width: 100%;
        width: 100%;
        text-align: center;
    }

    #fs-gift-offer-modal .fs-offer-eyebrow {
        font-size: 20px;
    }

    #fs-gift-offer-modal .fs-offer-title {
        font-size: 20px;
    }

    #fs-gift-offer-modal .fs-offer-large {
        font-size: 44px;
    }

    #fs-gift-offer-modal .fs-offer-badge {
        display: flex;
        width: 100%;
        height: 58px;
        padding: 14px;
        border-radius: 7px;
        font-size: 30px;
        margin-top: 20px;
    }

    /* buttons side by side, decline left / accept right */
    #fs-gift-offer-modal .fs-offer-actions {
        flex-direction: row;
        gap: 10px;
        margin-top: 24px;
    }

    #fs-gift-offer-modal .fs-offer-actions .fs-offer-decline {
        order: 1;
        flex: 0 0 40%;
        width: auto;
        font-size: 14px;
    }

    #fs-gift-offer-modal .fs-offer-actions .fs-offer-accept {
        order: 2;
        flex: 1 1 auto;
        width: auto;
        gap: 10px;
        font-size: 14px;
    }

    #fs-gift-offer-modal .fs-offer-modal .fs-offer-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 32px;
    }
}

/* ---------- theme mini cart coupon input: placeholder too large on small screens ---------- */

@media (max-width: 1400px) {
    #mini-cart .mini-cart-coupon input.input-text,
    #mini-cart .mini-cart-coupon input.input-text::placeholder {
        font-size: 12px;
    }
}

@media (max-width: 767px) {
    #fs-gift-offer-modal .fs-offer-badge {
        font-size: 20px;
    }
}

/* laptop (1366x700-class): tighter modal so no vertical overflow */
@media (min-width: 901px) and (max-width: 1400px) {
    #fs-gift-offer-modal .fs-offer-modal {
        padding: 32px 40px;
        gap: 20px;
    }

    #fs-gift-offer-modal .fs-offer-modal-img img {
        max-height: 55vh;
        width: auto;
    }

    #fs-gift-offer-modal .fs-offer-eyebrow {
        font-size: 24px;
    }

    #fs-gift-offer-modal .fs-offer-title {
        font-size: 24px;
    }

    #fs-gift-offer-modal .fs-offer-large {
        font-size: 48px;
    }

    #fs-gift-offer-modal .fs-offer-badge {
        height: 64px;
        padding: 12px;
        margin-top: 16px;
        font-size: 24px;
    }

    #fs-gift-offer-modal .fs-offer-actions {
        margin-top: 20px;
    }

    #fs-gift-offer-modal .fs-offer-modal .fs-offer-close {
        top: 20px;
        right: 28px;
    }
}

/* ---------- gift line in mini cart / cart / checkout ---------- */

.fs-gift-badge {
    display: block;
    width: fit-content;
    padding: 2px 8px;
    margin-bottom: 3px;
    background: #00ADE9;
    border-radius: 3px;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.fs-gift-promo-price del {
    opacity: 0.55;
}

.fs-gift-promo-price ins {
    text-decoration: none;
    font-weight: 600;
    color: #E40041;
}

/* gift row in theme mini cart: flex row (image | text), inline promo prices,
   tighter spacing (!important beats theme's #mini-cart nested selectors) */
#mini-cart .fs-gift-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px !important;
    margin-top: 15px !important;
    overflow: hidden !important;
}

#mini-cart .fs-gift-item .thumbnail-container {
    float: none;
    flex: 0 0 80px;
    width: 80px !important;
    height: auto !important;
}

#mini-cart .fs-gift-item .info-container {
    float: none;
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    padding-left: 0 !important;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    position: relative;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* badge pinned to the top of the row; title + price center against the image */
#mini-cart .fs-gift-item .fs-gift-badge {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
}

#mini-cart .fs-gift-item h3 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px !important;
    line-height: 1.35 !important;
    padding-right: 12px;
}

/* prices: one row, right-aligned, vertically centered like the title
   (width:auto kills theme's width:100% that crushed the title column) */
#mini-cart .fs-gift-item .price-container {
    position: static !important;
    width: auto !important;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 8px;
    margin-top: 0;
}

#mini-cart .fs-gift-item .price-container p {
    white-space: nowrap;
}

/* remove: circled ×, hover-revealed — same look as the offer box close */
#mini-cart .fs-gift-item .remove_from_cart_button_custom {
    top: 0 !important;
    right: 0 !important;
    width: 18px !important;
    height: 18px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: 1px solid #E4E9F5 !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    color: #006AB4 !important;
    font-size: 11px !important;
    line-height: 1 !important;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

#mini-cart .fs-gift-item:hover .remove_from_cart_button_custom {
    opacity: 1;
    pointer-events: auto;
}

#mini-cart .woocommerce-mini-cart .mini_cart_item.fs-gift-item .remove_from_cart_button_custom:hover {
    color: #E40041 !important;
    border-color: #E40041 !important;
    background: #fff !important;
}

@media (max-width: 767px) {
    #mini-cart .woocommerce-mini-cart .mini_cart_item.fs-gift-item .remove_from_cart_button_custom {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

#mini-cart .fs-gift-item .price-container .regular-price {
    font-size: 12px !important;
}

#mini-cart .fs-gift-item .price-container .sale-price {
    font-size: 14px !important;
    margin-top: 0 !important;
    color: #E40041 !important;
}

@media (max-width: 1400px) {
    #mini-cart .fs-gift-item {
        padding-bottom: 10px !important;
        margin-top: 10px !important;
    }

    #mini-cart .fs-gift-item .thumbnail-container {
        flex-basis: 64px;
        width: 64px !important;
    }

    #mini-cart .fs-gift-item h3 {
        font-size: 11px !important;
    }

    #mini-cart .fs-gift-item .fs-gift-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    #mini-cart .fs-gift-item .price-container .regular-price {
        font-size: 10px !important;
    }

    #mini-cart .fs-gift-item .price-container .sale-price {
        font-size: 11px !important;
    }
}

@media (max-width: 767px) {
    #mini-cart .fs-gift-item .thumbnail-container {
        flex-basis: 54px;
        width: 54px !important;
    }

    #mini-cart .fs-gift-item h3 {
        font-size: 10px !important;
    }

    #mini-cart .fs-gift-item .fs-gift-badge {
        font-size: 8px;
        padding: 1px 5px;
    }

    #mini-cart .fs-gift-item .info-container {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    #mini-cart .fs-gift-item .price-container .regular-price {
        font-size: 9px !important;
    }

    #mini-cart .fs-gift-item .price-container .sale-price {
        font-size: 10px !important;
    }
}
