/* Ask Dukani - Shopping Assistant Widget Styles (scoped under .dk-assist-*) */
.dk-assist-fab {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 1045;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: transform 0.18s ease;
}
.dk-assist-fab:hover,
.dk-assist-fab:focus {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: translateY(-2px);
    outline: none;
}
.dk-assist-fab-png {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.18));
}
.dk-assist-fab-label {
    color: #d90b6c;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.1;
    background: transparent !important;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95);
    white-space: nowrap;
}

/* Keep clear of mobile bottom nav */
@media (max-width: 1199.98px) {
    .dk-assist-fab {
        bottom: 78px;
        right: 14px;
    }
}

/* Stack cleanly above getbutton.io WhatsApp FAB if enabled */
body.dk-has-whatsapp-fab .dk-assist-fab {
    bottom: 118px;
}
@media (max-width: 1199.98px) {
    body.dk-has-whatsapp-fab .dk-assist-fab {
        bottom: 132px;
    }
}

.dk-assist-dialog {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 500px;
    height: 660px;
    min-width: 360px;
    min-height: 460px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 36px);
    z-index: 1050;
    display: none;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
    overflow: hidden;
    font-family: inherit;
}
.dk-assist-dialog.is-open {
    display: flex;
}

@media (max-width: 767.98px) {
    .dk-assist-dialog {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100vw !important;
        height: 88vh !important;
        max-width: 100vw;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
    }
    .dk-assist-resize-handle {
        display: none !important;
    }
}

/* Top-left resize handle on desktop */
.dk-assist-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 5;
}
.dk-assist-resize-handle::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    width: 7px;
    height: 7px;
    border-top: 2px solid rgba(255, 255, 255, 0.55);
    border-left: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 1px;
}

/* Header */
.dk-assist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--dark, #1b1b28);
    color: #fff;
    flex-shrink: 0;
}
.dk-assist-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.dk-assist-brand-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary, #d43533);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.dk-assist-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dk-assist-subtitle {
    font-size: 11px;
    opacity: 0.78;
}
.dk-assist-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}
.dk-assist-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}
.dk-assist-icon-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}
.dk-assist-menu {
    position: absolute;
    top: 36px;
    right: 0;
    width: 205px;
    background: #fff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
    padding: 6px;
    display: none;
    z-index: 20;
}
.dk-assist-menu.is-open {
    display: block;
}
.dk-assist-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    color: #1f2937;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}
.dk-assist-menu-item:hover {
    background: #f3f4f6;
    color: #111827;
}
.dk-assist-menu-item.is-danger {
    color: #dc2626;
}

/* Body & Scroll Container */
.dk-assist-body-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}
.dk-assist-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 52px; /* bottom padding ensures scroll-down button never overlaps content */
    scroll-behavior: smooth;
}

/* Non-overlapping Scroll-to-Latest Button */
.dk-assist-scroll-btn {
    position: absolute;
    right: 16px;
    bottom: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1f2937;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}
.dk-assist-scroll-btn.is-visible {
    display: inline-flex;
}

