/* Hyrion AI Webshop Chatbot – v1.4.0 – © 2025 Hyrion – Mobile-first */

#hyrion-chatbot-root,
#hyrion-chatbot-root * {
  box-sizing:border-box !important;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif !important;
  -webkit-tap-highlight-color:transparent;
}
#hyrion-chatbot-root * {
  margin:0;
}

/* ── Widget container ── */
#hyw { position:fixed; bottom:16px; z-index:2147483647; display:flex; flex-direction:column; gap:10px; }
#hyw.pos-right { right:16px; align-items:flex-end; }
#hyw.pos-left  { left:16px;  align-items:flex-start; }

/* ── Welcome Bubble Popup ── */
#hyrion-chatbot-root #hywb {
  display:none; align-items:flex-start; gap:10px;
  background:#fff !important; border:2px solid #e0defc !important;
  border-radius:18px 18px 4px 18px !important;
  padding:14px 18px !important; font-size:14px !important; color:#1a1a1a !important;
  box-shadow:0 4px 20px rgba(108,99,255,.22) !important;
  max-width:280px !important; min-width:160px; cursor:pointer;
  animation:none; line-height:1.55 !important;
  width:max-content !important;
}
.hywb-anim { animation:hywb-in .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes hywb-in { from{opacity:0;transform:scale(.8) translateY(8px)} to{opacity:1;transform:scale(1) translateY(0)} }
#hyrion-chatbot-root #hywb-txt {
  flex:1 !important; line-height:1.55 !important;
  padding:0 !important; font-size:14px !important;
  color:#1a1a1a !important; white-space:normal !important;
}
#hywb-close { background:none; border:none; cursor:pointer; color:#bbb; font-size:14px; padding:2px 4px; border-radius:4px; flex-shrink:0; }
#hywb-close:hover { color:#ff4d6d; }

/* ── Bubble button ── */
#hyw-bubble {
  width:54px; height:54px; border-radius:50%;
  background:var(--ha,#6C63FF); border:none; cursor:pointer;
  box-shadow:0 4px 18px rgba(108,99,255,.4);
  display:flex; align-items:center; justify-content:center;
  transition:transform .2s,box-shadow .2s; position:relative; outline:none; touch-action:manipulation;
}
#hyw-bubble:active { transform:scale(.95); }
#hyw-bubble.open .ico-chat { display:none!important; }
#hyw-bubble.open .ico-x    { display:block!important; }
#hyw-ubadge {
  position:absolute; top:-4px; right:-4px;
  background:#ff4d6d; color:#fff; border-radius:99px;
  font-size:10px; font-weight:700; padding:2px 5px; min-width:18px;
  text-align:center; display:none; border:2px solid #fff;
}

/* ── Chat window ── */
#hyww {
  width:340px; max-width:calc(100vw - 28px);
  height:520px; max-height:calc(100vh - 90px);
  background:#fff; border-radius:16px; display:none; flex-direction:column;
  box-shadow:0 8px 36px rgba(0,0,0,.18); overflow:hidden;
}
#hyww.hyww-open { display:flex; animation:hyww-pop .25s cubic-bezier(.34,1.56,.64,1); }
#hyw.pos-left #hyww { transform-origin:bottom left; }
@keyframes hyww-pop { from{opacity:0;transform:scale(.88) translateY(10px)} to{opacity:1;transform:scale(1) translateY(0)} }

