/* ══════════════════════════════════════════════════
 * GUIMA - Chatbot de Ventas Soluciones GuemaCAR
 * Estilos profesionales, responsive, animaciones
 * ══════════════════════════════════════════════════ */

/* ═══ BOTÓN FLOTANTE ═══ */
#guemacar-bot-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #059669, #0d9488);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.45), 0 2px 8px rgba(0,0,0,0.15);
    z-index: 999998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: gcb-pulse 3s ease-in-out infinite;
}
#guemacar-bot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(5, 150, 105, 0.55), 0 3px 12px rgba(0,0,0,0.2);
}
@keyframes gcb-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(5, 150, 105, 0.45), 0 2px 8px rgba(0,0,0,0.15); }
    50% { box-shadow: 0 4px 30px rgba(5, 150, 105, 0.65), 0 2px 12px rgba(0,0,0,0.2); }
}

/* ═══ VENTANA DE CHAT ═══ */
#guemacar-bot-window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    height: 560px;
    max-height: calc(100vh - 48px);
    background: #f8fafc;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.1);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#guemacar-bot-window.gcb-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* ═══ HEADER ═══ */
#guemacar-bot-header {
    background: linear-gradient(135deg, #059669, #0d9488);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.gcb-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.gcb-avatar {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}
.gcb-header-name {
    font-weight: 700;
    font-size: 15px;
}
.gcb-header-sub {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 1px;
}
#guemacar-bot-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#guemacar-bot-close:hover {
    background: rgba(255,255,255,0.3);
}

/* ═══ MENSAJES ═══ */
#guemacar-bot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f1f5f9;
}
.gcb-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}
.gcb-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #059669, #0d9488);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.gcb-msg-bot {
    align-self: flex-start;
    background: #fff;
    color: #334155;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ═══ TYPING INDICATOR ═══ */
#guemacar-bot-typing {
    display: flex;
    gap: 5px;
    padding: 8px 16px;
    align-items: center;
}
.gcb-dot {
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: gcb-bounce 1.4s ease-in-out infinite;
}
.gcb-dot:nth-child(2) { animation-delay: 0.2s; }
.gcb-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes gcb-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* ═══ QUICK ACTIONS ═══ */
#guemacar-bot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px 4px;
    flex-shrink: 0;
}
.gcb-action {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 12.5px;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-family: inherit;
}
.gcb-action:hover {
    border-color: #059669;
    color: #059669;
    background: #ecfdf5;
}
.gcb-action i {
    font-size: 12px;
    color: #059669;
}

/* ═══ INPUT ═══ */
#guemacar-bot-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 16px 12px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
#guemacar-bot-input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 13.5px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
    color: #334155;
    background: #f8fafc;
}
#guemacar-bot-input:focus {
    border-color: #059669;
    background: #fff;
}
#guemacar-bot-input::placeholder {
    color: #94a3b8;
}
#guemacar-bot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #0d9488);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}
#guemacar-bot-send:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 12px rgba(5, 150, 105, 0.4);
}

/* ═══ FOOTER ═══ */
#guemacar-bot-footer {
    text-align: center;
    padding: 4px 0 6px;
    font-size: 10px;
    color: #94a3b8;
    flex-shrink: 0;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

/* ═══ TARJETAS DE PRODUCTOS ═══ */
.gcb-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.gcb-card {
    display: flex;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1.5px solid transparent;
}
.gcb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-color: #059669;
}
.gcb-card-img {
    width: 80px;
    min-height: 80px;
    background: #f1f5f9;
    flex-shrink: 0;
    overflow: hidden;
}
.gcb-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gcb-card-body {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.gcb-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.3;
}
.gcb-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #059669;
}
.gcb-card-prices {
    display: flex;
    align-items: center;
    gap: 8px;
}
.gcb-card-old {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: line-through;
}
.gcb-card-price.gcb-sale {
    color: #dc2626;
}
.gcb-card-badge {
    background: #fef2f2;
    color: #dc2626;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
}
.gcb-card-sku {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}
.gcb-card-out {
    font-size: 11.5px;
    color: #dc2626;
    font-weight: 600;
    margin-top: 2px;
}