/* Welcome View */
.dk-assist-hero {
    background: linear-gradient(135deg, #fff5f5 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}
.dk-assist-hero h4 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 6px;
    color: #0f172a;
}
.dk-assist-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.dk-assist-status-pill.is-open {
    background: #dcfce7;
    color: #166534;
}
.dk-assist-status-pill.is-closed {
    background: #fef3c7;
    color: #92400e;
}
.dk-assist-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.dk-assist-section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin: 14px 0 8px;
}
.dk-assist-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.dk-assist-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}
.dk-assist-chip:hover {
    border-color: var(--primary, #d43533);
    background: #fff5f5;
    color: var(--primary, #d43533);
}

/* Resume Card */
.dk-assist-resume-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 12px;
}
.dk-assist-resume-card:hover {
    border-color: var(--primary, #d43533);
}

/* For You Strip */
.dk-assist-foryou-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.dk-assist-mini-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dk-assist-mini-card img {
    width: 100%;
    height: 86px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 8px;
}
.dk-assist-mini-title {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}
.dk-assist-mini-price {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--primary, #d43533);
}

/* Messages */
.dk-assist-msg {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}
.dk-assist-msg.is-user {
    align-items: flex-end;
}
.dk-assist-msg.is-assistant {
    align-items: flex-start;
}
.dk-assist-bubble {
    max-width: 92%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}
.dk-assist-msg.is-user .dk-assist-bubble {
    background: var(--dark, #1b1b28);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.dk-assist-msg.is-assistant .dk-assist-bubble {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    width: 100%;
    max-width: 100%;
}
.dk-assist-bubble ul {
    margin: 6px 0;
    padding-left: 18px;
}
.dk-assist-bubble p {
    margin: 0 0 6px;
}
.dk-assist-bubble p:last-child {
    margin-bottom: 0;
}

/* Stepped Progress Checklist */
.dk-assist-steps {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #475569;
}
.dk-assist-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dk-assist-step.is-done {
    color: #15803d;
}
.dk-assist-step.is-running {
    color: var(--primary, #d43533);
    font-weight: 600;
}

/* Rich Product Cards in Chat */
.dk-assist-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}
.dk-assist-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.dk-assist-card-top {
    display: flex;
    gap: 12px;
}
.dk-assist-card-img-wrap {
    position: relative;
    width: 86px;
    height: 86px;
    flex-shrink: 0;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.dk-assist-card-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.dk-assist-compare-check {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid #94a3b8;
    background: rgba(255, 255, 255, 0.95);
    color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
}
.dk-assist-compare-check.is-selected {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.dk-assist-card-info {
    flex: 1;
    min-width: 0;
}
.dk-assist-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 4px;
}
.dk-assist-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}
.dk-assist-badge.is-fit {
    background: #eff6ff;
    color: #1d4ed8;
}
.dk-assist-badge.is-in-stock {
    background: #dcfce7;
    color: #166534;
}
.dk-assist-badge.is-low-stock {
    background: #fef3c7;
    color: #92400e;
}
.dk-assist-badge.is-out {
    background: #fee2e2;
    color: #991b1b;
}
.dk-assist-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none !important;
    display: block;
    margin-bottom: 2px;
}
.dk-assist-card-title:hover {
    color: var(--primary, #d43533);
}
.dk-assist-card-meta {
    font-size: 11.5px;
    color: #64748b;
    margin-bottom: 4px;
}
.dk-assist-card-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary, #d43533);
}
.dk-assist-card-price del {
    font-size: 12px;
    font-weight: 400;
    color: #94a3b8;
    margin-left: 6px;
}
.dk-assist-why {
    margin-top: 8px;
    padding: 7px 10px;
    background: #f8fafc;
    border-left: 3px solid var(--primary, #d43533);
    border-radius: 6px;
    font-size: 12px;
    color: #334155;
}
.dk-assist-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.dk-assist-btn-primary {
    flex: 1;
    border: 0;
    border-radius: 999px;
    background: var(--primary, #d43533);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    cursor: pointer;
}
.dk-assist-btn-primary:hover {
    background: var(--hov-primary, #9d1b1a);
}
.dk-assist-btn-ghost {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 12px;
    cursor: pointer;
    text-decoration: none !important;
}
.dk-assist-btn-ghost:hover {
    border-color: #64748b;
}

/* Inline Comparison Table */
.dk-assist-compare-wrap {
    margin-top: 10px;
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}
.dk-assist-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 380px;
}
.dk-assist-compare-table th,
.dk-assist-compare-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: top;
}
.dk-assist-compare-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #334155;
    width: 115px;
}
.dk-assist-compare-head-prod {
    text-align: center !important;
    background: #fff !important;
}
.dk-assist-compare-head-prod img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 4px;
}

/* Feedback & Followups */
.dk-assist-msg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    font-size: 11.5px;
    color: #64748b;
}
.dk-assist-feedback-btns {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.dk-assist-fb-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    border-radius: 6px;
    padding: 3px 7px;
    cursor: pointer;
    font-size: 12px;
}
.dk-assist-fb-btn.is-active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}
.dk-assist-followups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* Docked Compare Tray */
.dk-assist-compare-tray {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
    background: #eff6ff;
    border-top: 1px solid #bfdbfe;
    flex-shrink: 0;
}
.dk-assist-compare-tray.is-visible {
    display: flex;
}
.dk-assist-tray-items {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
}
.dk-assist-tray-thumb {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dk-assist-tray-thumb img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
}
.dk-assist-tray-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 0;
    background: #1e293b;
    color: #fff;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
}

/* Composer */
.dk-assist-composer-wrap {
    padding: 10px 14px 10px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.dk-assist-composer {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    padding: 4px 6px 4px 14px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.dk-assist-composer:focus-within {
    border-color: var(--primary, #d43533);
    box-shadow: 0 0 0 3px rgba(212, 53, 51, 0.12);
}
.dk-assist-input {
    flex: 1;
    border: 0;
    outline: none;
    font-size: 13.5px;
    background: transparent;
    color: #0f172a;
    min-width: 0;
}
.dk-assist-mic-btn,
.dk-assist-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.dk-assist-mic-btn {
    background: transparent;
    color: #64748b;
}
.dk-assist-mic-btn.is-listening {
    background: #fee2e2;
    color: #dc2626;
}
.dk-assist-send-btn {
    background: var(--primary, #d43533);
    color: #fff;
}
.dk-assist-send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.dk-assist-disclaimer {
    margin-top: 6px;
    font-size: 10.5px;
    color: #64748b;
    text-align: center;
    line-height: 1.35;
}
.dk-assist-disclaimer a {
    color: #475569;
    text-decoration: underline;
}

/* History View */
.dk-assist-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}
.dk-assist-history-item:hover {
    border-color: var(--primary, #d43533);
}
