.cart-wrapper {
    position: relative;
    display: inline-block;
}

#cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e53935;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 50%;
    text-align: center;
    padding: 0 4px;
}

/* POP */
@keyframes cartBadgePop {
    0%   { transform: scale(0.6); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cart-badge-animate {
    animation: cartBadgePop 0.35s ease-out;
}

/* GLOW */
@keyframes cartBadgeGlow {
    0% { box-shadow: 0 0 0 rgba(229,57,53,0); }
    50% {
        box-shadow:
            0 0 8px rgba(229,57,53,0.8),
            0 0 14px rgba(229,57,53,0.6);
    }
    100% { box-shadow: 0 0 0 rgba(229,57,53,0); }
}

.cart-badge-glow {
    animation: cartBadgeGlow 0.6s ease-out;
}
@keyframes cartBadgePulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.cart-badge-pulse {
    animation: cartBadgePulse 0.5s ease-in-out;
}

/* ====== NHẤP NHÁY NHẸ KHI GIỎ CÓ HÀNG ====== */
@keyframes cartBadgeIdlePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(229,57,53,0);
    }
    50% {
        transform: scale(1.12);
        box-shadow:
            0 0 6px rgba(229,57,53,0.6),
            0 0 10px rgba(229,57,53,0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(229,57,53,0);
    }
}

.cart-badge-idle {
    animation: cartBadgeIdlePulse 0.6s ease-in-out;
}


@media (max-width: 768px) {
    /* Bọc chung menu và nút trong 1 khung */
  .menu-wrapper {
    max-width: 100%; /* thay số này bằng chiều rộng mong muốn */
   
    background: none !important; /* xóa nền nếu có */
    box-shadow: none !important;
    border: none !important;
  }

/* Style chung cho 2 nút mobile */
.mobile-menus button {
  width: 100%;          /* mỗi nút full hàng */
  min-height: 45px;     /* chiều cao */
  font-size: 16px;      /* chữ rõ hơn */
  white-space: nowrap;  /* ❌ không cho xuống dòng */
  padding: 10px 16.5px;   /* khoảng cách trong nút */
  border-radius: 5px;
}


  .mobile-menus {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    margin: 10px 0;
  }
  .mobile-btn {
    flex: 1;
    background: #34495e;
    color: #fff;
    border: none;
    padding: 12px 15px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
  }

  /* Ẩn menu chính mặc định */
  .main-nav {
    display: none;
    background: #34495e; /* nền xanh cho menu chính */
    padding: 0;
    margin: 0;
    border-radius: 6px;
  }

  /* Khi bật .show thì hiện menu */
  .main-nav.show {
    display: block;
    padding: 10px;
  }

  /* Mở 2 cột bên trong */
  .main-nav.show .menu-left,
  .main-nav.show .menu-right {
    display: block;
    /* bỏ nền trắng, giữ nền cha */
    background: none;
    padding: 10px 0;
    width: 100%;
    box-sizing: border-box;
  }

  /* Menu dạng cột */
  .menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .menu li {
    width: 100%;
    margin: 0;
    border-top: 1px solid #fff;
  }
  .menu li a {
    display: block;
    padding: 10px;
    color: #fff;
    text-decoration: none;
  }
  .menu li a:hover {
    background-color: #444;
  }

  /* Danh mục mobile */
  .mobile-category-list {
    display: none;
    
   background: #34495e;
    border: 1px solid #ddd;
    margin-top: 10px;
    border-radius: 5px;
    padding: 10px;
  }
  .mobile-category-item {
    margin-bottom: 10px;
  }
  .mobile-category-item .nhom-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #d93600;
  }
  .mobile-category-item ul {
    list-style: none;
    padding-left: 20px;
    margin: 0;
  }
  .mobile-category-item ul li {
      padding-top: 10px;
      border-top: 1px solid #fff;
    margin: 5px 0;
  }
  .mobile-category-item ul li a {
   
    color: #fff;
    text-decoration: none;
  }
  .mobile-category-item ul li a:hover {
    color: #007bff;
  }

  .mobile-category-list.show {
    display: block !important;
  }
}

/* PC - Luôn hiển thị menu và tìm kiếm, ẩn nút mobile */
@media (min-width: 769px) {
  .menu-left,
  .menu-right {
    display: block;
    background-color: transparent;
  }

  /* Ẩn nút Menu chính & Danh mục trên PC */
  .mobile-menus {
    display: none;
  }
  .search-mobile{display: none;}
  .mobile-category-list {
    display: none;
  }
}

/* Mobile: bỏ padding-top để menu sát head */
@media screen and (max-width: 768px) {
  .wrapper {
    padding-top: 63px; 
  }
}