/* ── Header ── */
#hyrion-chatbot-root #hywh { background:var(--ha,#6C63FF) !important; padding:11px 13px !important; display:flex !important; align-items:center !important; gap:9px; flex-shrink:0; }
#hywhav { width:34px; height:34px; border-radius:50%; background:rgba(255,255,255,.2); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.hywhi { flex:1; }
.hywhi-name { font-size:13px; font-weight:600; color:#fff; }
.hywhi-st   { font-size:11px; color:rgba(255,255,255,.75); display:flex; align-items:center; gap:3px; }
.hywhi-st::before { content:''; width:6px; height:6px; border-radius:50%; background:#4ade80; display:inline-block; }
.hywbtn { background:rgba(255,255,255,.15); border:none; cursor:pointer; border-radius:7px; padding:5px; display:flex; align-items:center; transition:background .15s; touch-action:manipulation; }
.hywbtn:active { background:rgba(255,255,255,.3); }

/* ── Tabs ── */
#hywtabs { display:none; background:#f8f8fa; border-bottom:1px solid #eee; flex-shrink:0; }
.hywtab { flex:1; padding:8px 4px; border:none; background:transparent; font-size:12px; color:#999; cursor:pointer; font-weight:500; border-bottom:2px solid transparent; transition:color .15s,border-color .15s; display:flex; align-items:center; justify-content:center; gap:3px; touch-action:manipulation; }
.hywtab.active { color:var(--ha,#6C63FF); border-bottom-color:var(--ha,#6C63FF); background:#fff; }
#hyw-cbadge { background:var(--ha,#6C63FF); color:#fff; border-radius:99px; padding:0 5px; font-size:10px; display:none; align-items:center; min-width:16px; justify-content:center; }

/* ── Phone Gate ── */
#hyw-gate { flex:1; display:flex; align-items:center; justify-content:center; padding:20px; background:#faf9ff; }
#hyrion-chatbot-root .hyw-gate-in { text-align:center !important; max-width:260px !important; padding:0 !important; }
.hyw-gate-icon{ font-size:38px; margin-bottom:10px; }
.hyw-gate-title{ font-size:17px; font-weight:700; color:#1a1a1a; margin-bottom:6px; }
.hyw-gate-sub { font-size:13px; color:#666; line-height:1.5; margin-bottom:18px; }
#hyrion-chatbot-root #hyw-phone { width:100% !important; border:2px solid #e0defc !important; border-radius:10px !important; padding:12px 14px !important; font-size:16px !important; text-align:center !important; outline:none !important; margin-bottom:10px !important; letter-spacing:1px !important; }
#hyw-phone:focus { border-color:var(--ha,#6C63FF); }
#hyrion-chatbot-root #hyw-phone-ok { width:100% !important; padding:12px !important; background:var(--ha,#6C63FF) !important; color:#fff !important; border:none !important; border-radius:10px !important; font-size:14px !important; font-weight:600 !important; cursor:pointer !important; touch-action:manipulation; }
#hyw-phone-err{ font-size:12px; color:#e11d48; margin-top:6px; min-height:16px; }

/* ── Chat view ── */
#hyw-chat { display:flex; flex-direction:column; flex:1; overflow:hidden; }

/* ── Messages ── */
#hyrion-chatbot-root #hyw-msgs { flex:1; overflow-y:auto; padding:14px 13px 10px !important; display:flex !important; flex-direction:column !important; gap:11px; scroll-behavior:smooth; -webkit-overflow-scrolling:touch; }
#hyw-msgs::-webkit-scrollbar { width:3px; }
#hyw-msgs::-webkit-scrollbar-thumb { background:#e0e0e0; border-radius:2px; }

.hym { display:flex; gap:7px; align-items:flex-end; }
.hym.bot  { align-self:flex-start; max-width:93%; }
.hym.user { align-self:flex-end; flex-direction:row-reverse; max-width:86%; }
.hym-av { width:24px; height:24px; border-radius:50%; flex-shrink:0; background:var(--ha,#6C63FF); display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; color:#fff; margin-bottom:2px; }
.hym-in { display:flex; flex-direction:column; gap:4px; flex:1; min-width:0; }
#hyrion-chatbot-root .hym-bub {
  padding:13px 17px !important;
  margin:0 !important;
  border-radius:14px !important;
  font-size:14px !important;
  line-height:1.6 !important;
  word-break:break-word !important;
  overflow-wrap:break-word !important;
  box-sizing:border-box !important;
  margin:0 !important;
}
#hyrion-chatbot-root .hym.bot  .hym-bub { background:#f1f0fe !important; color:#1a1a1a !important; border-bottom-left-radius:3px !important; }
#hyrion-chatbot-root .hym.user .hym-bub { background:var(--ha,#6C63FF) !important; color:#fff !important; border-bottom-right-radius:3px !important; }
.hym-t    { font-size:10px; color:#ccc; align-self:flex-end; margin-bottom:2px; white-space:nowrap; flex-shrink:0; }
.hym-uimg { max-width:140px; border-radius:10px; border:1px solid #ddd; margin-bottom:4px; }

/* Product cards – OG kép + kattintható cím */
.hym-cards { display:flex; flex-direction:column; gap:10px; }
.hym-card  {
  background:#fff; border:1px solid #e8e8f0; border-radius:13px;
  overflow:hidden; display:flex; flex-direction:column;
  box-shadow:0 1px 6px rgba(0,0,0,.06);
  transition:box-shadow .15s, border-color .15s;
}
.hym-card:hover { border-color:var(--ha,#6C63FF); box-shadow:0 3px 14px rgba(108,99,255,.13); }

/* OG kép – kattintható, teljes szélesség */
.hym-card-imglink { display:block; overflow:hidden; max-height:160px; }
.hym-card-img {
  width:100%; max-height:160px; object-fit:cover;
  display:block; border-bottom:1px solid #f0f0f0;
  transition:transform .2s;
}
.hym-card-imglink:hover .hym-card-img { transform:scale(1.03); }

/* Szöveg rész */
#hyrion-chatbot-root .hym-card-body { padding:12px 13px !important; display:flex !important; flex-direction:column !important; gap:7px !important; }

/* Kattintható cím */
.hym-card-title {
  font-size:14px; font-weight:700; color:#1a1a1a;
  text-decoration:none; line-height:1.35;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
a.hym-card-title:hover { color:var(--ha,#6C63FF); text-decoration:underline; }

.hym-card-meta  { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.hym-card-price { font-size:15px; font-weight:700; color:var(--ha,#6C63FF); }
.hym-card-cat   { font-size:10px; background:#f1f0fe; color:#6C63FF; padding:2px 7px; border-radius:99px; }

.hym-card-acts  { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.hym-card-add   {
  flex:1; background:var(--ha,#6C63FF); color:#fff; border:none;
  border-radius:8px; padding:8px 10px; font-size:13px; font-weight:600;
  cursor:pointer; text-align:center; touch-action:manipulation; white-space:nowrap;
}
.hym-card-add.added { background:#22c55e; }
.hym-card-link  {
  flex:1; display:block; text-align:center; font-size:13px;
  color:var(--ha,#6C63FF); text-decoration:none;
  padding:7px 10px; border:1.5px solid var(--ha,#6C63FF);
  border-radius:8px; white-space:nowrap; font-weight:500;
}
.hym-card-link:hover { background:#f1f0fe; }

/* Chips */
.hym-chips { display:flex; flex-wrap:wrap; gap:5px; }
.hym-chip  { background:#fff; border:1px solid #e0defc; border-radius:99px; padding:5px 11px; font-size:12px; color:var(--ha,#6C63FF); cursor:pointer; white-space:nowrap; touch-action:manipulation; }

/* Typing */
.hym-typing { display:flex; align-items:center; gap:4px; padding:10px 12px; background:#f1f0fe; }
.hym-typing span { width:7px; height:7px; border-radius:50%; background:var(--ha,#6C63FF); opacity:.4; animation:hym-dot 1.3s infinite; }
.hym-typing span:nth-child(2){animation-delay:.2s}
.hym-typing span:nth-child(3){animation-delay:.4s}
@keyframes hym-dot{0%,60%,100%{opacity:.25;transform:scale(1)}30%{opacity:1;transform:scale(1.3)}}

/* Order done */
.hyw-orderdone { background:#f0fdf4; border:1px solid #86efac; border-radius:10px; padding:10px 12px; font-size:13px; }
.hyw-orderdone .od-t   { font-weight:700; color:#166534; margin-bottom:5px; font-size:14px; }
.hyw-orderdone .od-tot { font-weight:700; color:#166534; margin-top:6px; border-top:1px solid #86efac; padding-top:6px; }
.hyw-orderdone .od-sub { font-size:11px; color:#16a34a; margin-top:4px; }

/* Image preview */
#hyw-imgprev { display:none; padding:5px 10px; background:#f8f7ff; border-top:1px solid #ede9fe; align-items:center; gap:7px; flex-shrink:0; }
#hyw-imgprev img { height:42px; border-radius:7px; border:1px solid #ddd; }
#hyw-imgprev span { flex:1; font-size:11px; color:var(--ha,#6C63FF); }
#hyw-imgdel { background:none; border:none; cursor:pointer; color:#ff4d6d; font-size:17px; padding:2px 5px; }

/* Input area */
#hyrion-chatbot-root #hyw-inp { padding:7px 9px 10px !important; background:#fff !important; border-top:1px solid #f0f0f0 !important; display:flex !important; gap:6px; align-items:flex-end; flex-shrink:0; }
#hyw-imgbtn { display:flex; align-items:center; justify-content:center; width:32px; height:34px; border-radius:50%; cursor:pointer; color:#ccc; flex-shrink:0; margin-bottom:3px; touch-action:manipulation; }
#hyw-imgbtn:active { color:var(--ha,#6C63FF); }
#hyrion-chatbot-root #hyw-text { flex:1 !important; border:1.5px solid #e8e8f0 !important; border-radius:20px !important; padding:8px 13px !important; font-size:14px !important; resize:none !important; min-height:38px !important; max-height:90px !important; outline:none !important; line-height:1.4 !important; color:#1a1a1a !important; background:#fafafa !important; -webkit-appearance:none !important; }
#hyw-text:focus { border-color:var(--ha,#6C63FF); background:#fff; }
#hyw-text::placeholder { color:#bbb; }
#hyw-send { width:36px; height:36px; border-radius:50%; background:var(--ha,#6C63FF); border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; touch-action:manipulation; }
#hyw-send:active { opacity:.85; }
#hyw-send:disabled { opacity:.4; }

/* Cart */
#hyw-cart { flex:1; overflow-y:auto; padding:10px 11px; display:none; flex-direction:column; gap:7px; -webkit-overflow-scrolling:touch; }
.hyw-cart-empty { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; color:#bbb; font-size:13px; gap:8px; padding:36px 0; }
.hyw-ci    { background:#fafafa; border:1px solid #eee; border-radius:10px; padding:8px 10px; display:flex; align-items:center; gap:8px; }
.hyw-ci-img{ width:38px; height:38px; object-fit:cover; border-radius:6px; flex-shrink:0; }
.hyw-ci-info{ flex:1; }
.hyw-ci-name { font-size:13px; font-weight:600; color:#1a1a1a; }
.hyw-ci-price{ font-size:12px; color:#888; }
.hyw-ci-rm  { background:none; border:none; cursor:pointer; color:#ff4d6d; font-size:16px; padding:2px 5px; touch-action:manipulation; }
.hyw-ct     { background:#f8f7ff; border:1px solid #e0defc; border-radius:10px; padding:9px 12px; display:flex; justify-content:space-between; align-items:center; }
.hyw-ct-amt { font-size:16px; font-weight:700; color:var(--ha,#6C63FF); }
.hyw-obtn   { width:100%; padding:11px; background:var(--ha,#6C63FF); color:#fff; border:none; border-radius:10px; font-size:14px; font-weight:600; cursor:pointer; touch-action:manipulation; }
.hyw-woolink{ display:block; text-align:center; color:var(--ha,#6C63FF); font-size:12px; text-decoration:none; padding:4px; }

/* Staff contact notice */
#hyrion-chatbot-root .hyrion-staff-notice {
  background: linear-gradient(135deg, #e8f4fd, #f0e8ff) !important;
  border: 1.5px solid #a8d4f5 !important;
  border-radius: 12px !important;
  padding: 13px 16px !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: #1a3a5c !important;
}

/* ── MOBIL (<=480px) ── */
@media (max-width:480px){
  #hyw.pos-right { right:12px; bottom:12px; }
  #hyw.pos-left  { left:12px;  bottom:12px; }
  /* Ablak méret: a JS dynamic CSS min() értéke érvényes – itt nem override-oljuk */
  #hywb { max-width:200px; font-size:12px; }
  .hym-bub { font-size:14px; }
  #hyw-text { font-size:16px !important; } /* iOS zoom megelőzés */
  #hyw-phone { font-size:16px !important; }
}
