/* Style dropdown menu */
.navbar .dropdown-menu {
  border-radius: 8px;
  /* bo góc */
  padding: 8px 0;
  /* khoảng cách bên trong */
  border: none;
  /* bỏ viền */
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
  /* đổ bóng nhẹ */
  min-width: 220px;
  /* độ rộng tối thiểu */
}

/* Style item trong dropdown */
.navbar .dropdown-menu .dropdown-item {
  padding: 10px 18px;
  color: #333;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  border-radius: 6px;
  /* bo góc item */
}

/* Hover item */
.navbar .dropdown-menu .dropdown-item:hover {
  background-color: #8BC34A;
  /* xanh lá nhạt */
  color: #fff;
  /* chữ trắng */
}

/* Dropdown mở khi hover */
.nav-item.dropdown:hover .dropdown-menu {
  display: block;
  margin-top: 0;
  animation: fadeIn 0.3s ease-in-out;
  /* hiệu ứng mượt */
}

/* Hiệu ứng fade */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo css */
.logo-circle {
  margin-right: 10px;
  height: 70px;
  width: 70px;
  /* nên để bằng nhau để bo tròn đẹp */
  border-radius: 50%;
  /* bo tròn */
  object-fit: cover;
  /* giữ hình không méo */
  border: 3px solid #8BC34A;
  /* viền xanh lá đồng bộ với web */
  padding: 3px;
  /* cách viền một chút nếu muốn */
  background: white;
  /* nền trắng để viền nổi bật hơn */
}

/*Menu*/
.navbar {
  padding: 12px 20px;
  /* border-bottom: 1px solid #eee; */
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); */
}

/* Nav link */
.navbar-nav .nav-link {
  font-weight: 500;
  padding: 10px 15px;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: #4CAF50 !important;
  /* xanh lá */
}

.navbar-nav .nav-link.active {
  color: #4CAF50 !important;
  font-weight: 600;
}

/* Gạch chân khi hover */
.navbar-nav .nav-link::after {
  content: "";
  display: block;
  height: 2px;
  width: 0;
  background: #4CAF50;
  transition: width 0.3s;
  margin: auto;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 60%;
}

/* Dropdown menu */
.dropdown-menu {
  border-radius: 10px;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 10px;
}

.dropdown-menu .dropdown-item {
  border-radius: 6px;
  padding: 10px 15px;
  transition: all 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
  background: #4CAF50;
  color: #fff;
}

/*thêm */
/* ========= ẨN MŨI TÊN DROPDOWN (giữ nguyên logic) ========= */
.navbar .dropdown-toggle::after {
  display: none !important;
  content: none !important;
  border: 0 !important;
  background: none !important;
}

/* ========= SEARCH: mặc định chỉ hiện kính lúp, bấm mới mở ========= */
/* Form search ở trạng thái thu gọn */
#headerSearchForm {
  width: 44px;
  /* chỉ thấy icon kính lúp */
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px;
  overflow: hidden;
  gap: 6px;
  transition: width .25s ease, border-color .2s ease, box-shadow .2s ease;
}

/* Ẩn input khi thu gọn */
#headerSearchForm .form-control {
  width: 0;
  min-width: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  background: transparent;
  color: #333;
  transition: width .25s ease, opacity .2s ease, padding .2s ease;
}

/* Màu kính lúp (theo xanh của bạn) */
#headerSearchForm .btn {
  color: #4CAF50 !important;
}

#headerSearchForm .btn:hover {
  color: #43A047 !important;
}

/* Khi focus trong form hoặc có class .open (JS đã thêm) -> mở rộng */
#headerSearchForm:focus-within,
#headerSearchForm.open {
  width: clamp(300px, 35vw, 200px);
  border-color: #4CAF50 !important;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, .18);
}

#headerSearchForm:focus-within .form-control,
#headerSearchForm.open .form-control {
  width: 100%;
  opacity: 1;
  padding: .6rem .5rem;
  pointer-events: auto;
}

#headerSearch::placeholder {
  color: #9aa4b2;
}

/* Nhỏ màn hình: mở rộng vừa phải */
@media (max-width: 576px) {

  #headerSearchForm:focus-within,
  #headerSearchForm.open {
    width: min(90vw, 360px);
  }
}

