/* Heemskerk Chatbot Styles */

#hkcb-widget {
    --hkcb-primary: #0066cc;
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

#hkcb-widget.position-right {
    right: 20px;
}

#hkcb-widget .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}


#hkcb-widget.position-left {
    left: 20px;
}

#hkcb-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background-color: var(--hkcb-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 26px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hkcb-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

#hkcb-toggle.open {
    transform: rotate(90deg);
}

#hkcb-chat {
    display: none;
    position: absolute;
    bottom: 75px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: hkcb-slide-up 0.3s ease;
}

#hkcb-widget.position-right #hkcb-chat {
    right: 0;
}

#hkcb-widget.position-left #hkcb-chat {
    left: 0;
}

#hkcb-chat.size-small {
    width: 300px;
}

#hkcb-chat.size-medium {
    width: 360px;
}

#hkcb-chat.size-large {
    width: 420px;
}

@keyframes hkcb-slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hkcb-header {
    padding: 16px 20px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--hkcb-primary);
}

#hkcb-header-icon {
    font-size: 20px;
}

#hkcb-header-actions {
    margin-left: auto;
}

#hkcb-new-chat {
    background: rgba(0, 0, 0, 0.25);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

#hkcb-new-chat:hover {
    background: rgba(0, 0, 0, 0.35);
}

#hkcb-messages {
    height: 350px;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

.hkcb-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 12px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.hkcb-message.user {
    margin-left: auto;
    color: #fff;
    background-color: var(--hkcb-primary);
    border-bottom-right-radius: 4px;
}

.hkcb-message.bot {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hkcb-message.bot .hkcb-list-marker {
    font-weight: 700;
    color: var(--hkcb-primary);
}

.hkcb-message.bot .hkcb-para {
    margin: 0 0 0.55em;
    line-height: 1.45;
}

.hkcb-message.bot .hkcb-para:last-child {
    margin-bottom: 0;
}

.hkcb-message.bot .hkcb-list {
    margin: 0.4em 0 0.7em;
    padding-left: 1.35em;
    line-height: 1.45;
}

.hkcb-message.bot .hkcb-list li {
    margin: 0.55em 0;
}

.hkcb-message.bot .hkcb-sublist {
    margin: 0.25em 0 0.35em;
    padding-left: 1.1em;
    list-style: disc;
}

.hkcb-message.bot .hkcb-sublist li {
    margin: 0.15em 0;
    font-size: 0.95em;
}

.hkcb-message.bot .hkcb-list li strong {
    font-weight: 700;
}

.hkcb-message.bot a.hkcb-link {
    color: var(--hkcb-primary);
    font-weight: 600;
    text-decoration: underline;
    word-break: break-word;
}

.hkcb-message.bot a.hkcb-link:hover {
    text-decoration: none;
}

.hkcb-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 10px;
    padding: 0 4px;
}

.hkcb-choice-btn {
    appearance: none;
    border: 1px solid var(--hkcb-primary);
    background: #fff;
    color: var(--hkcb-primary);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.hkcb-choice-btn:hover:not(:disabled) {
    background: var(--hkcb-primary);
    color: #fff;
}

.hkcb-choice-btn:disabled,
.hkcb-choices-used .hkcb-choice-btn {
    opacity: 0.55;
    cursor: default;
}

.hkcb-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 2px 0 12px;
    padding: 0 4px;
}

.hkcb-product-card {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 8px;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hkcb-product-card:hover {
    border-color: var(--hkcb-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.hkcb-product-card--best_buy,
.hkcb-product-card--bestseller {
    border-color: var(--hkcb-primary);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--hkcb-primary) 35%, transparent);
}

.hkcb-product-badge {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: color-mix(in srgb, var(--hkcb-primary) 12%, #fff);
    color: var(--hkcb-primary);
    border: 1px solid color-mix(in srgb, var(--hkcb-primary) 35%, #fff);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    padding: 3px 7px;
    border-radius: 999px;
    text-align: center;
}

.hkcb-product-card--instap .hkcb-product-badge,
.hkcb-product-card--premium .hkcb-product-badge {
    background: #f3f3f3;
    color: #444;
    border-color: #ddd;
}

.hkcb-product-card--best_buy .hkcb-product-badge,
.hkcb-product-card--bestseller .hkcb-product-badge {
    background: var(--hkcb-primary);
    color: #fff;
    border-color: var(--hkcb-primary);
}

.hkcb-product-media {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f3f3;
}

.hkcb-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hkcb-product-media-empty {
    background: linear-gradient(135deg, #f0f0f0, #e2e2e2);
}

.hkcb-product-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.hkcb-product-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hkcb-product-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hkcb-product-price {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}

.hkcb-product-meta .hkcb-product-badge {
    margin-left: auto;
}

.hkcb-product-meta .hkcb-product-badge + .hkcb-product-cta {
    margin-left: 0;
}

.hkcb-product-was {
    color: #888;
    font-weight: 500;
    margin-right: 2px;
}

.hkcb-product-cta {
    flex: 0 0 auto;
    margin-left: auto;
    background: var(--hkcb-primary);
    color: #fff;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.hkcb-message.typing {
    background: #fff;
    color: #6b7280;
    font-style: normal;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 85%;
}

.hkcb-typing-label {
    font-size: 13px;
    line-height: 1.35;
}

.hkcb-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 1em;
}

.hkcb-typing-dots i {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9ca3af;
    animation: hkcb-typing-bounce 1.1s ease-in-out infinite;
}

.hkcb-typing-dots i:nth-child(2) {
    animation-delay: 0.15s;
}

.hkcb-typing-dots i:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes hkcb-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hkcb-typing-dots i {
        animation: none;
        opacity: 0.7;
    }
}

#hkcb-form {
    display: flex;
    padding: 12px 16px;
    gap: 10px;
    border-top: 1px solid #eee;
    background: #fff;
}

#hkcb-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

#hkcb-input:focus {
    border-color: var(--hkcb-primary);
}

