/* Opticore chatbot widget v1.3 — palette: gold #c9a227, navy #1a2238 */
.oc-chat-root {
  --oc-gold: #c9a227;
  --oc-navy: #1a2238;
  --oc-bg: #ffffff;
  --oc-line: #e8e8e8;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.oc-chat-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  background: var(--oc-navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform .15s ease, box-shadow .15s ease;
}
.oc-chat-bubble:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28); }
.oc-chat-bubble-ic { font-size: 18px; }
.oc-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--oc-gold);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  line-height: 18px;
  text-align: center;
}
.oc-open .oc-chat-bubble { display: none; }
.oc-open .oc-chat-hint { display: none; }

.oc-chat-hint {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  max-width: 200px;
  background: #fff;
  color: var(--oc-navy);
  border: 1px solid var(--oc-gold);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  animation: oc-hint-in .3s ease;
}
.oc-chat-hint::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 24px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 1px solid var(--oc-gold);
  border-bottom: 1px solid var(--oc-gold);
  transform: rotate(45deg);
}
@keyframes oc-hint-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.oc-chat-panel {
  display: none;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 40px);
  background: var(--oc-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}
.oc-open .oc-chat-panel { display: flex; }

.oc-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--oc-navy);
  color: #fff;
  padding: 12px 14px;
}
.oc-chat-head-t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.oc-chat-head-t strong { font-size: 15px; }
.oc-chat-trust { font-size: 11px; opacity: .75; margin-top: 2px; }
.oc-chat-head-t strong::before { content: "●"; color: var(--oc-gold); font-size: 10px; margin-right: 6px; vertical-align: middle; }
.oc-chat-head-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.oc-chat-wa,
.oc-chat-clear,
.oc-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
  padding: 4px 6px;
  text-decoration: none;
}
.oc-chat-close { font-size: 24px; }
.oc-chat-wa:hover,
.oc-chat-clear:hover,
.oc-chat-close:hover { opacity: 1; }

.oc-chat-cart,
.oc-chat-comparebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #faf6e8;
  border-bottom: 1px solid var(--oc-line);
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--oc-navy);
}
.oc-chat-comparebar { background: #f0f4fa; flex-wrap: wrap; }
.oc-comparebar-t { flex: 1; min-width: 0; line-height: 1.35; }
.oc-comparebar-actions { display: flex; gap: 6px; flex-shrink: 0; }
.oc-chat-cart[hidden],
.oc-chat-comparebar[hidden] { display: none !important; }

.oc-chat-log { flex: 1; overflow-y: auto; padding: 14px; background: #f7f8fa; min-height: 0; }

.oc-msg { display: flex; margin-bottom: 10px; }
.oc-msg.oc-user { justify-content: flex-end; }
.oc-bubble {
  max-width: 80%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}
.oc-bot .oc-bubble { background: #fff; color: #1d1d1d; border: 1px solid var(--oc-line); border-bottom-left-radius: 4px; }
.oc-user .oc-bubble { background: var(--oc-navy); color: #fff; border-bottom-right-radius: 4px; }
.oc-bubble-disc { font-size: 11.5px; color: #666; background: #f5f5f5 !important; border-style: dashed !important; }

.oc-typing .oc-bubble { display: inline-flex; gap: 4px; }
.oc-typing span { width: 7px; height: 7px; border-radius: 50%; background: #b9b9b9; animation: oc-blink 1.2s infinite both; }
.oc-typing span:nth-child(2) { animation-delay: .2s; }
.oc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes oc-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.oc-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 14px; border-top: 1px solid var(--oc-line); background: #fff; max-height: 110px; overflow-y: auto; flex-shrink: 0; }
.oc-chips-inline { border-top: none; padding: 0; margin: 4px 0 12px; background: transparent; max-height: none; }
.oc-chip {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--oc-gold);
  color: var(--oc-navy);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.oc-chip:hover { background: var(--oc-gold); color: #fff; }

.oc-chat-disc {
  padding: 6px 14px 0;
  font-size: 10.5px;
  line-height: 1.35;
  color: #888;
  background: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-shrink: 0;
}
.oc-chat-disc[hidden] { display: none !important; }

.oc-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.oc-card { display: grid; grid-template-columns: 84px 1fr; grid-template-areas: "img body" "img actions"; gap: 4px 10px; background: #fff; border: 1px solid var(--oc-line); border-radius: 12px; padding: 10px; }
.oc-card-img { grid-area: img; position: relative; }
.oc-card-img img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; }
.oc-badge { position: absolute; top: 4px; left: 4px; background: var(--oc-gold); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.oc-card-body { grid-area: body; }
.oc-card-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--oc-navy); text-decoration: none; line-height: 1.3; }
.oc-card-title:hover { text-decoration: underline; }
.oc-card-price { font-size: 14px; font-weight: 700; color: var(--oc-gold); margin-top: 3px; }
.oc-price-was { font-weight: 400; color: #999; font-size: 12px; margin-right: 4px; }
.oc-price-now { color: var(--oc-gold); }
.oc-card-actions { grid-area: actions; display: flex; gap: 5px; align-items: flex-end; flex-wrap: wrap; }

.oc-btn { display: inline-block; border: none; border-radius: 8px; padding: 7px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; font-family: inherit; }
.oc-btn-sm { padding: 5px 9px; font-size: 11.5px; }
.oc-btn-gold { background: var(--oc-gold); color: #fff; }
.oc-btn-gold:hover { filter: brightness(.95); }
.oc-btn-ghost { background: #fff; color: var(--oc-navy); border: 1px solid var(--oc-line); }
.oc-btn-ghost:hover { border-color: var(--oc-navy); }

.oc-guides { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.oc-guide { display: block; background: #fff; border: 1px solid var(--oc-line); border-left: 3px solid var(--oc-gold); border-radius: 8px; padding: 9px 11px; text-decoration: none; color: var(--oc-navy); }
.oc-guide strong { display: block; font-size: 13.5px; }
.oc-guide span { font-size: 12px; color: #666; }

.oc-compare { overflow-x: auto; margin-bottom: 12px; }
.oc-compare table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; border: 1px solid var(--oc-line); border-radius: 10px; }
.oc-compare th, .oc-compare td { border: 1px solid var(--oc-line); padding: 6px 8px; text-align: left; }
.oc-compare thead th { background: var(--oc-navy); color: #fff; font-size: 12px; }
.oc-compare td:first-child { font-weight: 600; color: #555; background: #fafafa; }

.oc-lead { background: #fff; border: 1px solid var(--oc-gold); border-radius: 12px; padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.oc-lead-t { font-size: 13.5px; font-weight: 600; color: var(--oc-navy); }
.oc-lead input, .oc-lead textarea { border: 1px solid var(--oc-line); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; }

.oc-chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--oc-line); background: #fff; flex-shrink: 0; }
.oc-chat-input { flex: 1; border: 1px solid var(--oc-line); border-radius: 999px; padding: 10px 14px; font-size: 14px; outline: none; font-family: inherit; }
.oc-chat-input:focus { border-color: var(--oc-gold); }
.oc-chat-send { width: 42px; border: none; border-radius: 50%; background: var(--oc-gold); color: #fff; font-size: 16px; cursor: pointer; flex-shrink: 0; }
.oc-chat-send:hover { filter: brightness(.95); }

@media (max-width: 480px) {
  .oc-chat-root { right: 12px; bottom: 12px; }
  .oc-chat-panel { width: calc(100vw - 24px); height: calc(100vh - 90px); }
  .oc-chat-bubble-tx { display: none; }
  .oc-chat-bubble { padding: 14px; }
  .oc-chips { max-height: 90px; }
}
