/* ============================================================
   SonKDO Assistant IA — Stylesheet v1.2
   ============================================================ */

:root {
  --sk-orange:       #c8642a;
  --sk-orange-light: #fdf0e8;
  --sk-orange-mid:   #e8b08a;
  --sk-orange-dark:  #8a4010;
  --sk-radius:       10px;
  --sk-radius-sm:    6px;
  --sk-border:       1px solid #e5e7eb;
  --sk-shadow:       0 2px 12px rgba(0,0,0,0.06);
  --sk-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Layout ---------- */
.sk-assistant-wrap {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  font-family: var(--sk-font);
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 0;
}

@media (max-width: 768px) {
  .sk-assistant-wrap { grid-template-columns: 1fr; }
  .sk-sidebar { display: none; }
}

/* ---------- Widget principal ---------- */
.sk-widget {
  background: #fff;
  border: var(--sk-border);
  border-radius: var(--sk-radius);
  box-shadow: var(--sk-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sk-reset-btn {
  font-size: 11px;
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  color: #888;
  font-family: var(--sk-font);
  transition: all 0.1s;
}
.sk-reset-btn:hover { border-color: var(--sk-orange); color: var(--sk-orange); }

/* ---------- Header ---------- */
.sk-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: var(--sk-border);
  background: #fafafa;
}

.sk-widget-title {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.3px;
}
.sk-widget-title span { color: var(--sk-orange); }

.sk-widget-badge {
  font-size: 11px;
  background: var(--sk-orange-light);
  color: var(--sk-orange-dark);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--sk-orange-mid);
}

/* ---------- Messages ---------- */
.sk-messages {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
  max-height: 480px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.sk-msg-ai {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: skFadeUp 0.25s ease forwards;
}

.sk-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sk-orange-light);
  border: 1px solid var(--sk-orange-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.sk-bubble {
  background: #f4f4f5;
  border-radius: 4px 12px 12px 12px;
  padding: 12px 15px;
  font-size: 14px;
  color: #222;
  line-height: 1.55;
  max-width: 88%;
}

.sk-msg-user {
  display: flex;
  justify-content: flex-end;
  animation: skFadeUp 0.2s ease forwards;
}

.sk-bubble-user {
  background: var(--sk-orange-light);
  border: 1px solid var(--sk-orange-mid);
  color: #5a2a0a;
  border-radius: 12px 4px 12px 12px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 78%;
}

/* ---------- Loading animé ---------- */
.sk-loading-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: skFadeUp 0.2s ease forwards;
}

.sk-loading-bubble {
  background: #f4f4f5;
  border-radius: 4px 12px 12px 12px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sk-loading-text {
  font-size: 13px;
  color: #888;
  font-style: italic;
  animation: skPulse 1.5s ease-in-out infinite;
}

.sk-typing {
  display: flex;
  gap: 4px;
  align-items: center;
}

.sk-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sk-orange-mid);
  animation: skBounce 1.2s infinite;
}
.sk-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.sk-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ---------- Grille produits ---------- */
.sk-products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 480px) {
  .sk-products-grid { grid-template-columns: 1fr; }
}

/* ---------- Carte produit améliorée ---------- */
.sk-product-card {
  background: #fff;
  border: var(--sk-border);
  border-radius: var(--sk-radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: inherit;
}

.sk-product-card:hover {
  border-color: var(--sk-orange);
  box-shadow: 0 4px 12px rgba(200,100,42,0.15);
  transform: translateY(-1px);
}

.sk-product-image {
  width: 100%;
  height: 80px;
  object-fit: contain;
  background: #f9fafb;
  display: block;
}

.sk-product-image-placeholder {
  width: 100%;
  height: 80px;
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.sk-product-body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sk-product-name {
  font-size: 12px;
  font-weight: 600;
  color: #111;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sk-product-why {
  font-size: 11px;
  color: #777;
  font-style: italic;
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sk-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.sk-product-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--sk-orange);
}

.sk-product-merchant {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Bouton "Voir" en bas de carte */
.sk-product-cta {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--sk-orange);
  border-top: 1px solid #f0f0f0;
  padding: 7px 10px;
  background: #fafafa;
  transition: background 0.1s;
  text-decoration: none;
}

.sk-product-card:hover .sk-product-cta {
  background: var(--sk-orange-light);
}

/* ---------- Erreur ---------- */
.sk-error-bubble {
  font-size: 13px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--sk-radius-sm);
  padding: 10px 14px;
  max-width: 88%;
}