#hkcb-input:disabled {
    background: #f5f5f5;
}

#hkcb-submit {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    background-color: var(--hkcb-primary);
    transition: transform 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hkcb-widget button#hkcb-toggle,
#hkcb-widget button#hkcb-submit {
    background-color: var(--hkcb-primary) !important;
    color: #fff !important;
}

#hkcb-submit:hover:not(:disabled) {
    transform: scale(1.05);
}

#hkcb-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Scrollbar styling */
#hkcb-messages::-webkit-scrollbar {
    width: 6px;
}

#hkcb-messages::-webkit-scrollbar-track {
    background: transparent;
}

#hkcb-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#hkcb-messages::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    #hkcb-chat {
        width: calc(100vw - 40px) !important;
        max-width: 360px;
    }
    
    #hkcb-messages {
        height: 300px;
    }
}


/* Field feedback — subtle thumbs + readable end form */
#hkcb-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

#hkcb-end-chat {
    background: rgba(0, 0, 0, 0.18);
    border: none;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.2s;
}

#hkcb-end-chat:hover {
    background: rgba(0, 0, 0, 0.3);
}

.hkcb-turn-feedback {
    display: flex;
    gap: 2px;
    margin-top: 6px;
    opacity: 0.45;
    transition: opacity 0.15s;
}

.hkcb-message.bot:hover .hkcb-turn-feedback,
.hkcb-turn-feedback:focus-within,
.hkcb-turn-feedback.hkcb-fb-sent {
    opacity: 1;
}

.hkcb-fb-thumb {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    box-shadow: none;
    outline: none;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: inherit;
}

.hkcb-fb-thumb:hover,
.hkcb-fb-thumb:focus-visible {
    background: rgba(0, 0, 0, 0.05);
}

.hkcb-fb-thumb.hkcb-fb-active {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.08);
}

#hkcb-end-feedback {
    position: absolute;
    inset: 0;
    background: #f3f4f6;
    z-index: 5;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.hkcb-end-feedback-card {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    background: #fff;
    border: none;
    border-radius: 0;
    padding: 16px 16px 12px;
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.hkcb-end-feedback-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 650;
    color: #111827;
    line-height: 1.3;
}

.hkcb-end-privacy {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.45;
    color: #4b5563;
}

.hkcb-end-ratings {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 10px;
}

.hkcb-end-rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #374151;
}

.hkcb-end-rating-row:last-child {
    margin-bottom: 0;
}

.hkcb-end-score {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.hkcb-end-score button {
    appearance: none;
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: #eef2f7;
    color: #1f2937;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
}

.hkcb-end-score button:hover,
.hkcb-end-score button:focus-visible {
    background: #e5eaf1;
}

.hkcb-end-score button.hkcb-fb-active {
    background: var(--hkcb-primary, #0066cc);
    color: #fff;
}

.hkcb-end-cat-label,
.hkcb-end-comment-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #111827;
    line-height: 1.35;
}

.hkcb-end-cat-label select,
.hkcb-end-comment-label textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: #111827;
    background: #fff;
    box-sizing: border-box;
    resize: vertical;
}

.hkcb-end-comment-label textarea {
    min-height: 44px;
    max-height: 88px;
}

.hkcb-end-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    margin: 4px 0 14px;
    padding: 10px 12px;
    color: #111827;
    background: #f9fafb;
    border-radius: 10px;
}

.hkcb-end-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--hkcb-primary, #0066cc);
}

.hkcb-end-consent span {
    flex: 1 1 auto;
}

.hkcb-end-contact {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}

.hkcb-end-contact label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.hkcb-end-contact input,
.hkcb-end-contact select {
    display: block;
    width: 100%;
    margin-top: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    background: #fff;
    box-sizing: border-box;
}

.hkcb-end-actions {
    display: flex;
    justify-content: stretch;
    gap: 8px;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #eef2f7;
    flex-shrink: 0;
}

.hkcb-end-skip,
.hkcb-end-submit {
    appearance: none;
    -webkit-appearance: none;
    flex: 1 1 0;
    border-radius: 10px;
    border: none;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #eef2f7;
    color: #111827;
}

.hkcb-end-submit {
    background: var(--hkcb-primary, #0066cc);
    color: #fff;
}

.hkcb-end-skip:hover {
    background: #e5eaf1;
}

.hkcb-hp {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 480px) {
    #hkcb-end-chat,
    #hkcb-new-chat {
        font-size: 11px;
        padding: 5px 8px;
    }

    .hkcb-fb-thumb {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }

    .hkcb-end-feedback-card {
        padding: 14px 14px 10px;
    }

    .hkcb-end-score button {
        width: 32px;
        height: 32px;
    }

    .hkcb-end-comment-label textarea {
        min-height: 40px;
        max-height: 72px;
    }
}