/* PC: giữ khoảng cách như cũ và nền trắng */
@media (min-width: 769px) {
  .wrapper {
    padding-top: 130px;
 
  }
  /*đẩy nội dung dưới baner xuống*/
.content-spacer {
  height: 70px; /* PC mặc định */
}
}

/* ✅ Mobile: 60px */
@media (max-width: 768px) {
  .content-spacer {
    height: 118px;
  }
}

/* FORM TÌM KIẾM GIAO DIÊN MOBILE */
.search-mobile {
  display: flex;
  align-items: center;
  max-width: 100%;
  background: white;
  border: 1px solid #ccc;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Ẩn trên PC, chỉ hiển thị khi là mobile */
@media (min-width: 769px) {
  .search-mobile {
    display: none !important;
  }
}

.search-mobile input[type="text"] {
  flex: 1;
  padding: 8px 14px;
  font-size: 14px;
  font-family: Tahoma, "Be Vietnam Pro", sans-serif;
  border: none;
  outline: none;
}

.search-mobile button {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s ease;
}

.search-mobile button:hover {
  background: #c0392b;
}

/* Ẩn form trong menu khi là mobile */
@media (max-width: 768px) {
  .menu-right {
    display: none !important;
  }
  .search-mobile {
      margin-top: 15px;
   max-width: 100%;
    display: flex !important;
  }
}


@media (max-width: 768px) {
/* --- Gợi ý --- */
  .suggestions-box {
    position: absolute;
    top: 53px;
    left: 0;
    width: 100%;
    background: #1c2833;
    border: 1px solid #ccc;
    border-radius: 4px;
    z-index: 9999;
    display: none;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  }

  .suggestion-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    gap: 10px;
    cursor: pointer;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .suggestion-thumb {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0;
    object-fit: cover !important;
    border-radius: 4px;
    border: 1px solid #ddd;
  }

  .suggestion-item span {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .suggestion-item:hover {
    background-color: #fff;
    color: #cc0000;
  }

  .suggestion-item.selected {
    background-color: #fff;
    color: #cc0000;
  }
  
  .suggestion-item {
  transition: all 0.25s ease;
}

.suggestion-item:hover {
  background-color: #fff;
  color: #cc0000;
  transform: translateX(3px); /* trượt nhẹ sang phải */
}

.suggestion-thumb {
  transition: transform 0.25s ease;
}

.suggestion-item:hover .suggestion-thumb {
  transform: scale(1.1); /* phóng to ảnh nhẹ */
}
/* Hiển thị thanh cuộn gọn gàng */
.suggestion-box::-webkit-scrollbar {
  width: 6px;
}
.suggestion-box::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 4px;
}
.suggestion-box::-webkit-scrollbar-thumb:hover {
  background-color: #555;
    }
}

/*NÚT THÊM VÀO GIỎ*/

   .btn-them-gio {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    border: none;

    height: 30px;                 /* đồng bộ chiều cao */
    max-width: 150px;             /* ✅ ÉP NÚT DÀI RA */
    padding: 0 10px;              /* trái / phải */
    
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;

    display: inline-flex;         /* ✅ KHÓA XUỐNG DÒNG */
    align-items: center;
    justify-content: center;
    gap: 6px;  /* khoảng cách icon - chữ */
    white-space: nowrap;          /* ✅ CHỮ KHÔNG XUỐNG DÒNG */

    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    transition: all 0.25s ease;
}

.btn-them-gio:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.35);
    background: linear-gradient(135deg, #ff5722, #e64a19);
}

.btn-them-gio:active {
    transform: scale(0.96);
}
/* 🔒 đang xử lý hoặc đã có trong giỏ */
.btn-them-gio.loading,
.btn-them-gio:disabled {
     background: linear-gradient(135deg, #43a047, #1b5e20);
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-them-gio.loading {
    pointer-events: none;
}

/* 🚫 không hover khi disabled */
.btn-them-gio:disabled:hover {
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #bbb, #999);
}

@media (max-width: 768px) {
    .btn-them-gio {
        background: linear-gradient(135deg, #ff9800, #ff5722);
        border: none;
        max-width: 140px;             /* ✅ ÉP NÚT DÀI RA */
        padding: 0 10px;              /* trái / phải */
        height: 30px;      /* đồng bộ chiều cao input */
        line-height: 10px;
        border-radius: 20px;      /* bo tròn */
        padding: 12px 26px;
        font-size: 15px;
        font-weight: 600;
        color: #fff;
        box-shadow: 0 6px 14px rgba(0,0,0,0.25);
        transition: all 0.25s ease;
    }
.btn-them-gio:disabled:hover {
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #ff5722, #e64a19);
}
  
}


