/* Reset baseline elements back to browser defaults first, discarding any
   theme stylesheet rules that would otherwise leak in (buttons, links and
   lists are the most commonly hijacked by themes like Woodmart/Storefront).
   Every rule below is then scoped with #sm-asw-widget-root, which is more
   specific than a theme's typical type/class selectors, so our own styling
   always wins regardless of which theme is active. */
#sm-asw-widget-root button,
#sm-asw-widget-root input,
#sm-asw-widget-root a,
#sm-asw-widget-root ul,
#sm-asw-widget-root li {
    all: revert;
}

#sm-asw-widget-root,
#sm-asw-widget-root * {
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

#sm-asw-widget-root {
    position: fixed !important;
    bottom: calc(20px + var(--sm-asw-safe-bottom, 0px) + env(safe-area-inset-bottom, 0px)) !important;
    right: 20px !important;
    z-index: 999999 !important;
    line-height: 1.4 !important;
}

#sm-asw-widget-root .sm-asw-bubble {
    position: relative !important;
    width: 62px !important;
    height: 62px !important;
    min-width: 62px !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #25D366, #1DA851) !important;
    border: none !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
}

#sm-asw-widget-root .sm-asw-bubble:hover {
    transform: scale(1.07);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35) !important;
}

#sm-asw-widget-root .sm-asw-bubble-icon {
    position: absolute !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#sm-asw-widget-root .sm-asw-bubble-icon svg {
    display: block !important;
}

#sm-asw-widget-root .sm-asw-bubble-icon-close {
    opacity: 0;
    transform: scale(0.5) rotate(-45deg);
}

#sm-asw-widget-root.sm-asw-open .sm-asw-bubble-icon-chat {
    opacity: 0;
    transform: scale(0.5) rotate(45deg);
}

#sm-asw-widget-root.sm-asw-open .sm-asw-bubble-icon-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

#sm-asw-widget-root .sm-asw-window {
    display: none !important;
    position: fixed !important;
    bottom: calc(96px + var(--sm-asw-safe-bottom, 0px) + env(safe-area-inset-bottom, 0px)) !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    width: 360px !important;
    max-width: calc(100vw - 32px) !important;
    height: 500px !important;
    max-height: calc(100vh - 130px) !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28) !important;
    overflow: hidden !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

#sm-asw-widget-root .sm-asw-window.sm-asw-window-open {
    display: flex !important;
    opacity: 1;
    transform: translateY(0) scale(1);
}

#sm-asw-widget-root .sm-asw-header {
    background: linear-gradient(135deg, #075E54, #0b7a6c) !important;
    color: #ffffff !important;
    padding: 14px 16px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    z-index: 1 !important;
}

#sm-asw-widget-root .sm-asw-header-avatar {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.18) !important;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    color: #ffffff !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
}

#sm-asw-widget-root .sm-asw-header-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    border-radius: 50% !important;
}

#sm-asw-widget-root .sm-asw-header-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    gap: 2px !important;
}

#sm-asw-widget-root .sm-asw-header-title {
    font-weight: 600 !important;
    font-size: 15px !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

#sm-asw-widget-root .sm-asw-header-status {
    font-size: 12px !important;
    color: #ffffff !important;
    opacity: 0.85;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 !important;
}

#sm-asw-widget-root .sm-asw-status-dot {
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background-color: #4ADE80 !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

#sm-asw-widget-root .sm-asw-close {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    cursor: pointer !important;
    padding: 6px !important;
    margin: 0 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    opacity: 0.85;
    flex-shrink: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

#sm-asw-widget-root .sm-asw-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12) !important;
}

#sm-asw-widget-root .sm-asw-messages {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 16px 14px !important;
    margin: 0 !important;
    background-color: #E9EDF1 !important;
    background-image: radial-gradient(rgba(7, 94, 84, 0.04) 1px, transparent 1px) !important;
    background-size: 16px 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(7, 94, 84, 0.25) transparent;
    list-style: none !important;
}

#sm-asw-widget-root .sm-asw-messages::-webkit-scrollbar {
    width: 6px;
}

#sm-asw-widget-root .sm-asw-messages::-webkit-scrollbar-thumb {
    background-color: rgba(7, 94, 84, 0.22);
    border-radius: 3px;
}

#sm-asw-widget-root .sm-asw-messages::-webkit-scrollbar-track {
    background: transparent;
}

#sm-asw-widget-root .sm-asw-msg-row {
    display: flex !important;
    flex-direction: column !important;
    max-width: 82% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    animation: sm-asw-fade-in 0.18s ease;
}

#sm-asw-widget-root .sm-asw-msg-row-visitor {
    align-self: flex-end !important;
    align-items: flex-end !important;
}

#sm-asw-widget-root .sm-asw-msg-row-assistant {
    align-self: flex-start !important;
    align-items: flex-start !important;
}

