/* Scope intrinsic-width fixes to the product description card. */
.single-product .div-mota {
    min-width: 0;
}

.single-product div#tab-description {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

.single-product #tab-description img {
    max-width: 100%;
    height: auto;
}

.single-product #tab-description video,
.single-product #tab-description iframe {
    max-width: 100%;
}

.single-product #tab-description .vodien-description-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.single-product #tab-description .vodien-description-table:focus-visible {
    outline: 2px solid #d70018;
    outline-offset: 2px;
}

.single-product #tab-description .itcodewp_readmore_flatsome {
    left: 0;
    right: 0;
    width: auto;
}

.single-product #tab-description .itcodewp_readmore_flatsome a {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: calc(100% - 24px);
    padding: 8px 24px;
    border: 1px solid transparent;
}

@media (max-width: 768px), (max-width: 1024px) and (max-height: 500px) {
    #wp-ai-chatbot[data-state="closed"][data-position="bottom-right"] {
        right: max(16px, env(safe-area-inset-right, 0px)) !important;
        bottom: max(20px, env(safe-area-inset-bottom, 0px)) !important;
        top: auto !important;
        left: auto !important;
        --raplsaich-badge-size: 48px !important;
    }

    #wp-ai-chatbot[data-state="closed"] .chatbot-badge {
        min-width: 48px;
        min-height: 48px;
    }

    #wp-ai-chatbot[data-state="closed"].vodien-chat-managed {
        transform: translateY(calc(-1 * var(--vodien-chat-lift, 0px)));
    }

    #wp-ai-chatbot[data-state="closed"].vodien-chat-suppressed {
        visibility: hidden;
        pointer-events: none;
    }
}

@media (max-width: 768px) and (hover: none), (max-width: 1024px) and (max-height: 500px) and (hover: none) {
    #wp-ai-chatbot[data-state="closed"] .chatbot-badge:hover {
        transform: none !important;
    }
}

/* Short landscape needs a bounded floating panel; <=480px retains native fullscreen. */
@media (min-width: 481px) and (max-width: 1024px) and (max-height: 500px) {
    #wp-ai-chatbot[data-state="open"] {
        right: max(12px, env(safe-area-inset-right, 0px)) !important;
        bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
        top: auto !important;
        left: auto !important;
    }

    #wp-ai-chatbot[data-state="open"] .chatbot-window {
        min-width: 0;
        min-height: 0;
        width: min(var(--raplsaich-window-width, 380px), calc(100vw - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px)))) !important;
        max-width: calc(100vw - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px))) !important;
        height: min(var(--raplsaich-window-height, 520px), calc(100vh - max(12px, env(safe-area-inset-top, 0px)) - max(12px, env(safe-area-inset-bottom, 0px)))) !important;
        height: min(var(--raplsaich-window-height, 520px), calc(100dvh - max(12px, env(safe-area-inset-top, 0px)) - max(12px, env(safe-area-inset-bottom, 0px)))) !important;
        max-height: calc(100vh - max(12px, env(safe-area-inset-top, 0px)) - max(12px, env(safe-area-inset-bottom, 0px))) !important;
        max-height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px)) - max(12px, env(safe-area-inset-bottom, 0px))) !important;
    }

    #wp-ai-chatbot[data-state="open"] .chatbot-messages {
        min-height: 0;
    }
}

@media (max-width: 480px) {
    #wp-ai-chatbot[data-state="open"] .chatbot-window {
        min-width: 0;
        min-height: 0;
    }

    #wp-ai-chatbot[data-state="open"] .chatbot-header {
        padding-top: max(16px, env(safe-area-inset-top, 0px));
    }

    #wp-ai-chatbot[data-state="open"] .chatbot-input {
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }
}
