@media (max-width: 768px) {
  body {
    background-color: #f5fff5;
  }

  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }

  .header-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 10px;
  }

  /* HEADER แบบใหม่สำหรับมือถือ */
  .mobile-header {
    display: flex;
    justify-content: space-between; /* icon ซ้าย-ขวา และโลโก้ตรงกลาง */
    align-items: center;
    padding: 15px 0px;
  }

  .mobile-icon {
    width: 15px;
    text-align: center;
    position: relative;
  }

  .mobile-logo {
    font-size: 30px;
    font-weight: bold;
    color: #2d572c;
    text-align: center;
    flex: 1; /* ขยายโลโก้ให้กินพื้นที่ตรงกลาง */
  }

  .menu-icon {
    font-size: 22px;
    color: #2d572c;
    cursor: pointer;
  }

  .cart-count {
    position: absolute;
    top: -6px;
    right: -10px;
    background: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
  }

  /* ช่องค้นหา */
  .search-box {
    width: 100%;
    position: relative;
    padding: 0 10px;
    margin-top: 10px;
  }

  .search-box input {
    width: 86%;
    padding: 10px 40px 10px 12px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
  }

  .clear-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
    font-size: 18px;
    color: #aaa;
    cursor: pointer;
  }

  /* เมนูหลัก */
  nav ul {
    display: none;
    flex-direction: column;
    background-color: #ffffff;
    padding: 12px;
    margin: 10px;
    border-radius: 12px;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 999;
  }

  nav ul.show {
    display: flex;
  }

  nav ul li {
    list-style: none;
  }

  nav ul li a {
    display: block;
    background-color: #e8f5e9;
    color: #2d572c;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
  }

  nav ul li a:hover {
    background-color: #c8e6c9;
    color: #1b5e20;
  }

  /* หมวดหมู่ราคาสินค้า */
  .price-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 10px;
    gap: 10px;
    background-color: #e8f5e9;
    border-radius: 12px;
    margin: 10px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  }

  .price-tag {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    background-color: #fff;
    color: #2d572c;
    border: 1px solid #c8e6c9;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
  }

  .price-tag:hover {
    background-color: #dcedc8;
    color: #1b5e20;
  }

  .price-tag.active {
    background-color: #2d572c;
    color: #fff;
    border-color: #2d572c;
    font-weight: 600;
  }

  /* รายการสินค้า */
  .product-list > div {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 15px !important;
  }

  .product-card {
    margin: 0;
  }
  /* ซ่อนเมนูตอนปิด */
.nav-links {
  display: none;
  flex-direction: column;
  background: #fff;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* โชว์เมนูตอนเปิด */
.nav-links.active {
  display: flex;
}

}
