.product-chat {
    --chat-green: #365f4a;
    --chat-green-dark: #244233;
    --chat-cream: #f6f1e8;
    --chat-ink: #262c28;
    position: fixed;
    right: 2.4rem;
    bottom: 2.4rem;
    z-index: 1100;
    font-family: inherit;
}

.product-chat-launcher {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    height: 5.2rem;
    margin: 0;
    padding: 0 1.8rem 0 1.3rem;
    border: 0;
    border-radius: 999px;
    background: var(--chat-green);
    box-shadow: 0 12px 30px rgba(25, 42, 32, 0.24);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
}

.product-chat-launcher:hover,
.product-chat-launcher:focus {
    background: var(--chat-green-dark);
    color: #fff;
}

.product-chat-launcher-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.product-chat-launcher svg,
.product-chat-form svg {
    width: 2rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.product-chat-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    display: grid;
    width: min(39rem, calc(100vw - 3.2rem));
    height: min(64rem, calc(100vh - 4rem));
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    border: 1px solid rgba(54, 95, 74, 0.16);
    border-radius: 2.2rem;
    background: #fbfaf7;
    box-shadow: 0 24px 70px rgba(25, 42, 32, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translateY(1.6rem) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 180ms ease, transform 180ms ease;
}

.product-chat--open .product-chat-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.product-chat--open .product-chat-launcher {
    visibility: hidden;
}

.product-chat-header {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1.2rem;
    align-items: center;
    padding: 1.7rem 1.8rem;
    background: var(--chat-green);
    color: #fff;
}

.product-chat-avatar {
    display: grid;
    width: 4.4rem;
    height: 4.4rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-family: Georgia, serif;
    font-size: 2.1rem;
}

.product-chat-header strong,
.product-chat-header span {
    display: block;
}

.product-chat-header strong {
    color: #fff;
    font-size: 1.7rem;
    font-weight: 600;
}

.product-chat-header span {
    margin-top: 0.2rem;
    color: rgba(255, 255, 255, 0.76);
    font-size: 1.2rem;
}

.product-chat-close {
    width: 3.6rem;
    height: 3.6rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 2.8rem;
    font-weight: 300;
    line-height: 1;
}

.product-chat-close:hover,
.product-chat-close:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.product-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding: 2rem 1.8rem;
    overscroll-behavior: contain;
}

.product-chat-message {
    max-width: 84%;
    margin: 0;
    padding: 1.1rem 1.4rem;
    border-radius: 1.7rem;
    color: var(--chat-ink);
    font-size: 1.4rem;
    line-height: 1.5;
}

.product-chat-message--bot {
    align-self: flex-start;
    border-bottom-left-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 4px 14px rgba(25, 42, 32, 0.08);
}

.product-chat-message--user {
    align-self: flex-end;
    border-bottom-right-radius: 0.5rem;
    background: var(--chat-green);
    color: #fff;
}

.product-chat-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-self: flex-start;
    max-width: 100%;
}

.product-chat-choices button,
.product-chat-link {
    min-height: 3.8rem;
    margin: 0;
    padding: 0.8rem 1.3rem;
    border: 1px solid var(--chat-green);
    border-radius: 999px;
    background: transparent;
    color: var(--chat-green);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.35;
    text-transform: none;
}

.product-chat-choices button:hover,
.product-chat-choices button:focus,
.product-chat-link:hover,
.product-chat-link:focus {
    background: var(--chat-green);
    color: #fff;
}

.product-chat-link {
    align-self: flex-start;
    text-decoration: none;
}

.product-chat-product {
    display: grid;
    gap: 0.35rem;
    align-self: stretch;
    padding: 1.3rem 1.4rem;
    border: 1px solid rgba(54, 95, 74, 0.2);
    border-radius: 1.4rem;
    background: var(--chat-cream);
    color: var(--chat-ink);
    text-decoration: none;
    transition: border-color 150ms ease, transform 150ms ease;
}

.product-chat-product:hover,
.product-chat-product:focus {
    border-color: var(--chat-green);
    color: var(--chat-ink);
    transform: translateY(-1px);
}

.product-chat-product strong {
    font-size: 1.4rem;
    font-weight: 600;
}

.product-chat-product span {
    color: #667069;
    font-size: 1.2rem;
}

.product-chat-product .product-chat-product-action {
    margin-top: 0.3rem;
    color: var(--chat-green);
    font-weight: 600;
}

.product-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 1.2rem 1.4rem;
    border-top: 1px solid rgba(54, 95, 74, 0.12);
    background: #fff;
}

.product-chat-form input {
    height: 4.4rem;
    margin: 0;
    padding: 0 1rem;
    border: 0;
    background: transparent;
    font-size: 1.4rem;
}

.product-chat-form input:focus {
    border: 0;
    box-shadow: none;
}

.product-chat-form button {
    display: grid;
    width: 4.2rem;
    height: 4.2rem;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--chat-green);
    color: #fff;
}

.product-chat-form button:hover,
.product-chat-form button:focus {
    background: var(--chat-green-dark);
    color: #fff;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .product-chat {
        right: 1.2rem;
        bottom: 1.2rem;
    }

    .product-chat-panel {
        position: fixed;
        inset: 1rem;
        width: auto;
        height: auto;
        border-radius: 1.8rem;
    }

    .product-chat-launcher-label {
        display: none;
    }

    .product-chat-launcher {
        width: 5.4rem;
        padding: 0;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-chat-panel,
    .product-chat-product {
        transition: none;
    }
}
