/* ICC AI Advisor - Frontend Styles */
:root {
    --icc-dark: #3c2d2a;
    --icc-gold: #b99212;
    --icc-border: #e0d8c8;
    --icc-cream: #faf8f4;
}

/* Product page trigger button */
.icc-ai-product-trigger-wrap {
    margin-top: 10px;
    width: 100%;
}

.icc-ai-product-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    color: var(--icc-dark);
    border: 1px solid var(--icc-dark);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease;
}

.icc-ai-product-trigger:hover {
    background: rgba(60, 45, 42, 0.05);
}

/* Sitewide bubble */
.icc-ai-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--icc-gold);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: opacity 0.2s ease;
}

.icc-ai-bubble:hover {
    opacity: 0.85;
}

.icc-ai-bubble svg {
    display: block;
}

/* Tooltip */
.icc-ai-tooltip {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--icc-dark);
    color: #fff;
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 9999;
    font-family: inherit;
}

.icc-ai-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: var(--icc-dark);
    border-top: none;
}

.icc-ai-bubble:hover .icc-ai-tooltip,
.icc-ai-bubble:focus .icc-ai-tooltip {
    opacity: 1;
}

/* Popup overlay */
.icc-ai-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 18, 14, 0.45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 20px;
}

.icc-ai-popup-overlay[hidden] {
    display: none;
}

/* Popup panel */
.icc-ai-popup {
    background: #fff;
    border-radius: 10px;
    border: 0.5px solid var(--icc-border);
    width: 340px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    align-self: flex-end;
    margin-bottom: 20px;
}

/* Popup header */
.icc-ai-popup-head {
    background: var(--icc-dark);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.icc-ai-popup-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icc-ai-popup-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.icc-ai-popup-head-text {
    flex: 1;
}

.icc-ai-popup-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.icc-ai-popup-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
}

.icc-ai-popup-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.icc-ai-popup-close:hover {
    color: #fff;
}

/* Product strip */
.icc-ai-product-strip {
    background: var(--icc-cream);
    border-bottom: 0.5px solid var(--icc-border);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-height: 48px;
}

.icc-ai-product-strip img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.icc-ai-product-strip-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--icc-dark);
    line-height: 1.3;
}

.icc-ai-product-strip-meta {
    font-size: 11px;
    color: #8a7260;
}

/* Finder intro */
.icc-ai-finder-intro {
    padding: 10px 12px;
    font-size: 12px;
    color: #666;
    border-bottom: 0.5px solid var(--icc-border);
    line-height: 1.5;
    flex-shrink: 0;
}

/* Quick chips */
.icc-ai-chips {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 0.5px solid var(--icc-border);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.icc-ai-chip {
    font-size: 10px;
    padding: 4px 9px;
    border: 0.5px solid var(--icc-border);
    border-radius: 20px;
    color: var(--icc-dark);
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
    line-height: 1.4;
}

.icc-ai-chip:hover {
    background: var(--icc-cream);
}

/* Chat area */
.icc-ai-chat {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 120px;
    max-height: 280px;
}

.icc-ai-bubble-user {
    background: var(--icc-dark);
    color: #fff;
    font-size: 12px;
    padding: 8px 11px;
    border-radius: 10px 0 10px 10px;
    align-self: flex-end;
    max-width: 88%;
    line-height: 1.5;
}

.icc-ai-bubble-ai {
    background: var(--icc-cream);
    color: #333;
    font-size: 12px;
    padding: 8px 11px;
    border-radius: 0 10px 10px 10px;
    align-self: flex-start;
    max-width: 92%;
    line-height: 1.6;
}

.icc-ai-typing {
    background: var(--icc-cream);
    color: #999;
    font-size: 12px;
    padding: 8px 11px;
    border-radius: 0 10px 10px 10px;
    align-self: flex-start;
    font-style: italic;
}

/* Input row */
.icc-ai-input-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 10px 12px;
    border-top: 0.5px solid var(--icc-border);
    align-items: center;
    flex-shrink: 0;
}

.icc-ai-input {
    flex: 1;
    font-size: 13px;
    padding: 9px 12px;
    border: 0.5px solid var(--icc-border);
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

.icc-ai-input:focus {
    border-color: var(--icc-dark);
}


.icc-ai-send {
    height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    background: #b99212 !important;
    border: none !important;
    cursor: pointer;
    flex-shrink: 0;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: inherit;
    white-space: nowrap;
    box-shadow: none !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

.icc-ai-send:hover {
    background: #a07f10 !important;
    color: #ffffff !important;
    opacity: 1 !important;
}

.icc-ai-send svg {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .icc-ai-popup-overlay {
        padding: 0;
        align-items: flex-end;
        justify-content: center;
    }

    .icc-ai-popup {
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        margin-bottom: 0;
        max-height: 85vh;
    }
}

/* Product cards in chat */
.icc-ai-cards-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    width: 100%;
}

.icc-ai-card {
    background: #fff;
    border: 0.5px solid var(--icc-border);
    border-radius: 8px;
    overflow: hidden;
    width: calc(50% - 4px);
    font-size: 11px;
}

.icc-ai-card-img-link {
    display: block;
}

.icc-ai-card-img-link img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.icc-ai-card-no-img {
    width: 100%;
    height: 160px;
    background: var(--icc-cream);
}

.icc-ai-card-body {
    padding: 7px 8px;
}

.icc-ai-card-name {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--icc-dark);
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 3px;
}

.icc-ai-card-name:hover {
    text-decoration: underline;
}

.icc-ai-card-price {
    font-size: 11px;
    color: var(--icc-gold);
    font-weight: 600;
    margin-bottom: 6px;
}

.icc-ai-card-add {
    display: block;
    background: var(--icc-dark);
    color: #fff;
    font-size: 10px;
    text-align: center;
    padding: 5px 6px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

.icc-ai-card-add:hover {
    opacity: 0.85;
    color: #fff;
}

.icc-ai-card-view {
    display: block;
    background: #fff;
    color: var(--icc-dark);
    font-size: 10px;
    text-align: center;
    padding: 5px 6px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--icc-dark);
}

.icc-ai-card-view:hover {
    background: var(--icc-cream);
    color: var(--icc-dark);
}
.icc-ai-product-trigger {
    padding: 8px 14px !important;
    font-size: 13px !important;
}

/* Product cards — single column on mobile */
@media (max-width: 480px) {
    .icc-ai-card {
        width: 100% !important;
    }
}

/* Bubble positioning helper for Flatsome */
.header-search-form-wrapper + .icc-ai-bubble {
    margin-left: 8px;
    flex-shrink: 0;
}