#sm-asw-widget-root .sm-asw-msg {
    position: relative !important;
    padding: 9px 13px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    word-wrap: break-word !important;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06) !important;
}

#sm-asw-widget-root .sm-asw-msg strong {
    font-weight: 700 !important;
}

#sm-asw-widget-root .sm-asw-msg-visitor {
    background-color: #DCF8C6 !important;
    color: #111b21 !important;
    border-bottom-right-radius: 3px !important;
}

#sm-asw-widget-root .sm-asw-msg-visitor::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: 0;
    width: 12px;
    height: 12px;
    background-color: #DCF8C6;
    clip-path: polygon(0 0, 0% 100%, 100% 100%);
}

#sm-asw-widget-root .sm-asw-msg-assistant {
    background-color: #ffffff !important;
    color: #111b21 !important;
    border-bottom-left-radius: 3px !important;
}

#sm-asw-widget-root .sm-asw-msg-assistant::after {
    content: "";
    position: absolute;
    left: -6px;
    bottom: 0;
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}

#sm-asw-widget-root .sm-asw-msg-time {
    font-size: 10.5px !important;
    color: #7d8b94 !important;
    margin: 3px 3px 0 !important;
    padding: 0 !important;
}

#sm-asw-widget-root .sm-asw-product-row {
    max-width: 90% !important;
    gap: 8px !important;
}

#sm-asw-widget-root .sm-asw-product-card {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: #ffffff !important;
    border: 1px solid #e5e9ea !important;
    border-radius: 12px !important;
    padding: 8px !important;
    margin: 0 0 6px !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
    transition: box-shadow 0.15s ease, transform 0.1s ease !important;
}

#sm-asw-widget-root .sm-asw-product-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-1px);
}

#sm-asw-widget-root .sm-asw-product-card-image {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #f0f2f5 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#sm-asw-widget-root .sm-asw-product-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

#sm-asw-widget-root .sm-asw-product-card-info {
    flex: 1 !important;
    min-width: 0 !important;
}

#sm-asw-widget-root .sm-asw-product-card-name {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #111b21 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.3 !important;
}

#sm-asw-widget-root .sm-asw-product-card-price {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #075E54 !important;
    margin-top: 2px !important;
}

#sm-asw-widget-root .sm-asw-product-card-stock {
    display: inline-block !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    padding: 1px 7px !important;
    border-radius: 8px !important;
    margin-top: 4px !important;
}

#sm-asw-widget-root .sm-asw-product-card-instock {
    background: #d1f5db !important;
    color: #1e8e3e !important;
}

#sm-asw-widget-root .sm-asw-product-card-outofstock {
    background: #fbe4e4 !important;
    color: #d63638 !important;
}

#sm-asw-widget-root .sm-asw-order-row {
    max-width: 90% !important;
}

#sm-asw-widget-root .sm-asw-order-card {
    display: block !important;
    background: #ffffff !important;
    border: 1px solid #e5e9ea !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    margin: 0 !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
    transition: box-shadow 0.15s ease, transform 0.1s ease !important;
}

#sm-asw-widget-root a.sm-asw-order-card {
    cursor: pointer !important;
}

#sm-asw-widget-root a.sm-asw-order-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-1px);
}

#sm-asw-widget-root .sm-asw-order-card-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 6px !important;
}

#sm-asw-widget-root .sm-asw-order-card-number {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #111b21 !important;
}

#sm-asw-widget-root .sm-asw-order-card-status {
    display: inline-block !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    padding: 2px 9px !important;
    border-radius: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap !important;
}

#sm-asw-widget-root .sm-asw-order-status-good {
    background: #d1f5db !important;
    color: #1e8e3e !important;
}

#sm-asw-widget-root .sm-asw-order-status-progress {
    background: #d6e9fb !important;
    color: #075E9c !important;
}

#sm-asw-widget-root .sm-asw-order-status-hold {
    background: #fdf0d5 !important;
    color: #9a6b00 !important;
}

#sm-asw-widget-root .sm-asw-order-status-bad {
    background: #fbe4e4 !important;
    color: #d63638 !important;
}

#sm-asw-widget-root .sm-asw-order-card-meta {
    font-size: 12.5px !important;
    color: #3c434a !important;
    margin-bottom: 4px !important;
}

#sm-asw-widget-root .sm-asw-order-card-items {
    font-size: 12px !important;
    color: #646970 !important;
    line-height: 1.4 !important;
}

#sm-asw-widget-root .sm-asw-order-card-link {
    display: inline-block !important;
    margin-top: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #075E54 !important;
}

#sm-asw-widget-root .sm-asw-quick-replies {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    max-width: 92% !important;
    align-self: flex-start !important;
    margin: 2px 0 4px !important;
    animation: sm-asw-fade-in 0.2s ease;
}

