/**
 * Shiko AI Engine — Frontend CSS
 * Migrated from shiko-theme v3.2.21 → shiko-ai-engine v1.7.0
 *
 * Depends on theme CSS variables:
 *   --shiko-accent, --shiko-bg, --shiko-bg-secondary, --shiko-bg-tertiary,
 *   --shiko-border, --shiko-text, --shiko-text-secondary, --shiko-text-muted
 */

/* ===== AI Tag label ===== */
.shiko-ai-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(109,40,217,0.12);
    color: #7F77DD;
    vertical-align: middle;
    margin-left: 6px;
}

/* ===== AI Recommended Section ===== */
.shiko-ai-recs-section { padding-top: 24px; }

/* ===== AI Cart Upsell ===== */
.shiko-ai-upsell {
    margin-top: 24px;
    padding: 20px 0;
    border-top: 1px solid var(--shiko-border);
}
.shiko-ai-upsell h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--shiko-text);
}
.shiko-product-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 768px) {
    .shiko-product-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== AI Dynamic Badges ===== */
.shiko-ai-dynamic-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
    letter-spacing: 0.3px;
}
.shiko-badge-trending { background: rgba(29,78,216,0.15); color: #378ADD; }
.shiko-badge-hot { background: rgba(228,3,3,0.15); color: #E40303; }
.shiko-badge-price-drop { background: rgba(21,128,61,0.15); color: #15803d; }
.shiko-badge-new { background: rgba(109,40,217,0.15); color: #7F77DD; }

/* ===== AI Review Summary ===== */
.shiko-ai-review-summary {
    background: var(--shiko-bg-secondary);
    border: 1px solid var(--shiko-border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.shiko-ai-review-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.shiko-ai-review-icon { font-size: 16px; }
.shiko-ai-review-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--shiko-text);
}
.shiko-ai-review-rating {
    font-size: 12px;
    color: var(--shiko-text-muted);
    margin-left: auto;
}
.shiko-ai-review-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--shiko-text-secondary);
}

/* ===== AI Account Advisor Widget ===== */
.shiko-ai-advisor {
    margin-top: 10px;
    background: var(--shiko-bg-secondary);
    border: 1px solid var(--shiko-border);
    border-radius: 8px;
    padding: 10px 12px;
}
.shiko-ai-advisor-input {
    display: flex;
    gap: 6px;
}
.shiko-ai-advisor-input input {
    flex: 1;
    padding: 8px 10px;
    background: var(--shiko-bg-tertiary);
    border: 1px solid var(--shiko-border);
    border-radius: 6px;
    color: var(--shiko-text);
    font-size: 13px;
}
.shiko-ai-advisor-input button {
    padding: 8px 12px;
    background: var(--shiko-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.shiko-ai-advisor-answer {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--shiko-text-secondary);
}

/* ===== Floating AI Chatbot — keyboard-safe on mobile ===== */
.shiko-chatbot-fab {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--shiko-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99990;
}
.shiko-chatbot-panel {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-height: 70vh !important;
    max-height: 70dvh !important;
    display: flex;
    flex-direction: column;
    z-index: 100000 !important;
    background: var(--shiko-bg, #fff);
    border-top: 2px solid var(--shiko-accent);
    border-radius: 16px 16px 0 0;
}
.shiko-chatbot-header {
    background: var(--shiko-accent);
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.shiko-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
}
.shiko-chat-user {
    background: var(--shiko-bg-tertiary);
    padding: 8px 10px;
    border-radius: 8px 8px 0 8px;
    margin-bottom: 6px;
    max-width: 85%;
    margin-left: auto;
    color: var(--shiko-text);
}
.shiko-chat-bot {
    background: var(--shiko-accent);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px 8px 8px 0;
    margin-bottom: 6px;
    max-width: 85%;
}
.shiko-chat-loading { opacity: 0.7; font-style: italic; }
.shiko-chatbot-input {
    padding: 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--shiko-border);
    display: flex;
    gap: 8px;
    background: var(--shiko-bg, #fff);
}
.shiko-chatbot-input input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--shiko-border);
    border-radius: 8px;
    font-size: 16px !important;
    background: var(--shiko-bg-secondary);
    color: var(--shiko-text);
}
.shiko-chatbot-input button {
    padding: 10px 16px;
    background: var(--shiko-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 768px) {
    .shiko-chatbot-fab { bottom: 70px; left: 10px; width: 44px; height: 44px; }
}