/* ═══ TARJETAS DE CURSOS ═══ */
.gcb-card-course {
    border-left: 4px solid #059669;
}
.gcb-card-label {
    font-size: 10px;
    font-weight: 700;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.gcb-card-spots {
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.gcb-spots-ok {
    color: #059669;
}
.gcb-spots-low {
    color: #dc2626;
    font-weight: 600;
}
.gcb-card-date {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.gcb-card-cta {
    font-size: 12px;
    color: #059669;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ═══ TARJETAS DE OFERTAS ═══ */
.gcb-card-offer {
    border-left: 4px solid #dc2626;
}
.gcb-card-offer .gcb-card-label {
    color: #dc2626;
    background: #fef2f2;
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}
.gcb-card-offer .gcb-card-cta {
    color: #dc2626;
}

/* ═══ TARJETAS DEL BLOG ═══ */
.gcb-card-blog {
    border-left: 4px solid #2563eb;
}
.gcb-card-blog .gcb-card-label {
    color: #2563eb;
    background: #eff6ff;
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 9.5px;
}
.gcb-card-excerpt {
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gcb-card-meta {
    display: flex;
    gap: 12px;
    font-size: 10.5px;
    color: #94a3b8;
    margin-top: 5px;
}
.gcb-card-meta i {
    margin-right: 3px;
}
.gcb-card-blog .gcb-card-cta {
    color: #2563eb;
}

/* ═══ TARJETA ORDEN DE TRABAJO ═══ */
.gcb-orden-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(5, 150, 105, 0.12);
    margin-top: 8px;
    display: flex;
    align-items: stretch;
    border: 1.5px solid #d1fae5;
}
.gcb-orden-icon {
    width: 52px;
    background: linear-gradient(135deg, #059669, #0d9488);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}
.gcb-orden-body {
    padding: 12px 14px;
    flex: 1;
    min-width: 0;
}
.gcb-orden-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}
.gcb-orden-desc {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.45;
    margin-bottom: 8px;
}
.gcb-orden-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.gcb-orden-info span {
    font-size: 10.5px;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 10px;
}
.gcb-orden-info i {
    font-size: 10px;
}
.gcb-orden-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    background: linear-gradient(135deg, #059669, #0d9488);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.2s;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    letter-spacing: 0.5px;
}
.gcb-orden-btn:hover {
    opacity: 0.9;
}
.gcb-orden-btn i {
    margin-top: 6px;
    font-size: 10px;
}

/* ═══ TARJETAS BASE DE CONOCIMIENTO ═══ */
.gcb-kb-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.1);
    margin-top: 8px;
    border: 1.5px solid #ede9fe;
}
.gcb-kb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f5f3ff;
    border-bottom: 1px solid #ede9fe;
}
.gcb-kb-label {
    font-size: 10px;
    font-weight: 700;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.gcb-kb-label i {
    font-size: 11px;
}
.gcb-kb-tipo {
    font-size: 10px;
    color: #8b5cf6;
    background: #ede9fe;
    padding: 1px 8px;
    border-radius: 8px;
}
.gcb-kb-body {
    padding: 10px 12px;
}
.gcb-kb-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.35;
}
.gcb-kb-excerpt {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 8px;
}
.gcb-kb-detail {
    font-size: 11.5px;
    color: #334155;
    margin-bottom: 3px;
    line-height: 1.4;
}
.gcb-kb-detail-label {
    font-weight: 600;
    color: #64748b;
}
.gcb-kb-warn {
    font-size: 11px;
    color: #d97706;
    background: #fffbeb;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 8px;
    border-left: 3px solid #f59e0b;
    line-height: 1.4;
}
.gcb-kb-warn i {
    margin-right: 4px;
}
.gcb-kb-faq {
    margin-top: 8px;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
}
.gcb-kb-faq-item {
    font-size: 11.5px;
    color: #334155;
    margin-bottom: 6px;
    line-height: 1.45;
    padding-left: 8px;
    border-left: 2px solid #e2e8f0;
}
.gcb-kb-faq-item strong {
    color: #1e293b;
}
.gcb-kb-faq-item br {
    display: block;
    margin-top: 1px;
}

/* ═══ SCROLLBAR ═══ */
#guemacar-bot-messages::-webkit-scrollbar {
    width: 5px;
}
#guemacar-bot-messages::-webkit-scrollbar-track {
    background: transparent;
}
#guemacar-bot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 480px) {
    #guemacar-bot-btn {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
    #guemacar-bot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    #guemacar-bot-window.gcb-open {
        border-radius: 0;
    }
    .gcb-card-img {
        width: 64px;
        min-height: 64px;
    }
    .gcb-action {
        font-size: 11.5px;
        padding: 6px 10px;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    #guemacar-bot-window {
        width: 360px;
        height: 500px;
    }
}

@media (max-height: 600px) {
    #guemacar-bot-window {
        height: 440px;
    }
}