/* ---------- Suggestions ---------- */
.sk-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 18px 14px;
}

.sk-suggestion {
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  color: #555;
  background: #fff;
  transition: all 0.1s;
  white-space: nowrap;
}
.sk-suggestion:hover { border-color: var(--sk-orange); color: var(--sk-orange); }

/* ---------- Saisie ---------- */
.sk-input-zone {
  border-top: var(--sk-border);
  padding: 14px;
  display: flex;
  gap: 10px;
  background: #fafafa;
}

.sk-input {
  flex: 1;
  border: var(--sk-border);
  border-radius: var(--sk-radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  background: #fff;
  color: #111;
  font-family: var(--sk-font);
  transition: border-color 0.15s;
  outline: none;
}
.sk-input:focus    { border-color: var(--sk-orange); }
.sk-input:disabled { background: #f4f4f5; cursor: not-allowed; }

.sk-send-btn {
  background: var(--sk-orange);
  color: #fff;
  border: none;
  border-radius: var(--sk-radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sk-font);
  transition: background 0.15s;
  white-space: nowrap;
}
.sk-send-btn:hover    { background: #a84f1e; }
.sk-send-btn:disabled { background: #d1d5db; cursor: not-allowed; }

/* ---------- Sidebar ---------- */
.sk-sidebar { display: flex; flex-direction: column; gap: 14px; }

.sk-side-card {
  background: #fff;
  border: var(--sk-border);
  border-radius: var(--sk-radius);
  box-shadow: var(--sk-shadow);
  padding: 16px;
}

.sk-side-title {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.sk-recent-item {
  font-size: 12px;
  color: #222;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.1s;
}
.sk-recent-item:last-child { border-bottom: none; }
.sk-recent-item:hover      { color: var(--sk-orange); }

.sk-recent-meta { font-size: 10px; color: #aaa; margin-top: 2px; }

.sk-share-url {
  font-size: 11px;
  color: #555;
  background: #f9fafb;
  padding: 7px 9px;
  border-radius: var(--sk-radius-sm);
  border: var(--sk-border);
  word-break: break-all;
  margin-bottom: 10px;
  line-height: 1.5;
}

.sk-share-actions { display: flex; gap: 7px; }

.sk-share-btn {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  border: var(--sk-border);
  background: #fff;
  color: #555;
  transition: all 0.1s;
  text-decoration: none;
  display: inline-block;
}
.sk-share-btn.primary {
  background: var(--sk-orange-light);
  color: var(--sk-orange-dark);
  border-color: var(--sk-orange-mid);
}
.sk-share-btn:hover { border-color: var(--sk-orange); color: var(--sk-orange); }

/* ---------- Animations ---------- */
@keyframes skFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes skBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-5px); }
}
@keyframes skPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ---------- Clarification (requête vague) ---------- */
.sk-clarif-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.sk-clarif-btn {
  font-family: var(--sk-font);
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  border-radius: var(--sk-radius);
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.sk-clarif-btn:hover {
  border-color: var(--sk-orange);
  background: var(--sk-orange-light);
  color: var(--sk-orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(200,100,42,0.15);
}

.sk-clarif-answer {
  font-size: 13px;
  color: var(--sk-orange-dark);
  background: var(--sk-orange-light);
  border: 1px solid var(--sk-orange-mid);
  padding: 6px 12px;
  border-radius: var(--sk-radius-sm);
  display: inline-block;
  margin-top: 4px;
}
