/* DISCOUNT TILES CHATBOT CSS - CLEAN MOBILE FIXED VERSION */

#dt-ai-chat,
#dt-ai-chat *{
    box-sizing:border-box;
    font-family:Inter, Arial, sans-serif;
}

#dt-ai-chat{
    position:fixed !important;
    right:22px !important;
    bottom:22px !important;
    z-index:999999999 !important;
}

/* CHAT BUBBLE */
#dt-chat-bubble{
    width:74px;
    height:74px;
    border:0;
    border-radius:50%;
    overflow:hidden;
    background:#fff;
    padding:4px;
    cursor:pointer;
    box-shadow:0 18px 45px rgba(0,0,0,.22);
    display:block;
}

#dt-chat-bubble img{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:50%;
}

/* CHAT PANEL */
#dt-chat-panel{
    position:fixed !important;
    right:24px !important;
    bottom:24px !important;
    left:auto !important;
    top:auto !important;
    width:420px !important;
    max-width:calc(100vw - 48px) !important;
    height:620px !important;
    max-height:calc(100vh - 48px) !important;
    display:none;
    flex-direction:column;
    overflow:hidden;
    background:#fff;
    border-radius:24px;
    box-shadow:0 30px 90px rgba(0,0,0,.22);
    z-index:999999999 !important;
}

#dt-ai-chat.dt-chat-open #dt-chat-panel{
    display:flex !important;
}

#dt-ai-chat.dt-chat-open #dt-chat-bubble{
    display:none !important;
}

/* HEADER */
.dt-chat-head{
    min-height:82px;
    padding:16px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    background:#222;
    color:#fff;
    flex-shrink:0;
}

.dt-chat-head-left{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}

.dt-chat-head-left img{
    width:46px;
    height:46px;
    border-radius:50%;
    object-fit:cover;
    flex-shrink:0;
}

.dt-chat-head strong{
    display:block;
    font-size:19px;
    line-height:1.1;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.dt-chat-head small{
    display:block;
    font-size:12px;
    opacity:.8;
}

#dt-chat-close{
    width:40px;
    height:40px;
    border:0;
    border-radius:50%;
    background:rgba(255,255,255,.12);
    color:#fff;
    font-size:28px;
    cursor:pointer;
    flex-shrink:0;
    line-height:1;
}

/* BODY */
#dt-chat-body{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    padding:14px;
    background:#f4f4f5;
}

.dt-msg{
    margin-bottom:14px;
}

.dt-msg.user{
    text-align:right;
}

.dt-msg-bubble{
    display:inline-block;
    max-width:94%;
    padding:12px 15px;
    border-radius:20px;
    line-height:1.5;
    font-size:14px;
    background:#fff;
    color:#111;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
    word-wrap:break-word;
    overflow-wrap:anywhere;
}

.dt-msg.user .dt-msg-bubble{
    background:#111;
    color:#fff;
}

.dt-loading{
    color:#666;
    font-size:13px;
}

/* SUGGESTION BUTTONS */
.dt-suggest-wrap{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:10px 0 16px;
}

.dt-suggest-btn{
    border:1px solid #e5e7eb;
    background:#fff;
    color:#111;
    padding:10px 14px;
    border-radius:999px;
    cursor:pointer;
    font-size:13px;
    font-weight:700;
}

.dt-suggest-btn:hover{
    background:#111;
    color:#fff;
}

/* PRODUCT CARDS */
.dt-products{
    display:flex !important;
    flex-direction:column !important;
    gap:14px !important;
    width:100% !important;
}

.dt-product-card{
    display:block !important;
    width:100% !important;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:18px;
    padding:12px;
    box-shadow:0 8px 24px rgba(0,0,0,.08);
    overflow:hidden;
}

.dt-product-img{
    display:block !important;
    width:100% !important;
    height:130px !important;
    object-fit:contain !important;
    background:#fafafa;
    border-radius:12px;
    padding:8px;
    margin-bottom:10px;
}

.dt-product-info{
    display:block !important;
    padding:0;
}

.dt-product-info strong{
    display:block;
    font-size:14px;
    line-height:1.35;
    margin-bottom:4px;
    color:#111;
}

.dt-product-info span{
    display:block;
    font-size:13px;
    color:#555;
    margin-bottom:2px;
}

.dt-product-actions{
    display:grid !important;
    grid-template-columns:repeat(3,1fr);
    gap:8px;
    margin-top:10px;
}

.dt-view-btn,
.dt-calc-btn,
.dt-sample-btn{
    display:flex !important;
    align-items:center;
    justify-content:center;
    width:100%;
    min-height:38px;
    padding:0 8px;
    border-radius:10px;
    font-size:12px;
    font-weight:800;
    line-height:1.1;
    text-align:center;
    text-decoration:none !important;
    border:0 !important;
    cursor:pointer;
    white-space:normal;
}

.dt-view-btn{
    background:#111 !important;
    color:#fff !important;
}

.dt-calc-btn{
    background:#e5e7eb !important;
    color:#111 !important;
}

.dt-sample-btn{
    background:#facc15 !important;
    color:#111 !important;
}

/* INPUT FORM */
#dt-chat-form{
    display:flex;
    gap:10px;
    padding:12px;
    background:#fff;
    border-top:1px solid #e5e7eb;
    flex-shrink:0;
    position:relative;
    z-index:5;
    pointer-events:auto !important;
}

#dt-chat-input{
    flex:1;
    height:52px;
    min-width:0;
    border:1px solid #e5e7eb;
    border-radius:18px;
    padding:0 16px;
    font-size:15px;
    outline:0;
    pointer-events:auto !important;
    user-select:text !important;
    -webkit-user-select:text !important;
    cursor:text !important;
}

