/* ============================================================
   TNC – Nút Liên Hệ Nổi | style.css
============================================================ */

/* ---------- Desktop: hộp nút nổi ---------- */
.tnclh-box {
    position: fixed;
    bottom: 120px;
    right: 18px; /* JS sẽ đổi sang left nếu cài đặt = left */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 99999;
}
.tnclh-box.tnclh-vi-tri-left {
    right: auto;
    left: 18px;
}

/* Nút toggle "Liên hệ" dọc */
.tnclh-toggle {
    color: #fff;
    background: var(--tnclh-toggle, #0079d3);
    padding: 12px 10px;
    border-radius: 20px;
    writing-mode: vertical-rl;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Nút tròn */
.tnclh-item {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    position: relative;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform .25s;
    text-decoration: none;
}
.tnclh-item:hover { transform: scale(1.12); }

/* --tnclh-c = màu nút, dùng chung cho nền và vòng sóng */
.tnclh-call    { --tnclh-c: var(--tnclh-call, #fa314a); }
.tnclh-zalo    { --tnclh-c: var(--tnclh-zalo, #0068ff); }
.tnclh-mess    { --tnclh-c: var(--tnclh-mess, #0084ff); }
.tnclh-fanpage { --tnclh-c: var(--tnclh-fanpage, #1877f2); }
.tnclh-map     { --tnclh-c: var(--tnclh-map, #1a73e8); }
.tnclh-tiktok  { --tnclh-c: var(--tnclh-tiktok, #010101); }
.tnclh-top     { --tnclh-c: #555; }
.tnclh-item    { background: var(--tnclh-c, #555); }

.tnclh-item img { width: 28px; height: 28px; }

/* 2.7.4: viền trắng + bóng đổ cho nút nổi bật, tách khỏi vòng sóng */
.tnclh-item:not(.tnclh-top) { box-shadow: 0 0 0 2px #fff, 0 4px 10px rgba(0,0,0,.28); }
/* Messenger: nền gradient tím-hồng giống logo, icon trắng */
.tnclh-mess { background: linear-gradient(45deg, #0099ff 0%, #a033ff 55%, #ff5280 100%); --tnclh-c: #a033ff; }
.tnclh-mess::before, .tnclh-mess::after { background: #a033ff; border-color: #a033ff; }
/* Facebook: icon chữ f trắng to */
.tnclh-fanpage img { width: 30px; height: 30px; }
.tnclh-mess img { width: 26px; height: 26px; }

/* Hiệu ứng tỏa sóng */
.tnclh-item::before,
.tnclh-item::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 2px solid var(--tnclh-c, #555);
    background: var(--tnclh-c, #555);
    transform: translate(-50%,-50%) scale(1);
    opacity: .6;
    z-index: -1;
    pointer-events: none;
    animation: tnclh-wave 1.6s infinite;
}
.tnclh-item::before { animation-delay: .8s; }

@keyframes tnclh-wave {
    0%   { transform: translate(-50%,-50%) scale(1);    opacity: .6;  }
    70%  { transform: translate(-50%,-50%) scale(1.85); opacity: 0;   }
    100% { transform: translate(-50%,-50%) scale(1.85); opacity: 0;   }
}

/* Nút "lên đầu" ẩn ban đầu */
.tnclh-top {
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.tnclh-top.show {
    opacity: 1;
    visibility: visible;
}

/* Giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
    .tnclh-item::before,
    .tnclh-item::after { display: none !important; animation: none !important; }
    .tnclh-call img, .tnclh-center-icon img { animation: none !important; }
}

/* Nút gọi: icon rung qua rung lại */
.tnclh-call img { animation: tnclh-ring 1.2s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes tnclh-ring {
    0%, 50%, 100% { transform: rotate(0); }
    5%  { transform: rotate(-25deg); }
    10% { transform: rotate(25deg); }
    15% { transform: rotate(-25deg); }
    20% { transform: rotate(25deg); }
    25% { transform: rotate(-15deg); }
    30% { transform: rotate(15deg); }
    35% { transform: rotate(0); }
}
/* Mobile: icon gọi giữa thanh dưới cũng rung (giữ translate canh giữa) */
.tnclh-center-icon img { animation: tnclh-ring-c 1.2s ease-in-out infinite; }
@keyframes tnclh-ring-c {
    0%, 50%, 100% { transform: translate(-50%,-50%) rotate(0); }
    5%  { transform: translate(-50%,-50%) rotate(-25deg); }
    10% { transform: translate(-50%,-50%) rotate(25deg); }
    15% { transform: translate(-50%,-50%) rotate(-25deg); }
    20% { transform: translate(-50%,-50%) rotate(25deg); }
    25% { transform: translate(-50%,-50%) rotate(-15deg); }
    30% { transform: translate(-50%,-50%) rotate(15deg); }
    35% { transform: translate(-50%,-50%) rotate(0); }
}

/* Ẩn desktop trên mobile/tablet */
@media (max-width: 850px) {
    .tnclh-box { display: none !important; }
}

/* ============================================================
   Mobile: footer bar — giữ nguyên cấu trúc gốc, đổi prefix
============================================================ */
#tnclh-footer-outer {position: fixed;width: 100%;z-index: 999999 !important;bottom: 0;display: none;}
#tnclh-footer {border-bottom: 9px solid #fff !important;display: flex;max-width: 1200px;margin: auto;position: relative;padding-top: 20px;overflow-x: auto;-webkit-overflow-scrolling: touch;scrollbar-width: none;-ms-overflow-style: none;}
#tnclh-footer::-webkit-scrollbar {display: none;}
#tnclh-footer > a, .tnclh-footer-side > a {position: relative;display: block;flex: 1 1 2;min-width: 60px;text-align: center;padding: 11px 0 0px 0;color: #313131;text-decoration:none;border:0 !important;box-shadow:none !important;}
#tnclh-footer a::before, #tnclh-footer a::after {display:none !important;}
#tnclh-footer > span {display: block;width: 30px;}
#tnclh-footer span {display: block;}
.tnclh-footer-label {padding: 0px 2px 0 2px;font-size: 11px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-weight: bold;line-height: 1.2;}
#tnclh-footer > a img, .tnclh-footer-side > a img {height: 30px;width:30px;}
.tnclh-footer-side {display: flex;flex: 1 1 0;min-width: 0;}
.tnclh-footer-side > a {flex: 1 1 0;}
#tnclh-footer-center {position: relative;flex: 0 0 64px;background: transparent !important;z-index: 2;}
#tnclh-footer-center .tnclh-footer-label {position: absolute;left: 50%;bottom: 2px;transform: translateX(-50%);}
#tnclh-footer-center .tnclh-footer-label > span {padding: 0px 8px;background-image: linear-gradient(92.83deg, #0E68C8 0, #02A4A5 100%);border-radius: 30px;color: white;display: inline-block;}
.tnclh-center-icon {left: 50%;position: absolute;transform: translateX(-50%);background-color: var(--tnclh-call-mobile, #ffc436);width: 50px;height: 50px;border-radius: 50%;top: -10px !important;text-align: center;box-shadow: rgb(0 0 0 / 15%) 0 -3px 10px 0px;border: 2px solid #fff;}
.tnclh-center-icon img{max-width: 20px;height: auto !important;position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);}
.tnclh-wave {width: 50px;height: 50px;position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);border-radius: 50%;box-shadow: 0 0 0 0 #0E68C8;border: 2px solid transparent;transition: all .5s;animation: tnclh-zoom 1.3s infinite;}
@keyframes tnclh-zoom {0% {}70% {box-shadow: 0 0 0 15px transparent}100% {box-shadow: 0 0 0 0 transparent}}
@media only screen and (max-width: 850px) {#tnclh-footer-outer {display:block;}}


/* ============================================================
   Hotline nhiều số (2.8.0)
============================================================ */
.tnclh-hl { position: fixed; bottom: var(--tnclh-hl-day, 100px); z-index: 99998; display: flex; flex-direction: column; gap: 14px; }
.tnclh-hl-right { right: var(--tnclh-hl-le, 20px); align-items: flex-end; }
.tnclh-hl-left  { left:  var(--tnclh-hl-le, 20px); align-items: flex-start; }
.tnclh-hl-btn {
    display: flex; align-items: center; height: 40px; padding: 0 18px 0 0;
    background: var(--tnclh-hl-c, #ff9f2e); color: #fff !important; border-radius: 30px;
    font-weight: 700; font-size: 19px; letter-spacing: .5px; line-height: 1; text-decoration: none !important;
    box-shadow: 0 4px 10px rgba(0,0,0,.2); transition: transform .2s, filter .2s;
}
.tnclh-hl-btn:hover { transform: translateY(-2px); filter: brightness(1.08); color: #fff; }
.tnclh-hl-ic {
    position: relative; z-index: 0; flex: 0 0 auto; width: 48px; height: 48px; margin: 0 10px 0 -4px;
    border-radius: 50%; background: var(--tnclh-hl-c, #ff9f2e);
    box-shadow: 0 0 0 3px rgba(255,255,255,.75), 0 3px 8px rgba(0,0,0,.25);
    display: flex; align-items: center; justify-content: center;
}
.tnclh-hl-ic::before, .tnclh-hl-ic::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: var(--tnclh-hl-c, #ff9f2e); opacity: .5; z-index: -1;
    animation: tnclh-hl-wave 1.6s infinite;
}
.tnclh-hl-ic::before { animation-delay: .8s; }
@keyframes tnclh-hl-rung { 0%, 60%, 100% { transform: rotate(0); } 64% { transform: rotate(-6deg); } 68% { transform: rotate(6deg); } 72% { transform: rotate(-5deg); } 76% { transform: rotate(5deg); } 80% { transform: rotate(-3deg); } 84% { transform: rotate(0); } }
@keyframes tnclh-hl-wave { 0% { transform: scale(1); opacity: .5; } 70%, 100% { transform: scale(1.7); opacity: 0; } }
.tnclh-hl-ic svg { animation: tnclh-ring 1.2s ease-in-out infinite; }
.tnclh-hl-so { white-space: nowrap; }
@media (max-width: 850px) {
    .tnclh-hl { bottom: 150px; gap: 12px; }
    .tnclh-hl-right { right: 12px; }
    .tnclh-hl-left  { left: 12px; }
    .tnclh-hl-btn { height: 36px; font-size: 16px; padding-right: 14px; }
    .tnclh-hl-ic { width: 42px; height: 42px; }
    .tnclh-hl-no-mobile { display: none !important; }
    .tnclh-hl.tnclh-hl-m-right { left: auto; right: 12px; align-items: flex-end; }
    .tnclh-hl.tnclh-hl-m-left  { right: auto; left: 12px; align-items: flex-start; }
    .tnclh-hl-btn { animation: tnclh-hl-rung 2.4s ease-in-out infinite; }
    .tnclh-hl-m-icon .tnclh-hl-btn { padding: 0 !important; height: auto; background: transparent !important; box-shadow: none !important; }
    .tnclh-hl-m-icon .tnclh-hl-so { display: none; }
    .tnclh-hl-m-icon .tnclh-hl-ic { width: 52px; height: 52px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
    .tnclh-hl-m-icon .tnclh-hl-ic svg { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
    .tnclh-hl-ic::before, .tnclh-hl-ic::after, .tnclh-hl-ic svg, .tnclh-hl-btn { animation: none !important; }
}

/* ============================================================
   Nút "Liên hệ" Zalo dưới sản phẩm (2.9.0)
============================================================ */
.tnclh-nsp-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; clear: both; width: 100%; margin-top: 6px; }
.tnclh-nsp-wrap > .button, .tnclh-nsp-wrap > a, .tnclh-nsp-wrap > div { margin: 0 !important; }
.tnclh-nsp-wrap > div { align-self: stretch; width: 100%; }
a.button.tnclh-nsp-btn { background: var(--tnclh-nsp, #0068ff) !important; border-color: var(--tnclh-nsp, #0068ff) !important; color: #fff !important; display: inline-flex; align-items: center; gap: 6px; }
a.button.tnclh-nsp-btn:hover { filter: brightness(.9); }
.tnclh-nsp-ic { background: #fff; color: var(--tnclh-nsp, #0068ff); border-radius: 4px; padding: 0 4px; font-size: .75em; font-weight: 700; line-height: 1.5; }
.tnclh-nsp-single { margin: 10px 0 15px; }
.tnclh-nsp-single .tnclh-nsp-btn { font-size: 1.05em; padding: 0 24px; }
