.shop-agent {
    position: fixed;
    right: 16px;
    bottom: calc(var(--bottom-nav-height) + 12px);
    z-index: 55;
    font-family: inherit;
}

.shop-agent-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(8, 40, 74, 0.28);
    cursor: pointer;
}

.shop-agent-toggle svg {
    width: 18px;
    height: 18px;
}

.shop-agent-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    display: flex;
    flex-direction: column;
    width: min(380px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 140px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(8, 40, 74, 0.18);
}

.shop-agent-panel[hidden] {
    display: none !important;
}

.shop-agent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 10px;
    background: var(--primary);
    color: #fff;
}

.shop-agent-head strong,
.shop-agent-head p {
    margin: 0;
}

.shop-agent-head p {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.78rem;
}

.shop-agent-close {
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.shop-agent-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 180px;
    padding: 12px;
    overflow: auto;
    background: #f8fafc;
}

.shop-agent-message {
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.45;
}

.shop-agent-message.is-user {
    align-self: flex-end;
    max-width: 85%;
    background: var(--primary);
    color: #fff;
}

.shop-agent-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-agent-product {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: inherit;
}

.shop-agent-product:hover,
.shop-agent-product:focus-visible {
    border-color: var(--primary);
}

.shop-agent-product img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.shop-agent-product strong,
.shop-agent-product span {
    display: block;
}

.shop-agent-product strong {
    font-size: 0.84rem;
    line-height: 1.3;
}

.shop-agent-product span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.75rem;
}

.shop-agent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
    background: #f8fafc;
}

.shop-agent-chips button,
.shop-agent-form button {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.shop-agent-chips button {
    padding: 6px 10px;
}

.shop-agent-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
}

.shop-agent-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 12px;
    font: inherit;
}

.shop-agent-form button {
    padding: 10px 14px;
    background: var(--primary);
    color: #fff;
}

.shop-agent-form button:disabled,
.shop-agent-chips button:disabled {
    opacity: 0.6;
    cursor: wait;
}

@media (min-width: 900px) {
    .shop-agent {
        bottom: 24px;
    }
}