#sm-asw-widget-root .sm-asw-quick-reply-chip {
    background: #ffffff !important;
    color: #075E54 !important;
    border: 1px solid #b7d9d4 !important;
    border-radius: 16px !important;
    padding: 7px 14px !important;
    margin: 0 !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: background-color 0.15s ease, transform 0.1s ease !important;
}

#sm-asw-widget-root .sm-asw-quick-reply-chip:hover {
    background: #f0f6f5 !important;
}

#sm-asw-widget-root .sm-asw-quick-reply-chip:active {
    transform: scale(0.96);
}

#sm-asw-widget-root .sm-asw-typing {
    align-self: flex-start !important;
    background-color: #ffffff !important;
    border-radius: 14px !important;
    border-bottom-left-radius: 3px !important;
    padding: 11px 15px !important;
    margin: 0 !important;
    display: flex !important;
    gap: 4px !important;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06) !important;
}

#sm-asw-widget-root .sm-asw-typing-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background-color: #9aa5ab !important;
    animation: sm-asw-bounce 1.2s infinite ease-in-out;
}

#sm-asw-widget-root .sm-asw-typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

#sm-asw-widget-root .sm-asw-typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

#sm-asw-widget-root .sm-asw-whatsapp-cta {
    display: none !important;
    padding: 10px 14px !important;
    margin: 0 !important;
    background-color: #ffffff !important;
    border: none !important;
    border-top: 1px solid #e9edef !important;
    flex-shrink: 0 !important;
}

#sm-asw-widget-root .sm-asw-whatsapp-cta.sm-asw-whatsapp-cta-visible {
    display: block !important;
    animation: sm-asw-fade-in 0.2s ease;
}

#sm-asw-widget-root .sm-asw-whatsapp-cta-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#sm-asw-widget-root .sm-asw-whatsapp-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-align: center !important;
    background-color: #25D366 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 10px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 13.5px !important;
    line-height: 1.3 !important;
    flex: 1 !important;
    transition: background-color 0.15s ease !important;
    box-shadow: none !important;
}

#sm-asw-widget-root .sm-asw-whatsapp-button:hover {
    background-color: #1ebc59 !important;
    color: #ffffff !important;
}

#sm-asw-widget-root .sm-asw-whatsapp-dismiss {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 50% !important;
    background: #f0f2f5 !important;
    color: #646970 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    transition: background-color 0.15s ease !important;
}

#sm-asw-widget-root .sm-asw-whatsapp-dismiss:hover {
    background: #e2e5e8 !important;
}

#sm-asw-widget-root .sm-asw-form {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px !important;
    margin: 0 !important;
    background-color: #f0f2f5 !important;
    flex-shrink: 0 !important;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05) !important;
}

#sm-asw-widget-root .sm-asw-powered-by {
    text-align: center !important;
    padding: 5px 0 8px !important;
    margin: 0 !important;
    background-color: #f0f2f5 !important;
    flex-shrink: 0 !important;
}

#sm-asw-widget-root .sm-asw-powered-by a {
    font-size: 10.5px !important;
    color: #8c96a0 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
}

#sm-asw-widget-root .sm-asw-powered-by a:hover {
    color: #075E54 !important;
    text-decoration: underline !important;
}

#sm-asw-widget-root .sm-asw-input {
    flex: 1 !important;
    border: 1px solid transparent !important;
    border-radius: 22px !important;
    padding: 10px 16px !important;
    margin: 0 !important;
    font-size: 14px !important;
    color: #111b21 !important;
    outline: none !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    height: auto !important;
    transition: border-color 0.15s ease !important;
}

#sm-asw-widget-root .sm-asw-input:focus {
    border-color: #25D366 !important;
    box-shadow: none !important;
}

#sm-asw-widget-root .sm-asw-send {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 50% !important;
    background-color: #25D366 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    transition: background-color 0.15s ease, transform 0.1s ease !important;
}

#sm-asw-widget-root .sm-asw-send:hover {
    background-color: #1ebc59 !important;
}

#sm-asw-widget-root .sm-asw-send:active {
    transform: scale(0.94);
}

#sm-asw-widget-root .sm-asw-send:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

@keyframes sm-asw-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sm-asw-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    #sm-asw-widget-root .sm-asw-window {
        right: 10px !important;
        bottom: calc(88px + var(--sm-asw-safe-bottom, 0px) + env(safe-area-inset-bottom, 0px)) !important;
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 150px - var(--sm-asw-safe-bottom, 0px) - env(safe-area-inset-bottom, 0px)) !important;
        max-height: none !important;
    }

    #sm-asw-widget-root {
        right: 12px !important;
        bottom: calc(12px + var(--sm-asw-safe-bottom, 0px) + env(safe-area-inset-bottom, 0px)) !important;
    }
}