#dt-chat-form button{
    height:52px;
    border:0;
    background:#111;
    color:#fff;
    border-radius:18px;
    padding:0 22px;
    font-weight:800;
    cursor:pointer;
    flex-shrink:0;
}

/* CALCULATOR */
.dt-chat-calc-box{
    margin-top:8px;
}

.dt-chat-calc-box h4{
    margin:0 0 12px;
    font-size:18px;
}

.dt-chat-calc-box label{
    display:block;
    margin:10px 0 5px;
    font-size:13px;
    font-weight:700;
}

.dt-chat-calc-box input,
.dt-chat-calc-box select{
    width:100%;
    height:42px;
    border:1px solid #dcdcdc;
    border-radius:10px;
    padding:0 12px;
    font-size:14px;
}

.dt-or-divider{
    text-align:center;
    margin:12px 0;
    font-weight:800;
    color:#555;
}

.dt-chat-submit-calc{
    width:100%;
    height:46px;
    margin-top:14px;
    border:0;
    border-radius:12px;
    background:#111;
    color:#fff;
    font-weight:800;
    cursor:pointer;
}

/* SAMPLE FORM */
.dt-chat-sample-box{
    margin-top:8px;
}

.dt-chat-sample-box strong{
    display:block;
    font-size:16px;
    margin-bottom:4px;
}

.dt-chat-sample-box input,
.dt-chat-sample-box textarea,
.dt-chat-sample-box select{
    width:100%;
    min-height:42px;
    margin:6px 0;
    padding:10px 12px;
    border:1px solid #dcdcdc;
    border-radius:10px;
    font-size:14px;
    background:#fff;
}

.dt-chat-sample-box textarea{
    min-height:80px;
    resize:vertical;
}

.dt-chat-submit-sample{
    width:100%;
    height:46px;
    margin-top:10px;
    border:0;
    border-radius:12px;
    background:#111;
    color:#fff;
    font-weight:800;
    cursor:pointer;
}

/* MOBILE */
@media(max-width:768px){

    #dt-ai-chat{
        right:8px !important;
        left:8px !important;
        bottom:8px !important;
        width:auto !important;
        z-index:999999999 !important;
    }

    #dt-chat-bubble{
        width:66px !important;
        height:66px !important;
        margin-left:auto;
    }

    #dt-chat-panel{
        position:fixed !important;
        left:8px !important;
        right:8px !important;
        bottom:8px !important;
        top:auto !important;
        width:auto !important;
        max-width:none !important;
        height:85vh !important;
        max-height:85vh !important;
        border-radius:22px !important;
        overflow:hidden !important;
    }

    #dt-ai-chat:not(.dt-chat-open) #dt-chat-panel{
        display:none !important;
        visibility:hidden !important;
        opacity:0 !important;
        pointer-events:none !important;
    }

    #dt-ai-chat.dt-chat-open #dt-chat-panel{
        display:flex !important;
        visibility:visible !important;
        opacity:1 !important;
        pointer-events:auto !important;
    }

    body.dt-chat-mobile-open{
        overflow:hidden !important;
    }

    .dt-chat-head{
        min-height:72px;
        padding:12px 14px;
    }

    .dt-chat-head strong{
        font-size:16px;
    }

    .dt-chat-head small{
        font-size:11px;
    }

    .dt-chat-head-left img{
        width:40px;
        height:40px;
    }

    #dt-chat-close{
        width:38px;
        height:38px;
        font-size:26px;
    }

    #dt-chat-body{
        flex:1 1 auto !important;
        min-height:0 !important;
        height:auto !important;
        overflow-y:auto !important;
        -webkit-overflow-scrolling:touch !important;
        padding:12px !important;
        padding-bottom:14px !important;
    }

    .dt-msg-bubble{
        max-width:96%;
        font-size:13px;
        padding:11px 13px;
    }

    .dt-products{
        display:flex !important;
        flex-direction:column !important;
        gap:12px !important;
        width:100% !important;
    }

    .dt-product-card{
        display:block !important;
        width:100% !important;
        min-height:auto !important;
        padding:10px !important;
        border-radius:16px !important;
        overflow:hidden !important;
    }

    .dt-product-img{
        display:block !important;
        width:100% !important;
        height:125px !important;
        object-fit:contain !important;
        padding:8px !important;
        margin-bottom:8px !important;
    }

    .dt-product-info strong{
        font-size:13px;
    }

    .dt-product-info span{
        font-size:12px;
    }

    .dt-product-actions{
        display:grid !important;
        grid-template-columns:1fr 1fr 1fr !important;
        gap:6px !important;
        margin-top:8px !important;
    }

    .dt-view-btn,
    .dt-calc-btn,
    .dt-sample-btn{
        font-size:11px !important;
        min-height:36px !important;
        padding:0 5px !important;
        border-radius:9px !important;
    }

    #dt-chat-form{
        padding:10px !important;
        gap:8px !important;
        flex-shrink:0 !important;
        position:relative !important;
        bottom:auto !important;
    }

    #dt-chat-input{
        height:48px !important;
        font-size:14px !important;
    }

    #dt-chat-form button{
        height:48px !important;
        padding:0 14px !important;
        font-size:13px !important;
    }
}

@media(max-width:380px){
    .dt-product-actions{
        grid-template-columns:1fr !important;
    }

    .dt-view-btn,
    .dt-calc-btn,
    .dt-sample-btn{
        min-height:38px !important;
    }
}