/* === Search popup: compact list, thấy được nhiều item === */
#searchPopup {
  width: min(640px, 100%);
  max-height: min(60vh, 420px);
  padding: .25rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
  overflow: auto;
}

/* Item kiểu list, thấp – để hiện được nhiều */
#searchPopup .sug-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .6rem;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}

#searchPopup .sug-item+.sug-item {
  margin-top: .25rem;
}

#searchPopup .sug-item:hover {
  background: #f8fafc;
  border-color: #e5e7eb;
  transform: translateY(-1px);
}

/* Ảnh thu nhỏ cố định – tránh bị phóng to như hình bạn gửi */
#searchPopup .sug-item img {
  width: 56px !important;
  height: 56px !important;
  flex: 0 0 56px !important;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
}

/* Tiêu đề 2 dòng, không tràn; giá nhỏ gọn */
#searchPopup .sug-item .title {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#searchPopup .sug-item .price {
  color: #475569;
  font-weight: 700;
  font-size: .95rem;
}

/* Bỏ highlight chữ trùng (mark) — nhìn như text bình thường */
#searchPopup mark {
  background: transparent !important;
  color: inherit !important;
  font-weight: inherit !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* One-line nav trên màn ≥ xl */
@media (min-width: 1200px) {

  /* Toàn khối navbar không wrap */
  .navbar .navbar-collapse {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 16px;
    min-width: 0;
    /* cho phép co giãn hợp lý */
  }

  /* Brand + search + nav + utilities phân bổ theo 1 hàng */
  .navbar .navbar-brand {
    margin-right: 12px;
    flex: 0 0 auto;
  }

  .header-search {
    flex: 0 1 360px;
    min-width: 260px;
  }

  /* chỉnh tùy bạn */
  .navbar-nav {
    flex: 1 1 auto;
    justify-content: center;
    flex-wrap: nowrap !important;
    /* quan trọng */
    white-space: nowrap;
    /* không xuống dòng */
    min-width: 0;
  }

  .navbar-nav .nav-item {
    flex: 0 0 auto;
  }

  .navbar-nav .nav-link {
    padding: .6rem .8rem !important;
    /* thu padding để đủ chỗ */
  }

  .navbar .d-flex.ms-auto.nav-utilities {
    flex: 0 0 auto;
  }
}

/* Với màn hẹp 1200–1366: co thêm để vẫn 1 hàng */
@media (min-width: 1200px) and (max-width: 1366px) {
  .navbar-nav .nav-link {
    font-size: .98rem;
    padding: .55rem .7rem !important;
  }

  /* nếu search đang chiếm chỗ, thu nhỏ chút khi mở */
  #headerSearchForm:focus-within,
  #headerSearchForm.open {
    width: clamp(220px, 24vw, 320px);
  }
}

    /* Banner thông báo trong box chat */
    .chat-banner {
        background: #fff9db;
        border: 1px solid #ffe58f;
        color: #7a6a00;
        padding: .45rem .6rem;
        border-radius: 10px;
        margin: 8px 10px 0;
        display: flex;
        align-items: center;
        gap: .5rem;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
        animation: chatSlide .25s ease-out;
    }

    .chat-banner i {
        font-size: 14px
    }

    @keyframes chatSlide {
        from {
            opacity: 0;
            transform: translateY(-6px)
        }

        to {
            opacity: 1;
            transform: translateY(0)
        }
    }

    /* Nhịp nhẹ cho nút tròn khi có tin mới (khi box đang đóng) */
    .chat-fab__btn.pulse {
        animation: chatPulse 1.2s ease-in-out infinite
    }

    @keyframes chatPulse {
        0% {
            transform: scale(1)
        }

        50% {
            transform: scale(1.06)
        }

        100% {
            transform: scale(1)
        }
    }


/* ============ AI RÙA — SKIN 4 CHÂN + ĐUÔI (NO HTML/JS CHANGE) ============ */
#aiTurtle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1050;
}

