/* Floating sales assistant + right float stack */

.wc-right-float-stack {
    position: fixed;
    right: 20px;
    top: 80%;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transform: translateY(-50%);
    pointer-events: none;
}

.wc-right-float-stack > * {
    pointer-events: auto;
}

.sticky-points-float {
    position: relative;
    text-decoration: none;
}

.sticky-button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 2px solid rgba(212, 175, 55, 0.5);
    cursor: pointer;
    border-radius: 20px;
    padding: 14px 16px 12px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.sticky-points-float:hover .sticky-button {
    transform: scale(1.06);
    border-color: #b8860b;
}

.sticky-button-shine {
    position: absolute;
    top: 0;
    left: -120%;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 35%,
        rgba(255, 255, 255, 0.65) 50%,
        rgba(255, 255, 255, 0.15) 65%,
        transparent 100%
    );
    animation: stickyPointsShine 4s ease-in-out infinite;
    pointer-events: none;
}

.sticky-button img {
    width: 72px;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}

.sticky-button strong {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #8b6914;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

@keyframes stickyPointsShine {
    0% { left: -120%; }
    45%, 100% { left: 120%; }
}

.wc-right-float-stack--with-assistant {
    gap: 0;
    z-index: 1000;
    align-items: flex-end;
}

.wc-float-actions-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.wc-float-actions-row .sticky-points-float {
    flex-shrink: 0;
}

.wc-float-actions-row .sa-widget {
    flex-shrink: 0;
}

.wc-float-actions-row .sticky-button {
    padding: 10px 12px 8px;
}

.wc-float-actions-row .sticky-button img {
    width: 56px;
}

.wc-float-actions-row .sticky-button strong {
    margin-top: 6px;
    font-size: 11px;
}

.sa-widget {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.sa-avatar-btn {
    position: relative;
    width: 78px;
    height: 78px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.sa-avatar-btn:hover,
.sa-avatar-btn[aria-expanded="true"] {
    transform: scale(1.05);
}

.sa-avatar-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.75);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.35);
    animation: saRingPulse 2.5s ease-in-out infinite;
}

.sa-avatar-img {
    position: relative;
    z-index: 1;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 3px solid #fff;
    background: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.sa-avatar-status {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}

@keyframes saRingPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(212, 175, 55, 0.25); }
    50% { box-shadow: 0 8px 30px rgba(212, 175, 55, 0.55); }
}

.sa-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(360px, calc(100vw - 32px));
    max-height: min(70vh, 560px);
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sa-panel[hidden] {
    display: none !important;
}

.sa-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #0b1f33 0%, #132f4c 100%);
    color: #fff;
}

.sa-panel-agent {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sa-panel-agent img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(212, 175, 55, 0.65);
}

.sa-panel-agent strong {
    display: block;
    font-size: 0.95rem;
}

.sa-panel-agent small {
    display: block;
    font-size: 0.74rem;
    opacity: 0.8;
}

.sa-panel-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
}

.sa-messages {
    flex: 1;
    min-height: 220px;
    max-height: 360px;
    overflow-y: auto;
    padding: 14px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sa-message {
    display: flex;
}

.sa-message--bot {
    justify-content: flex-start;
}

.sa-message--user {
    justify-content: flex-end;
}

.sa-message-bubble {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.sa-message--bot .sa-message-bubble {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.sa-message--user .sa-message-bubble {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.sa-product-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.sa-product-card {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sa-product-card:hover {
    border-color: rgba(212, 175, 55, 0.65);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.15);
}

.sa-product-card img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: #f3f4f6;
    flex-shrink: 0;
}

.sa-product-card-body {
    min-width: 0;
    flex: 1;
}

.sa-product-card-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.3;
}

.sa-product-card-meta {
    font-size: 0.74rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.sa-product-card-price {
    font-size: 0.86rem;
    font-weight: 800;
    color: #b8860b;
}

.sa-product-card-price small {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
    text-decoration: line-through;
}

.sa-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px 8px;
    font-size: 0.76rem;
    color: #6b7280;
    background: #f8fafc;
}

.sa-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d4af37;
    animation: saTypingDot 1.2s infinite ease-in-out;
}

.sa-typing span:nth-child(2) { animation-delay: 0.15s; }
.sa-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes saTypingDot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-4px); opacity: 1; }
}

.sa-input-row {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.sa-input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    font-size: 0.88rem;
    font-family: inherit;
}

.sa-input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.75);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.sa-send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.sa-gold-price-card {
    margin-top: 10px;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.sa-gold-price-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 10px;
}

.sa-gold-price-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sa-gold-price-item {
    text-align: center;
}

.sa-gold-price-label {
    font-size: 10px;
    color: #6b7280;
    margin-bottom: 4px;
}

.sa-gold-price-value {
    font-size: 14px;
    font-weight: 700;
    color: #b8860b;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .wc-right-float-stack--with-assistant {
        right: 12px;
        top: auto;
        bottom: 92px;
        transform: none;
        animation: none;
    }

    .wc-float-actions-row {
        gap: 8px;
    }

    .sa-panel {
        right: 0;
        bottom: calc(100% + 10px);
        width: min(340px, calc(100vw - 24px));
    }

    .sa-avatar-btn,
    .sa-avatar-img {
        width: 68px;
        height: 68px;
    }
}

@media (max-width: 480px) {
    .sa-panel {
        position: fixed;
        inset: auto 10px 88px 10px;
        width: auto;
        max-height: 62vh;
    }
}
