/* =====================================================
   LINE buttons + online chat widget (PC + mobile)
   ===================================================== */
:root{
  --line-green:#06c755;--line-green-d:#049a40;
  --chat-orange:#fb9400;--chat-orange-d:#c25f00;--chat-red:#ea4503
}
[data-line-buttons][hidden],.dock[hidden],.chat-panel[hidden],.cp-form[hidden],.cp-thread[hidden],.cp-closed[hidden],
.cp-compose[hidden],.cp-err[hidden],.dock-badge[hidden],.cp-lines-strip[hidden],.chat-btn[hidden]{display:none!important}

/* ---------- shared 3D pill buttons ---------- */
.line-btn,.chat-btn{
  position:relative;display:flex;align-items:center;gap:12px;width:100%;
  min-height:58px;padding:8px 16px 8px 10px;border:0;border-radius:999px;
  color:#fff;font-family:inherit;font-weight:900;text-align:left;line-height:1.25;cursor:pointer;
  text-decoration:none;overflow:hidden;
  transition:transform .15s,box-shadow .15s,filter .15s;-webkit-tap-highlight-color:transparent
}
.line-btn{
  background:linear-gradient(180deg,#2be579 0%,var(--line-green) 55%,#05b34c 100%);
  box-shadow:0 5px 0 var(--line-green-d),0 10px 18px rgba(6,199,85,.35)
}
.chat-btn{
  background:linear-gradient(180deg,#ffb74d 0%,var(--chat-orange) 55%,#f57c00 100%);
  box-shadow:0 5px 0 var(--chat-orange-d),0 10px 18px rgba(245,124,0,.38)
}
.line-btn:hover,.chat-btn:hover{filter:brightness(1.05);transform:translateY(2px)}
.line-btn:hover{box-shadow:0 3px 0 var(--line-green-d),0 6px 12px rgba(6,199,85,.35)}
.chat-btn:hover{box-shadow:0 3px 0 var(--chat-orange-d),0 6px 12px rgba(245,124,0,.38)}
.line-btn:active,.chat-btn:active{transform:translateY(5px);box-shadow:0 0 0 transparent}
.line-btn:focus-visible,.chat-btn:focus-visible,.cp-x:focus-visible{outline:3px solid #ffd600;outline-offset:3px}

/* shine sweep */
.line-btn::after,.chat-btn::after{
  content:"";position:absolute;top:0;left:-60%;width:40%;height:100%;
  background:linear-gradient(105deg,transparent,rgba(255,255,255,.45),transparent);
  transform:skewX(-20deg);animation:btn-shine 3.6s ease-in-out infinite;pointer-events:none
}
@keyframes btn-shine{0%,55%{left:-60%}100%{left:130%}}

.btn-ico{
  flex:none;width:40px;height:40px;border-radius:50%;background:#fff;
  display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px rgba(0,0,0,.15)
}
.btn-ico svg{width:24px;height:24px;display:block}
.line-btn .btn-ico svg{fill:var(--line-green)}
.chat-btn .btn-ico svg{fill:var(--chat-orange)}
.btn-txt{flex:1;min-width:0;display:flex;flex-direction:column}
.btn-txt b{font-size:17px;font-weight:900;letter-spacing:.02em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.btn-txt small{font-size:11.5px;font-weight:700;opacity:.95;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.btn-arrow{flex:none;width:26px;height:26px;border-radius:50%;background:rgba(255,255,255,.28);display:flex;align-items:center;justify-content:center}
.btn-arrow svg{width:14px;height:14px;fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}

.line-btn.small,.chat-btn.small{min-height:44px;padding:6px 12px 6px 8px;gap:9px;box-shadow:0 3px 0 var(--line-green-d)}
.chat-btn.small{box-shadow:0 3px 0 var(--chat-orange-d)}
.line-btn.small .btn-ico,.chat-btn.small .btn-ico{width:30px;height:30px}
.line-btn.small .btn-ico svg,.chat-btn.small .btn-ico svg{width:18px;height:18px}
.line-btn.small .btn-txt b{font-size:14px}
.line-btn.small .btn-arrow{width:22px;height:22px}

/* ---------- content block ---------- */

/* Khung LINE và CHAT mở rộng theo website */
.line-box{
    position:relative;
    width:100% !important;
    max-width:100% !important;
    margin:22px auto 0;
    padding:0 0 18px;
    text-align:center;
    overflow:hidden;
    box-sizing:border-box;
    background:#fff;
    border:2px solid #b8efcc;
    border-radius:20px;
    box-shadow:0 8px 22px rgba(6,199,85,.14);
}

/* Hai nút nằm ngang */
.line-box .line-list{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:16px !important;
    padding:12px 20px 0 !important;
}

/* Nút LINE và Chat chia đều */
.line-box .line-list > .line-btn,
.line-box .line-list > .chat-btn{
    width:100% !important;
    min-width:0 !important;
    margin:0 !important;
}

/* Không hiện chữ または */
.line-box .line-or{
    display:none !important;
}

/* Mobile */
@media(max-width:600px){
    .line-box .line-list{
        gap:8px !important;
        padding:10px !important;
    }

    .line-box .line-list .btn-txt b{
        font-size:12px !important;
    }

    .line-box .line-list .btn-arrow{
        display:none !important;
    }
}

.line-title{
  margin:0 0 6px;padding:11px 14px;font-weight:900;font-size:17px;color:#fff;letter-spacing:.03em;
  background:linear-gradient(90deg,#06c755,#2be579)
}
.line-lead{margin:0 16px 14px;padding-top:12px;font-size:13px;color:#4a5a50;line-height:1.6}


/* LINE và Chat nằm ngang */
.line-box .line-list{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:stretch!important;gap:12px!important;padding:12px 16px 0!important}
.line-box .line-list > .line-btn,.line-box .line-list > .chat-btn{flex:1 1 0!important;width:0!important;min-width:0!important;margin:0!important;box-sizing:border-box!important}
.line-box .line-or{display:none!important}
@media(max-width:600px){
.line-box .line-list{gap:8px!important;padding:10px 10px 0!important}
.line-box .line-list > .line-btn,.line-box .line-list > .chat-btn{padding:7px 8px!important;gap:6px!important;min-height:52px!important}
.line-box .line-list .btn-ico{width:28px!important;height:28px!important}
.line-box .line-list .btn-ico svg{width:18px!important;height:18px!important}
.line-box .line-list .btn-txt b{font-size:12px!important}
.line-box .line-list .btn-txt small{font-size:9px!important}
.line-box .line-list .btn-arrow{display:none!important}
}

.line-lead + .line-list{padding-top:0}
.line-box .chat-btn{margin:0}
.line-or{display:flex;align-items:center;gap:10px;margin:14px 16px 0;color:#8a948e;font-size:12px;font-weight:700}
.line-or::before,.line-or::after{content:"";flex:1;height:1px;background:#d9e6de}
.line-box .chat-wrap{padding:0 16px}
.line-box.on-dark{background:rgba(255,255,255,.96);border-color:#fff}

/* ---------- floating dock ---------- */
.dock{position:fixed;z-index:900;display:flex;gap:10px}
.dock-lines{display:flex;gap:10px;min-width:0}
.dock .line-btn,.dock .chat-btn{min-height:54px;padding:6px 12px 6px 8px;gap:9px;width:auto;flex:1}
.dock .btn-ico{width:36px;height:36px}
.dock .btn-ico svg{width:22px;height:22px}
.dock .btn-txt b{font-size:14.5px}
.dock .btn-txt small{font-size:10.5px}
.dock .btn-arrow{display:none}
.dock-badge{
  position:absolute;top:4px;right:10px;min-width:22px;height:22px;padding:0 6px;border-radius:99px;z-index:2;
  background:#e53935;color:#fff;font-size:12px;font-weight:800;line-height:18px;text-align:center;border:2px solid #fff
}
/* attention ring around the chat button */
.dock .chat-btn{animation:chat-ring 2.4s ease-out infinite}
@keyframes chat-ring{0%{box-shadow:0 5px 0 var(--chat-orange-d),0 0 0 0 rgba(251,148,0,.55)}70%,100%{box-shadow:0 5px 0 var(--chat-orange-d),0 0 0 14px rgba(251,148,0,0)}}

/* mobile: full-width bottom bar */
.dock{left:0;right:0;bottom:0;padding:10px 10px calc(10px + env(safe-area-inset-bottom));background:rgba(255,255,255,.97);
  box-shadow:0 -4px 18px rgba(0,0,0,.14);backdrop-filter:blur(6px)}
.dock-lines{flex:1}
.dock-lines .line-btn:nth-child(n+2){display:none}
.dock.no-chat .dock-lines .line-btn{flex:1}
html.has-dock body{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
html.chat-open .dock{display:none}

@media (max-width:360px){
  .dock .btn-ico{display:none}
  .dock .btn-txt b{font-size:13.5px}
}

/* ---------- chat panel ---------- */
.chat-panel{
  position:fixed;z-index:1000;inset:0;display:flex;flex-direction:column;background:#fff;
  font-family:inherit;color:#2d3142;font-size:14px;line-height:1.55
}
.cp-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;
  background:linear-gradient(135deg,#fb9400,#ea4503);color:#fff}
.cp-ht{display:flex;flex-direction:column;min-width:0}
.cp-ht b{font-size:16px}
.cp-status{font-size:12px;display:flex;align-items:center;gap:6px;opacity:.95}
.st-dot{width:9px;height:9px;border-radius:50%;background:#ffd0b0;display:inline-block}
.st-dot.on{background:#3cff8a;box-shadow:0 0 0 3px rgba(60,255,138,.3)}
.cp-x{background:rgba(255,255,255,.2);border:0;color:#fff;width:36px;height:36px;border-radius:50%;font-size:24px;line-height:1;cursor:pointer}
.cp-x:hover{background:rgba(255,255,255,.35)}
.cp-body{flex:1;min-height:0;display:flex;flex-direction:column;background:#fff8e7}

.cp-form{padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}
.cp-welcome{font-size:13px;color:#5c6275}
.cp-f{display:flex;flex-direction:column;gap:4px;font-weight:700;font-size:13px}
.cp-f input,.cp-f textarea{
  width:100%;padding:11px 12px;border:1.5px solid #f1d9a8;border-radius:10px;background:#fff;font:inherit;font-weight:400;font-size:16px;color:#2d3142
}
.cp-f textarea{resize:vertical;min-height:90px}
.cp-f input:focus,.cp-f textarea:focus,.cp-compose textarea:focus{outline:none;border-color:#fb9400;box-shadow:0 0 0 3px rgba(251,148,0,.2)}
.cp-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.cp-submit{
  border:0;border-radius:999px;padding:14px 18px;font:inherit;font-weight:900;font-size:16px;color:#fff;cursor:pointer;
  background:linear-gradient(180deg,#ffb74d,#f57c00);box-shadow:0 4px 0 var(--chat-orange-d)
}
.cp-submit:active{transform:translateY(3px);box-shadow:none}
.cp-submit:disabled,.cp-send:disabled{opacity:.6;cursor:default}
.cp-note{font-size:11px;color:#9097a8}
.cp-err{color:#c62828;background:#fdecec;border-radius:8px;padding:8px 10px;font-size:13px}
.cp-err.small{margin:0 10px 6px}

/* LINE shortcut inside the chat (offline / always on the start form) */
.cp-lines-strip{
  margin:0;padding:10px 12px;display:flex;flex-direction:column;gap:8px;
  background:#e9f9ef;border:1.5px solid #b8efcc;border-radius:14px
}
.cp-thread > .cp-lines-strip{border-radius:0;border-width:1px 0 0;flex:none}
.cp-lines-strip p{margin:0;font-size:12.5px;font-weight:800;color:#1c7a45;text-align:center}

.cp-thread{flex:1;min-height:0;display:flex;flex-direction:column}
.cp-msgs{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px}
.cp-m{max-width:88%;padding:9px 12px;border-radius:16px;word-break:break-word;position:relative}
.cp-text{white-space:pre-wrap}
.cp-m time{display:block;font-size:10px;opacity:.6;margin-top:3px}
.cp-who{display:block;font-size:11px;font-weight:800;opacity:.75;margin-bottom:2px}
.cp-m.customer{align-self:flex-end;background:#fb9400;color:#fff;border-bottom-right-radius:4px}
.cp-m.staff{align-self:flex-start;background:#fff;border:1px solid #f1d9a8;border-bottom-left-radius:4px}
.cp-m.bot{align-self:flex-start;background:#e8f5e9;border:1px solid #c8e6c9;border-bottom-left-radius:4px}
.cp-m .cp-lines{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.cp-closed{padding:14px;text-align:center;display:flex;flex-direction:column;gap:10px;background:#fff;border-top:1px solid #f1d9a8}
.cp-compose{display:flex;gap:8px;padding:10px;background:#fff;border-top:1px solid #f1d9a8;padding-bottom:calc(10px + env(safe-area-inset-bottom))}
.cp-compose textarea{flex:1;resize:none;max-height:110px;min-height:42px;padding:10px 12px;border:1.5px solid #f1d9a8;border-radius:12px;font:inherit;font-size:16px;color:#2d3142}
.cp-send{border:0;border-radius:12px;padding:0 18px;background:#ea4503;color:#fff;font:inherit;font-weight:800;cursor:pointer}

/* ---------- PC ---------- */
@media (min-width:900px){
  .dock{left:auto;right:22px;bottom:22px;padding:0;background:none;box-shadow:none;backdrop-filter:none;flex-direction:column;align-items:flex-end;gap:14px}
  .dock-lines{flex-direction:column;align-items:flex-end;gap:14px}
  .dock .line-btn,.dock .chat-btn,.dock-lines .line-btn:nth-child(n+2){display:flex;flex:none;width:270px;min-height:62px;padding:8px 14px 8px 10px}
  .dock .btn-ico{width:42px;height:42px}
  .dock .btn-txt b{font-size:16px}
  .dock .btn-txt small{font-size:11.5px}
  .dock .btn-arrow{display:flex}
  .dock-badge{right:46px}
  html.has-dock body{padding-bottom:0}
  html.chat-open .dock{display:flex}
  html.chat-open .dock-lines{display:none}
  .chat-panel{inset:auto 22px 118px auto;width:390px;height:min(640px,calc(100vh - 150px));border-radius:18px;overflow:hidden;
    box-shadow:0 18px 50px rgba(0,0,0,.28)}
}

@media (prefers-reduced-motion:reduce){
  .line-btn,.chat-btn{transition:none}
  .line-btn::after,.chat-btn::after,.dock .chat-btn{animation:none}
}
.line-list .line-or{margin:0}