/* Nút tròn = mai rùa */
#aiTurtleBtn {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
  position: relative;
  background:
    /* highlight bóng sáng trên mai */
    radial-gradient(70% 60% at 50% 32%, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, 0) 68%),
    /* màu mai */
    radial-gradient(65% 65% at 50% 58%, #7cca7a 0%, #53ae56 55%, #338a37 100%),
    /* hoạ tiết lục giác mờ */
    url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'>\
  <g fill='none' stroke='%23ffffff22' stroke-width='2'>\
    <path d='M32 8l12 8v16l-12 8-12-8V16z'/>\
    <path d='M20 16l-8 6v12l8 6M44 16l8 6v12l-8 6'/>\
  </g>\
</svg>");
  background-blend-mode: normal, normal, overlay;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, .22),
    inset 0 2px 6px rgba(255, 255, 255, .25);
  transition: transform .15s ease, filter .18s ease, box-shadow .2s ease;
}

#aiTurtleBtn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

#aiTurtleBtn:active {
  transform: translateY(0);
}

/* ĐẦU RÙA (nổi ở mép trên) */
#aiTurtleBtn::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 8px;
  top: -6px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 45%, #1e2a1e 2px, transparent 2.6px),
    /* mắt trái */
    radial-gradient(circle at 65% 45%, #1e2a1e 2px, transparent 2.6px),
    /* mắt phải */
    linear-gradient(#6fbe6f, #5cad5c);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08), 0 2px 4px rgba(0, 0, 0, .12);
  pointer-events: none;
}

/* 4 CHÂN — dùng 1 pseudo + box-shadow để nhân bản thành 4 cái */
#aiTurtleBtn::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 16px;
  left: 11px;
  bottom: -6px;
  /* CHÂN TRƯỚC-TRÁI (gốc) */
  border-radius: 10px;
  background: linear-gradient(#63b963, #4aa64a);
  border: 1px solid #2f7b34;
  box-shadow:
    /* TRƯỚC-PHẢI */
    34px 0 0 #63b963,
    /* SAU-TRÁI   */
    0 -36px 0 #63b963,
    /* SAU-PHẢI   */
    34px -36px 0 #63b963;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .15));
  transform: rotate(3deg);
  pointer-events: none;
  transition: transform .2s ease;
}

/* nhịp nhẹ (walking vibe) */
#aiTurtleBtn:hover::after {
  transform: rotate(0deg) translateY(-1px);
}

/* ĐUÔI — vểnh nhẹ bên phải, gắn ở container để không tốn pseudo của nút */
#aiTurtle::before {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 30px;
  /* căn với nút 64px ở dưới */
  width: 16px;
  height: 16px;
  border-radius: 50% 0 50% 50%;
  transform: rotate(-40deg);
  background: linear-gradient(#5cab5c, #4a9c4a);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .16);
  pointer-events: none;
}

/* HINT: “AI Rùa – Tư vấn cho bạn!” (tự hiện 6s, hover để xem lại) */
#aiTurtle::after {
  content: "AI Rùa – Tư vấn cho bạn!";
  position: absolute;
  right: 72px;
  bottom: 10px;
  background: #111827;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .2px;
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
  opacity: 1;
  transform: translateY(0);
  white-space: nowrap;
  pointer-events: none;
  animation: turtleHint 3s ease-in-out forwards;
}

#aiTurtle:hover::after {
  opacity: 1 !important;
  transform: translateY(0) !important;
  animation: none;
}

@keyframes turtleHint {

  0%,
  70% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* CARD mở chat — bo tròn & tông xanh lá */
#aiTurtleCard {
  border: 1px solid #d1fadf;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
  overflow: hidden;
  animation: cardPop .18s ease-out;
}

@keyframes cardPop {
  from {
    transform: translateY(8px);
    opacity: .0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

#aiTurtleCard .ai-card__header {
  background: linear-gradient(135deg, #5cc56a, #2f9e44);
  color: #fff;
  border-bottom: 1px solid #2aa04a33;
}

/* Bubble chat */
#aiChatBody .ai-msg.ai-user .ai-msg__bubble {
  background: #e8f9ee;
  border: 1px solid #c6f0d4;
  color: #114b22;
}

#aiChatBody .ai-msg.ai-bot .ai-msg__bubble {
  background: #fff;
  border: 1px solid #e5f2e9;
}

/* Nút gửi */
#aiForm #aiSend {
  background: #2f9e44;
  border-color: #2f9e44;
}

#aiForm #aiSend:hover {
  filter: brightness(1.05);
}

/* Typing */
#aiTyping {
  color: #2f9e44;
  font-weight: 600;
}