/* ── WhatsApp floating button (in-app only) ───────────────────────────────── */
#pd-whatsapp-toggle.pd-whatsapp-fab {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
    right: 16px;
    z-index: 10000;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #111111;
    color: #f7d117;
    border: 2px solid #f7d117;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(247, 209, 23, 0.28);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

#pd-whatsapp-toggle.pd-whatsapp-fab:hover {
    background: #1a1a1a;
    border-color: #ffe65a;
    transform: scale(1.06);
}

#pd-whatsapp-toggle.pd-whatsapp-fab img {
    width: 28px;
    height: 28px;
    display: block;
    filter: brightness(0) saturate(100%) invert(84%) sepia(62%) saturate(638%) hue-rotate(5deg) brightness(103%) contrast(101%);
}

.pd-product-page #pd-whatsapp-toggle.pd-whatsapp-fab {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 100px);
}

/* Legacy chatbot UI must never appear in the native app shell */
html[data-pd-app="1"] #pd-chatbot-toggle,
html[data-pd-app="1"] #pd-chatbot-win,
html[data-pd-app="1"] .pd-chatbot-desktop,
html[data-pd-app="1"] .pd-chatbot-fab {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Shopping assistant. All selectors stay inside its own root. */
#mi-shopping-chat { --mi-chat-bottom: 145px; font-family: inherit; color: #202124; font-size: 14px; line-height: 1.5; }
#mi-shopping-chat *, #mi-shopping-chat *::before, #mi-shopping-chat *::after { box-sizing: border-box; }
#mi-shopping-chat [hidden] { display: none !important; }
#mi-shopping-chat button, #mi-shopping-chat textarea { font: inherit; }
#mi-shopping-chat button { cursor: pointer; }
#mi-shopping-chat button:disabled { cursor: wait; opacity: .6; }
#mi-shopping-chat :focus-visible { outline: 3px solid #b28b00; outline-offset: 3px; }
#mi-shopping-chat .mi-chat-launcher { position: fixed; right: 24px; bottom: calc(var(--mi-chat-bottom) + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; min-width: 56px; min-height: 56px; padding: 0; border: 1px solid #dfbc12; border-radius: 50%; color: #111; background: #f7d117; box-shadow: 0 4px 14px #0003, 0 0 0 4px #f7d1171a, inset 0 1px 0 #fff5; z-index: 10002; transition: background-color .16s ease, box-shadow .16s ease; }
#mi-shopping-chat .mi-chat-launcher svg { flex: none; width: 26px; height: 26px; }
#mi-shopping-chat .mi-chat-launcher:hover { background: #ffe052; box-shadow: 0 5px 16px #0003, 0 0 0 4px #f7d11726, inset 0 1px 0 #fff5; }
/* Custom hover label (replaces the browser's native title tooltip); hidden while the panel is open */
#mi-shopping-chat .mi-chat-launcher::before, #mi-shopping-chat .mi-chat-launcher::after { position: absolute; top: 50%; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
#mi-shopping-chat .mi-chat-launcher::after { content: attr(data-tooltip); right: calc(100% + 14px); padding: 8px 14px; border: 1px solid #f7d11740; border-radius: 999px; background: #141414; color: #fff; font-size: 13px; font-weight: 600; line-height: 18px; letter-spacing: .01em; white-space: nowrap; box-shadow: 0 8px 24px #00000038, 0 0 0 3px #f7d11714; transform: translate(6px, -50%); }
#mi-shopping-chat .mi-chat-launcher::before { content: ""; right: calc(100% + 9px); z-index: 1; width: 10px; height: 10px; background: #141414; border-top: 1px solid #f7d11740; border-right: 1px solid #f7d11740; transform: translate(6px, -50%) rotate(45deg); }
#mi-shopping-chat .mi-chat-launcher[aria-expanded="false"]:focus-visible::before, #mi-shopping-chat .mi-chat-launcher[aria-expanded="false"]:focus-visible::after { opacity: 1; visibility: visible; transition-delay: 0s; }
#mi-shopping-chat .mi-chat-launcher[aria-expanded="false"]:focus-visible::after { transform: translate(0, -50%); }
#mi-shopping-chat .mi-chat-launcher[aria-expanded="false"]:focus-visible::before { transform: translate(0, -50%) rotate(45deg); }
@media (hover: hover) and (pointer: fine) {
    #mi-shopping-chat .mi-chat-launcher[aria-expanded="false"]:hover::before, #mi-shopping-chat .mi-chat-launcher[aria-expanded="false"]:hover::after { opacity: 1; visibility: visible; transition-delay: 0s; }
    #mi-shopping-chat .mi-chat-launcher[aria-expanded="false"]:hover::after { transform: translate(0, -50%); }
    #mi-shopping-chat .mi-chat-launcher[aria-expanded="false"]:hover::before { transform: translate(0, -50%) rotate(45deg); }
}
#mi-shopping-chat .mi-chat-panel { position: fixed; z-index: 10020; right: 24px; bottom: calc(var(--mi-chat-bottom) + 64px + env(safe-area-inset-bottom, 0px)); width: 408px; height: min(650px, calc(100dvh - var(--mi-chat-bottom) - 90px)); min-height: 300px; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid #dedee2; border-radius: 18px; box-shadow: 0 16px 60px #0003; text-align: left; }
#mi-shopping-chat .mi-chat-header { display: flex; gap: 10px; align-items: center; padding: 16px 12px 16px 18px; background: #141414; color: #fff; flex: none; }
#mi-shopping-chat .mi-chat-avatar { display: grid; place-items: center; height: 40px; width: 40px; background: #f7d117; color: #111; border-radius: 12px; font-size: 23px; font-weight: 800; letter-spacing: -2px; flex: none; padding-right: 2px; }
#mi-shopping-chat .mi-chat-heading { flex: 1; min-width: 0; }
#mi-shopping-chat .mi-chat-heading h2 { margin: 0; color: inherit; font: inherit; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
#mi-shopping-chat .mi-chat-heading p { margin: 2px 0 0; font-size: 12px; color: #c4c4c4; }
#mi-shopping-chat .mi-chat-icon { width: 36px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 25px; }
#mi-shopping-chat .mi-chat-icon:hover { background: #333; }
#mi-shopping-chat .mi-chat-notice { background: #fff9dc; color: #66520b; margin: 0; padding: 9px 18px; font-size: 12px; flex: none; }
#mi-shopping-chat .mi-chat-messages { min-height: 80px; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; background: #f8f8fa; scrollbar-width: thin; }
#mi-shopping-chat .mi-chat-message { margin: 0 0 16px; overflow-wrap: anywhere; }
#mi-shopping-chat .mi-chat-bubble { padding: 12px 14px; margin: 0; white-space: pre-line; max-width: 94%; border: 1px solid #e5e5e8; background: #fff; border-radius: 3px 13px 13px 13px; }
#mi-shopping-chat .mi-chat-bubble a { color: #403500; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
#mi-shopping-chat .mi-chat-reply-source { display: block; margin: 5px 3px 0; color: #74747d; font-size: 11px; }
#mi-shopping-chat .mi-chat-message-customer .mi-chat-bubble { margin-left: auto; background: #fff1a9; color: #24200d; border-color: #f0df8b; border-radius: 13px 3px 13px 13px; }
#mi-shopping-chat .mi-chat-product { display: flex; gap: 12px; padding: 12px; margin-top: 9px; border: 1px solid #dedee3; border-radius: 12px; background: #fff; }
#mi-shopping-chat .mi-chat-product-image { width: 62px; height: 78px; object-fit: contain; flex: none; }
#mi-shopping-chat .mi-chat-product-content { flex: 1; min-width: 0; }
#mi-shopping-chat .mi-chat-product-name { font-weight: 700; text-decoration: none; color: #1a1a1a; font-size: 14px; line-height: 1.35; display: inline-block; }
#mi-shopping-chat .mi-chat-product-name:hover { text-decoration: underline; }
#mi-shopping-chat .mi-chat-product-price { font-weight: 750; margin: 5px 0 3px; font-variant-numeric: tabular-nums; font-size: 16px; }
#mi-shopping-chat .mi-chat-product-price del { color: #757575; font-size: 12px; font-weight: 400; display: inline-block; margin-left: 7px; }
#mi-shopping-chat .mi-chat-discount { font-size: 11px; font-weight: 600; color: #21603a; margin-left: 5px; white-space: nowrap; }
#mi-shopping-chat .mi-chat-product-specs, #mi-shopping-chat .mi-chat-reason { color: #575762; font-size: 12px; margin: 4px 0; }
#mi-shopping-chat .mi-chat-stock { font-size: 12px; margin: 5px 0; color: #63636c; }
#mi-shopping-chat .mi-chat-stock-in_stock { color: #21603a; }
#mi-shopping-chat .mi-chat-product-view { color: #292300; text-decoration: none; background: #f7d117; border-radius: 6px; padding: 6px 10px; display: inline-block; margin-top: 5px; font-size: 12px; font-weight: 700; }
#mi-shopping-chat .mi-chat-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
#mi-shopping-chat .mi-chat-links a { color: #403500; background: #fff4bb; padding: 7px 10px; border-radius: 7px; text-decoration: underline; font-size: 13px; }
#mi-shopping-chat .mi-chat-suggestions { display: flex; gap: 6px; overflow-x: auto; flex: none; padding: 10px 14px; scrollbar-width: thin; background: #fff; }
#mi-shopping-chat .mi-chat-suggestion { flex: none; background: #fff; color: #47402a; border: 1px solid #ded8bc; border-radius: 18px; padding: 7px 11px; font-size: 12px; min-height: 34px; }
#mi-shopping-chat .mi-chat-suggestion:hover { background: #fff8d3; }
#mi-shopping-chat .mi-chat-form { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 12px 14px 6px; border-top: 1px solid #eee; background: #fff; flex: none; }
#mi-shopping-chat textarea { min-width: 0; width: 100%; min-height: 44px; max-height: 96px; resize: none; border-radius: 10px; border: 1px solid #d7d7dc; background: #fff; color: #222; padding: 11px 12px; font-size: 16px; line-height: 1.4; margin: 0; }
#mi-shopping-chat .mi-chat-send { border: 0; width: 44px; height: 44px; display: grid; place-items: center; flex: none; border-radius: 10px; color: #111; background: #f7d117; }
#mi-shopping-chat .mi-chat-footer { padding: 3px 12px 9px; margin: 0; text-align: center; color: #777; font-size: 11px; background: #fff; flex: none; }
#mi-shopping-chat .mi-chat-error { padding: 10px 14px; color: #8b2525; background: #fff1ef; font-size: 13px; flex: none; }
#mi-shopping-chat .mi-chat-error button { border: 1px solid #c97c70; border-radius: 5px; padding: 3px 9px; margin-left: 8px; background: #fff; color: #822b20; }
#mi-shopping-chat .mi-chat-typing { color: #666; font-size: 13px; padding: 7px; }
#mi-shopping-chat .mi-chat-typing span { display: inline-block; letter-spacing: 3px; margin-left: 5px; animation: mi-chat-pulse 1.2s ease-in-out infinite; }
#mi-shopping-chat .mi-chat-ai { flex: none; padding: 0 16px 7px; background: #fff; font-size: 12px; color: #60606b; }
#mi-shopping-chat .mi-chat-ai summary { cursor: pointer; padding: 3px 0; }
#mi-shopping-chat .mi-chat-ai p { margin: 4px 0 8px; }
#mi-shopping-chat .mi-chat-ai label { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; font-weight: 400; }
#mi-shopping-chat .mi-chat-ai input { flex: none; margin-top: 3px; accent-color: #a08400; }
#mi-shopping-chat .mi-chat-comparison { margin-top: 10px; max-width: 100%; overflow-x: auto; border: 1px solid #dedee3; border-radius: 10px; background: #fff; }
#mi-shopping-chat .mi-chat-comparison table { border-collapse: collapse; min-width: 100%; font-size: 12px; }
#mi-shopping-chat .mi-chat-comparison caption { padding: 9px; text-align: left; font-weight: 700; }
#mi-shopping-chat .mi-chat-comparison th, #mi-shopping-chat .mi-chat-comparison td { padding: 8px; border: 1px solid #e4e4e7; min-width: 100px; vertical-align: top; text-align: left; }
#mi-shopping-chat .mi-chat-comparison th { background: #fff9dc; }
#mi-shopping-chat .mi-chat-comparison a { color: #3c350b; text-decoration: underline; }
#mi-shopping-chat .mi-chat-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes mi-chat-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
@media (min-width: 601px) { #mi-shopping-chat { --mi-chat-bottom: 92px; } }
@media (max-width: 768px) { #mi-shopping-chat .mi-chat-launcher { right: 16px; } }
@media (max-width: 600px) {
    #mi-shopping-chat .mi-chat-panel { right: 8px; left: 8px; top: max(10px, env(safe-area-inset-top, 0px)); bottom: calc(82px + env(safe-area-inset-bottom, 0px)); width: auto; height: auto; min-height: 200px; border-radius: 15px; }
}
@media (max-height: 600px) and (min-width: 601px) { #mi-shopping-chat .mi-chat-panel { top: 8px; bottom: 12px; height: auto; } }
@media (prefers-reduced-motion: reduce) { #mi-shopping-chat .mi-chat-typing span { animation: none; } #mi-shopping-chat .mi-chat-launcher, #mi-shopping-chat .mi-chat-launcher::before, #mi-shopping-chat .mi-chat-launcher::after { transition: none; } }
