/* ==========================================================================
   Funnybutton Uitbreidingen - Winkelmand Bevestiging (Toast & Modal) Styling
   ========================================================================== */

:root {
    --fb-cart-primary: #C93C7F;
    --fb-cart-primary-hover: #b32d6c;
    --fb-cart-success: #10b981;
}

/* Onderdruk standaard WooCommerce notice balk wanneer winkelmandbevestiging actief is */
.woocommerce-message:has(.wc-forward),
.woocommerce-notices-wrapper .woocommerce-message:has(.wc-forward),
.woocommerce-notices-wrapper .woocommerce-message:has(.button),
.woocommerce-message.funnybutton-suppressed {
    display: none !important;
}

/* Toast Container */
.funnybutton-cart-toast {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.15), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
    z-index: 999999;
    padding: 18px 20px;
    overflow: hidden;
    opacity: 0;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.funnybutton-cart-toast.funnybutton-show {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 767px) {
    .funnybutton-cart-toast {
        top: auto;
        bottom: 20px;
        right: 20px;
        left: 20px;
        width: auto;
        max-width: none;
        transform: translateY(120%);
        padding: 16px;
    }

    .funnybutton-cart-toast.funnybutton-show {
        transform: translateY(0);
    }
}

/* Modal Overlay & Card */
.funnybutton-cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.funnybutton-cart-modal-overlay.funnybutton-show {
    opacity: 1;
    pointer-events: auto;
}

.funnybutton-cart-modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px 24px;
    width: 100%;
    max-width: 500px;
    margin: 20px;
    position: relative;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.funnybutton-cart-modal-overlay.funnybutton-show .funnybutton-cart-modal {
    transform: scale(1);
    opacity: 1;
}

/* Split View Modal (Confirmation Left, Up-sells Right) */
.funnybutton-cart-modal.funnybutton-cart-modal--has-upsells {
    max-width: 850px;
    min-height: 410px;
    padding: 0;
    display: flex;
    text-align: left;
}

.funnybutton-cart-modal__main {
    flex: 1 1 58%;
    padding: 42px 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

.funnybutton-cart-modal__main .funnybutton-cart-modal__icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px auto;
}

.funnybutton-cart-modal__main .funnybutton-cart-modal__icon-wrap svg {
    width: 32px;
    height: 32px;
}

.funnybutton-cart-modal__main .funnybutton-cart-modal__message {
    font-size: 17px;
    line-height: 1.6;
    margin: 0 0 28px 0;
    padding: 0 5px;
}

.funnybutton-cart-modal__main .funnybutton-cart-btn {
    padding: 12px 20px !important;
    font-size: 14px !important;
}

.funnybutton-cart-modal__upsells {
    flex: 1 1 42%;
    background-color: var(--fb-cart-upsell-bg);
    padding: 32px 22px;
    border-left: 1px solid #e2e8f0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.funnybutton-cart-modal__upsells-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
    padding: 0;
    text-align: left;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.funnybutton-cart-upsells-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.funnybutton-cart-upsell-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.funnybutton-cart-upsell-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.funnybutton-cart-upsell-thumb {
    width: 62px;
    height: 62px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.funnybutton-cart-upsell-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.funnybutton-cart-upsell-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    transition: color 0.15s ease;
}

.funnybutton-cart-upsell-title:hover {
    color: var(--fb-cart-primary);
}

.funnybutton-cart-upsell-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.funnybutton-cart-upsell-price {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.funnybutton-cart-upsell-price del {
    color: #94a3b8;
    font-weight: 400;
    font-size: 12px;
    margin-right: 4px;
}

.funnybutton-cart-upsell-price ins {
    text-decoration: none;
    color: #1e293b;
}

.funnybutton-cart-upsell-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    line-height: 1.2 !important;
    height: auto !important;
}

.funnybutton-cart-upsell-add-btn:hover {
    background-color: var(--fb-cart-primary) !important;
    background: var(--fb-cart-primary) !important;
    color: #ffffff !important;
}

.funnybutton-cart-upsell-add-btn.is-added {
    background-color: var(--fb-cart-success) !important;
    background: var(--fb-cart-success) !important;
    color: #ffffff !important;
    cursor: default;
}

.funnybutton-cart-upsell-add-btn.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

@media (max-width: 767px) {
    .funnybutton-cart-modal.funnybutton-cart-modal--has-upsells {
        flex-direction: column;
        max-width: 500px;
        min-height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .funnybutton-cart-modal__upsells {
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding: 24px 20px;
    }

    .funnybutton-cart-modal__main {
        padding: 30px 22px;
    }
}

/* Close Button */
.funnybutton-cart-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 0;
}

.funnybutton-cart-close-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

/* Content Layouts */
.funnybutton-cart-toast__content {
    display: flex;
    align-items: flex-start;
    margin-right: 15px;
}

.funnybutton-cart-success-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--fb-cart-success);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 12px;
    font-size: 13px;
}

/* Large Success Icon in Modal */
.funnybutton-cart-modal__icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #f0fdf4;
    color: var(--fb-cart-success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px auto;
    font-size: 28px;
}

.funnybutton-cart-toast__message {
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.funnybutton-cart-toast__message strong,
.funnybutton-cart-modal__message strong {
    color: #0f172a;
    font-weight: 600;
}

.funnybutton-cart-modal__message {
    color: #334155;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 24px 0;
    padding: 0 10px;
}

/* Buttons Section */
.funnybutton-cart-toast__buttons,
.funnybutton-cart-modal__buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.funnybutton-cart-modal__buttons {
    justify-content: center;
    margin-top: 0;
}

.funnybutton-cart-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1.2 !important;
    text-align: center;
    white-space: nowrap !important;
    height: auto !important;
    border: none;
    outline: none;
}

@media (max-width: 480px) {
    .funnybutton-cart-modal {
        padding: 24px 18px;
    }
    .funnybutton-cart-modal__buttons {
        flex-direction: column;
        gap: 8px;
    }
    .funnybutton-cart-modal__buttons .funnybutton-cart-btn {
        width: 100%;
    }
}

.funnybutton-cart-btn:active {
    transform: scale(0.98);
}

.funnybutton-cart-btn--primary {
    background-color: var(--fb-cart-primary) !important;
    background: var(--fb-cart-primary) !important;
    color: #ffffff !important;
}

.funnybutton-cart-btn--primary:hover {
    background-color: var(--fb-cart-primary-hover) !important;
    background: var(--fb-cart-primary-hover) !important;
    color: #ffffff !important;
}

.funnybutton-cart-btn--secondary {
    background-color: transparent !important;
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

.funnybutton-cart-btn--secondary:hover {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* Progress Timer Bar */
.funnybutton-cart-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #e2e8f0;
}

.funnybutton-cart-progress-bar__fill {
    height: 100%;
    width: 100%;
    background-color: var(--fb-cart-primary);
    transform-origin: left;
    will-change: width;
}

/* Hide empty WooCommerce notice container wrapping hidden cart confirmation trigger */
.woocommerce-message:has(#funnybutton-cart-added-trigger),
.woocommerce-info:has(#funnybutton-cart-added-trigger),
.woocommerce-notices-wrapper:has(#funnybutton-cart-added-trigger):not(:has(.woocommerce-error, .woocommerce-info:not(:has(#funnybutton-cart-added-trigger)), .woocommerce-message:not(:has(#funnybutton-cart-added-trigger)))),
.woocommerce-message:empty,
.woocommerce-info:empty {
    display: none !important;
}
